diff options
author | Tor Norbye <tnorbye@google.com> | 2014-09-02 18:29:17 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-02 18:29:17 +0000 |
commit | 2bee0c98829bee078940af9d864a05ff0c22486e (patch) | |
tree | 437d2c09c00f4832260a4b147a300c6d491f41fb | |
parent | ddb5d875c38022441d4b2e9de3b874b5e1c4df9b (diff) | |
parent | 9c676ef418fcfc933a07d6e1ffeeffed49a21f2b (diff) | |
download | sdk-2bee0c98829bee078940af9d864a05ff0c22486e.zip sdk-2bee0c98829bee078940af9d864a05ff0c22486e.tar.gz sdk-2bee0c98829bee078940af9d864a05ff0c22486e.tar.bz2 |
am 9c676ef4: Merge "Match language-specific flags before default locale country matches" into idea133 automerge: 1687a96
* commit '9c676ef418fcfc933a07d6e1ffeeffed49a21f2b':
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.java | 23 |
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()) { |