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:
parent
c383f2a231
commit
91cbb34fa5
@ -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) {
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user