mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
L10n: Remove the ability to specify the fallback language and use includes instead
This commit is contained in:
parent
70b4712c92
commit
6ebae054c6
13 changed files with 25 additions and 13 deletions
|
@ -57,7 +57,7 @@ class Localizator
|
||||||
$lang = is_null($lang) ? static::DEFAULT_LANG : $lang;
|
$lang = is_null($lang) ? static::DEFAULT_LANG : $lang;
|
||||||
$array = @self::parse(dirname(__FILE__) . "/../../locales/$lang.strings");
|
$array = @self::parse(dirname(__FILE__) . "/../../locales/$lang.strings");
|
||||||
|
|
||||||
return $array[$id] ?? (!empty($array["__fallback"]) ? $this->_($id, $array["__fallback"]) : "@$id");
|
return $array[$id] ?? "@$id";
|
||||||
}
|
}
|
||||||
|
|
||||||
function export($lang = NULL): ?array
|
function export($lang = NULL): ?array
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
#include <en>
|
||||||
|
|
||||||
"__locale" = "hy_AM.utf8;hy_AM.UTF-8;Arm";
|
"__locale" = "hy_AM.utf8;hy_AM.UTF-8;Arm";
|
||||||
"__WinEncoding" = "Windows-1251";
|
"__WinEncoding" = "Windows-1251";
|
||||||
"__fallback" = "en";
|
|
||||||
|
|
||||||
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
#include <ru>
|
||||||
|
|
||||||
"__locale" = "be_BY.UTF-8;Bel";
|
"__locale" = "be_BY.UTF-8;Bel";
|
||||||
"__fallback" = "ru";
|
|
||||||
|
|
||||||
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
#include <ru>
|
||||||
|
|
||||||
"__locale" = "be_BY@latin;Bel_Lat";
|
"__locale" = "be_BY@latin;Bel_Lat";
|
||||||
"__WinEncoding" = "Windows-1251";
|
"__WinEncoding" = "Windows-1251";
|
||||||
"__fallback" = "ru";
|
|
||||||
|
|
||||||
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
#include <en>
|
||||||
|
|
||||||
"__locale" = "de_DE.UTF-8;Deu";
|
"__locale" = "de_DE.UTF-8;Deu";
|
||||||
"__fallback" = "en";
|
|
||||||
|
|
||||||
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
#include <en>
|
||||||
|
|
||||||
"__locale" = "eo.utf8";
|
"__locale" = "eo.utf8";
|
||||||
"__fallback" = "en";
|
|
||||||
|
|
||||||
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
#include <ru>
|
||||||
|
|
||||||
"__locale" = "kk_KZ.UTF-8;Kaz";
|
"__locale" = "kk_KZ.UTF-8;Kaz";
|
||||||
"__fallback" = "ru";
|
|
||||||
|
|
||||||
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
#include <en>
|
||||||
|
|
||||||
"__locale" = "pl_PL.utf8;pl_PL.UTF-8;Pol";
|
"__locale" = "pl_PL.utf8;pl_PL.UTF-8;Pol";
|
||||||
"__WinEncoding" = "Windows-1251";
|
"__WinEncoding" = "Windows-1251";
|
||||||
"__fallback" = "en";
|
|
||||||
|
|
||||||
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
#include <ru>
|
||||||
|
|
||||||
"__locale" = "ru_UA.utf8;ru_RU.UTF-8;Rus";
|
"__locale" = "ru_UA.utf8;ru_RU.UTF-8;Rus";
|
||||||
"__WinEncoding" = "Windows-1251";
|
"__WinEncoding" = "Windows-1251";
|
||||||
"__fallback" = "ru";
|
|
||||||
|
|
||||||
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
#include <ru>
|
||||||
|
|
||||||
"__locale" = "sr_CS.UTF-8;Srb";
|
"__locale" = "sr_CS.UTF-8;Srb";
|
||||||
"__fallback" = "ru";
|
|
||||||
|
|
||||||
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
#include <en>
|
||||||
|
|
||||||
"__locale" = "sr_CS.UTF-8;Srb_Latin";
|
"__locale" = "sr_CS.UTF-8;Srb_Latin";
|
||||||
"__fallback" = "en";
|
|
||||||
|
|
||||||
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
#include <en>
|
||||||
|
|
||||||
"__locale" = "tr_TR.UTF-8;Tur";
|
"__locale" = "tr_TR.UTF-8;Tur";
|
||||||
"__fallback" = "en";
|
|
||||||
|
|
||||||
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
#include <ru>
|
||||||
|
|
||||||
"__locale" = "uk_UA.utf8;Ukr";
|
"__locale" = "uk_UA.utf8;Ukr";
|
||||||
"__WinEncoding" = "Windows-1251";
|
"__WinEncoding" = "Windows-1251";
|
||||||
"__fallback" = "ru";
|
|
||||||
|
|
||||||
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
/* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue