aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-08-29 12:38:53 -0700
committerTor Norbye <tnorbye@google.com>2014-08-29 12:41:37 -0700
commit15e6e0c06d948603441202ce4d62376d64d50ae8 (patch)
tree052bc9bd94aaee688696c7e1b40f7d0404c40051 /eclipse
parent956b01fd91a6a576e8c8e35b2d608408e866c5da (diff)
downloadsdk-15e6e0c06d948603441202ce4d62376d64d50ae8.zip
sdk-15e6e0c06d948603441202ce4d62376d64d50ae8.tar.gz
sdk-15e6e0c06d948603441202ce4d62376d64d50ae8.tar.bz2
Match language-specific flags before default locale country matches
Fixes issue 75173. Change-Id: Ic825a50664e2c6bae47499482ead8f60a3758787
Diffstat (limited to 'eclipse')
-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()) {