1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-09-28 14:30:51 +00:00

Lang: Update comments for fallbacks [#330]

This commit is contained in:
gnosygnu 2019-02-17 20:14:16 -05:00
parent c383f2a231
commit 91cbb34fa5
2 changed files with 5 additions and 1 deletions

View File

@ -62,6 +62,10 @@ public class Xol_lang_itm implements Gfo_invk {
try {
for (byte[] key : fallback_bry_ary) {
String val = String_.new_u8(key);
// NOTE: dupes can happen, b/c fallback works by loading current language, and then loading each fallback's langs to cur language;
// EX:
// * lang.Load_lang("gl") calls lang.Fallback_bry_ with "pt" (the fallback_lang) and "en" (the default lang)
// * then lang.Fallback_bry_ calls lang.Exec_fallback_load("pt") which calls lang.Fallack_bry_ with "pt-br"(the fallback_lang) and "en" (the default lang)
fallback_hash.Add_if_dupe_use_1st(val, val);
}
} catch (Exception exc) {

View File

@ -21,7 +21,7 @@ public class Xol_lang_itm_tst {
@Test public void Fallback_bry__dupes() { // ISSUE#:330; DATE:2019-02-17
Xol_lang_itm lang = fxt.Make("qqq");
fxt.Init_fallback_bry(lang, "en");
fxt.Init_fallback_bry(lang, "en"); // duplicate call would throw error; note that dupes can happen b/c "en" is default language; EX: isRTL("gl") -> "pt-br,en" -> "pt,en"
fxt.Init_fallback_bry(lang, "en"); // dupes would throw error; note that dupes can happen b/c "en" is default language; EX: isRTL("gl") -> "pt-br,en" -> "pt,en"
Gftest.Eq__str("en", lang.Fallback_bry());
}
}