From 6ebae054c67e2e8688d1bfd030c583cbbb0701f4 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Wed, 22 Dec 2021 18:21:27 +0200 Subject: [PATCH] L10n: Remove the ability to specify the fallback language and use includes instead --- Web/Util/Localizator.php | 2 +- locales/am.strings | 3 ++- locales/by.strings | 3 ++- locales/by_lat.strings | 3 ++- locales/de.strings | 3 ++- locales/eo.strings | 3 ++- locales/kk.strings | 3 ++- locales/pl.strings | 3 ++- locales/ru_old.strings | 3 ++- locales/sr_cyr.strings | 3 ++- locales/sr_lat.strings | 3 ++- locales/tr.strings | 3 ++- locales/ua.strings | 3 ++- 13 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Web/Util/Localizator.php b/Web/Util/Localizator.php index fb25b370..d73bec13 100644 --- a/Web/Util/Localizator.php +++ b/Web/Util/Localizator.php @@ -57,7 +57,7 @@ class Localizator $lang = is_null($lang) ? static::DEFAULT_LANG : $lang; $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 diff --git a/locales/am.strings b/locales/am.strings index 3bcee857..437f30a9 100644 --- a/locales/am.strings +++ b/locales/am.strings @@ -1,6 +1,7 @@ +#include + "__locale" = "hy_AM.utf8;hy_AM.UTF-8;Arm"; "__WinEncoding" = "Windows-1251"; -"__fallback" = "en"; /* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */ diff --git a/locales/by.strings b/locales/by.strings index 5eefa747..edf272f6 100644 --- a/locales/by.strings +++ b/locales/by.strings @@ -1,5 +1,6 @@ +#include + "__locale" = "be_BY.UTF-8;Bel"; -"__fallback" = "ru"; /* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */ diff --git a/locales/by_lat.strings b/locales/by_lat.strings index 8b032e8d..4056999f 100644 --- a/locales/by_lat.strings +++ b/locales/by_lat.strings @@ -1,6 +1,7 @@ +#include + "__locale" = "be_BY@latin;Bel_Lat"; "__WinEncoding" = "Windows-1251"; -"__fallback" = "ru"; /* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */ diff --git a/locales/de.strings b/locales/de.strings index 4c037179..0fdf1b38 100644 --- a/locales/de.strings +++ b/locales/de.strings @@ -1,5 +1,6 @@ +#include + "__locale" = "de_DE.UTF-8;Deu"; -"__fallback" = "en"; /* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */ diff --git a/locales/eo.strings b/locales/eo.strings index e35a7ab3..14ac78cb 100644 --- a/locales/eo.strings +++ b/locales/eo.strings @@ -1,5 +1,6 @@ +#include + "__locale" = "eo.utf8"; -"__fallback" = "en"; /* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */ diff --git a/locales/kk.strings b/locales/kk.strings index 5c6cbbd3..6bb9f5aa 100644 --- a/locales/kk.strings +++ b/locales/kk.strings @@ -1,5 +1,6 @@ +#include + "__locale" = "kk_KZ.UTF-8;Kaz"; -"__fallback" = "ru"; /* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */ diff --git a/locales/pl.strings b/locales/pl.strings index 8f6e3da1..1fe5fd0b 100644 --- a/locales/pl.strings +++ b/locales/pl.strings @@ -1,6 +1,7 @@ +#include + "__locale" = "pl_PL.utf8;pl_PL.UTF-8;Pol"; "__WinEncoding" = "Windows-1251"; -"__fallback" = "en"; /* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */ diff --git a/locales/ru_old.strings b/locales/ru_old.strings index e4893ade..f4c0193c 100644 --- a/locales/ru_old.strings +++ b/locales/ru_old.strings @@ -1,6 +1,7 @@ +#include + "__locale" = "ru_UA.utf8;ru_RU.UTF-8;Rus"; "__WinEncoding" = "Windows-1251"; -"__fallback" = "ru"; /* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */ diff --git a/locales/sr_cyr.strings b/locales/sr_cyr.strings index e9778187..55937634 100644 --- a/locales/sr_cyr.strings +++ b/locales/sr_cyr.strings @@ -1,5 +1,6 @@ +#include + "__locale" = "sr_CS.UTF-8;Srb"; -"__fallback" = "ru"; /* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */ diff --git a/locales/sr_lat.strings b/locales/sr_lat.strings index 869347ae..4fd69b31 100644 --- a/locales/sr_lat.strings +++ b/locales/sr_lat.strings @@ -1,5 +1,6 @@ +#include + "__locale" = "sr_CS.UTF-8;Srb_Latin"; -"__fallback" = "en"; /* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */ diff --git a/locales/tr.strings b/locales/tr.strings index ea7255e8..1172c4da 100644 --- a/locales/tr.strings +++ b/locales/tr.strings @@ -1,5 +1,6 @@ +#include + "__locale" = "tr_TR.UTF-8;Tur"; -"__fallback" = "en"; /* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */ diff --git a/locales/ua.strings b/locales/ua.strings index 184eaebb..a5d45456 100644 --- a/locales/ua.strings +++ b/locales/ua.strings @@ -1,6 +1,7 @@ +#include + "__locale" = "uk_UA.utf8;Ukr"; "__WinEncoding" = "Windows-1251"; -"__fallback" = "ru"; /* Check for https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html */