Add the language locale as a fallback in the locale chain
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/7ac5353c Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/7ac5353c Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/7ac5353c Branch: refs/heads/languageLocale Commit: 7ac5353c62474702dc89f8e7d63dd808775c1c6b Parents: 5f6625e Author: Justin Mclean <jmcl...@apache.org> Authored: Fri Sep 20 16:34:53 2013 +1000 Committer: Justin Mclean <jmcl...@apache.org> Committed: Fri Sep 20 16:34:53 2013 +1000 ---------------------------------------------------------------------- .../projects/framework/src/mx/resources/LocaleSorter.as | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/7ac5353c/frameworks/projects/framework/src/mx/resources/LocaleSorter.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/framework/src/mx/resources/LocaleSorter.as b/frameworks/projects/framework/src/mx/resources/LocaleSorter.as index fb09fca..9ca02a1 100644 --- a/frameworks/projects/framework/src/mx/resources/LocaleSorter.as +++ b/frameworks/projects/framework/src/mx/resources/LocaleSorter.as @@ -73,6 +73,13 @@ public class LocaleSorter var locales:Array = trimAndNormalize(appLocales); var preferenceLocales:Array = trimAndNormalize(systemPreferences); + // Add the language as the ultimate fallback if not specified + if (locales && locale.length > 0) { + if (locale[0].length > 2 && ultimateFallbackLocale == null) { + ultimateFallbackLocale = locale[0].split("_")[0]; + } + } + addUltimateFallbackLocale(preferenceLocales, ultimateFallbackLocale); // For better performance, save the locales in a lookup table.