From 15e6e0c06d948603441202ce4d62376d64d50ae8 Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Fri, 29 Aug 2014 12:38:53 -0700 Subject: Match language-specific flags before default locale country matches Fixes issue 75173. Change-Id: Ic825a50664e2c6bae47499482ead8f60a3758787 --- .../editors/layout/configuration/FlagManager.java | 23 +++++++++++----------- 1 file 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()) { -- cgit v1.1