aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2015-03-20 22:17:13 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-03-20 22:17:13 +0000
commitb60ab4e54da4131b8d80673d9646b807f7e781f1 (patch)
treef8701820a4e27757c8687b9d4e35a902e6fb011f
parentc714e27a4ef2f451bd0517de73797405dcdf683b (diff)
parent2bee0c98829bee078940af9d864a05ff0c22486e (diff)
downloadsdk-b60ab4e54da4131b8d80673d9646b807f7e781f1.zip
sdk-b60ab4e54da4131b8d80673d9646b807f7e781f1.tar.gz
sdk-b60ab4e54da4131b8d80673d9646b807f7e781f1.tar.bz2
am 2bee0c98: am 9c676ef4: Merge "Match language-specific flags before default locale country matches" into idea133 automerge: 1687a96
* commit '2bee0c98829bee078940af9d864a05ff0c22486e': Match language-specific flags before default locale country matches
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/FlagManager.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/FlagManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/FlagManager.java
index 0e6acd7..484acb7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/FlagManager.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/FlagManager.java
@@ -98,6 +98,17 @@ public class FlagManager {
// Look up the region for a given language
assert language != null;
+ // Special cases where we have a dedicated flag available:
+ if (language.equals("ca")) { //$NON-NLS-1$
+ return getIcon("catalonia"); //$NON-NLS-1$
+ }
+ else if (language.equals("gd")) { //$NON-NLS-1$
+ return getIcon("scotland"); //$NON-NLS-1$
+ }
+ else if (language.equals("cy")) { //$NON-NLS-1$
+ return getIcon("wales"); //$NON-NLS-1$
+ }
+
// Prefer the local registration of the current locale; even if
// for example the default locale for English is the US, if the current
// default locale is English, then use its associated country, which could
@@ -110,17 +121,7 @@ public class FlagManager {
}
}
- // Special cases where we have a dedicated flag available:
- if (language.equals("ca")) { //$NON-NLS-1$
- region = "catalonia"; //$NON-NLS-1$
- } else if (language.equals("gd")) { //$NON-NLS-1$
- region = "scotland"; //$NON-NLS-1$
- } else if (language.equals("cy")) { //$NON-NLS-1$
- region = "wales"; //$NON-NLS-1$
- } else {
- // Attempt to look up the country from the language
- region = LocaleManager.getLanguageRegion(language);
- }
+ region = LocaleManager.getLanguageRegion(language);
}
if (region == null || region.isEmpty()) {