mirror of
https://github.com/openvk/openvk
synced 2024-11-13 10:39:24 +03:00
L18n: Check for language availablitiy while language switching
Fixed #280
This commit is contained in:
parent
d72fa1aac9
commit
af45a85ff7
1 changed files with 4 additions and 1 deletions
|
@ -109,7 +109,10 @@ function tr(string $stringId, ...$variables): string
|
||||||
|
|
||||||
function setLanguage($lg): void
|
function setLanguage($lg): void
|
||||||
{
|
{
|
||||||
Session::i()->set("lang", $lg);
|
if (isLanguageAvailable($lg))
|
||||||
|
Session::i()->set("lang", $lg);
|
||||||
|
else
|
||||||
|
trigger_error("The language '$lg' is not available", E_USER_NOTICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLanguages(): array
|
function getLanguages(): array
|
||||||
|
|
Loading…
Reference in a new issue