dojo i18n does not support fallback to locales listed in djConfig.extraLocale
Suppose djConfig.locale is set to "hi" and djConfig.extraLocale to ["ja", "en"]. Also suppose that there is no "hi" directory under the nls directory concerned but there is a "ja" directory. I would expect to get "ja" localizations akin to the http Accept-language contract. Unfortunately dojo.i18n._requireLocalization loads the "ROOT" localization for the non-existent "hi" locale without any indication that it did so. So there is no way of knowing if you are actually getting strings for the locale specified or just the default ones.
Ideally in the above case dojo i18n should iterate thru' the extraLocale list and try to return localized strings based on that list. At the very least dojo i18n should indicate that a default localization was loaded (in i18n.getLocalization) so that users have the choice of retryign with other locales on the extraLocale list.
Change History (4)
Priority: |
high →
normal
|
Type: |
defect →
enhancement
|
Cc: |
jamestag added
|
Resolution: |
→ wontfix
|
Status: |
new →
closed
|
Cc: |
James Burke added; jamestag removed
|
Summary: |
dojo i18n does not support honoring locales listed in djConfig.extraLocale →
dojo i18n does not support fallback to locales listed in djConfig.extraLocale
|
Working as designed. If the documentation was unclear, please provide comments and it will be fixed. extraLocale is for additional locale support on a page and is not a fallback list. There is presently no functionality in Dojo like the http language header which provides fallback. Given that resources are sparse, I'm not sure there really is any way to detect whether a given locale was 'found' since it is possible that the given locale does not override any of the resources in ROOT.