You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, say I have en-GB, de-DE and de-CH.
My base_locale is set as en-GB.
What I'd like to have, is for example. en-GB:
hello: Hellocat: catfallback: I'm still standing
de-DE:
hello: Hallocat: Katze
de-CH:
hello: Grüezi
In this example, the hello would return the value set, but cat should return Katze for both de-DE and de-CH locales.
And if the fallback is not set, this would fall again to en-GB.
I hope that was clear :)
The text was updated successfully, but these errors were encountered:
TLDR:
The developer must define fallbacks to every language code similarly to base_locale.
For example,
base_locale: en-GBbase_locales:
de: 'de-DE'fr: 'fr-FR'en: 'en-GB'
Logically, if there is only de-AT, de-LI, and de-CH while there is a string in de-AT is missing, what should be chosen? de-LI or de-CH? A more relevant issue arises with Chinese languages: zh-CN, zh-HK, zh-TW, here we don't have a clear order if one of them is missing.
Technially, it is important to find the precedence order because we only have 2 viable options:
(1) Fallback during runtime
Similarly to the current fallback mechanism, we need to introduce another inheritance step: DeCh extends DeDe extends enGb. What should be the order? It must be defined.
(2) Fallback during code generation
We could render the fallback strings during code generation but since slang currently generates each locale one by one, we need an explicit order: en-GB, then de-DE, then de-CH. If de-CH is generated before de-DE, there would be no fallback since there is no other de generated yet.
Is there a way to fallback to the language code?
For example, say I have
en-GB
,de-DE
andde-CH
.My
base_locale
is set asen-GB
.What I'd like to have, is for example.
en-GB
:de-DE
:de-CH
:In this example, the
hello
would return the value set, butcat
should returnKatze
for bothde-DE
andde-CH
locales.And if the
fallback
is not set, this would fall again toen-GB
.I hope that was clear :)
The text was updated successfully, but these errors were encountered: