You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2013/10/06 15:37:15 UTC

[2/4] git commit: [flex-sdk] [refs/heads/languageLocale] - Add the language locale as a fallback in the locale chain

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 <jm...@apache.org>
Authored: Fri Sep 20 16:34:53 2013 +1000
Committer: Justin Mclean <jm...@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.