Revision 41694
trunk/org.gvsig.desktop/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/impl/DefaultLocaleManager.java | ||
---|---|---|
126 | 126 |
return new Locale(language, country, variant); |
127 | 127 |
} |
128 | 128 |
|
129 |
public Set<Locale> loadLocalesFromConfing(File localesFile) {
|
|
129 |
private Set<Locale> loadLocalesFromConfing(File localesFile) {
|
|
130 | 130 |
PropertiesConfiguration config = null; |
131 | 131 |
if (!localesFile.canRead()) { |
132 | 132 |
return null; |
... | ... | |
141 | 141 |
Set<Locale> locales = new HashSet<Locale>(); |
142 | 142 |
List localeCodes = config.getList("locale"); |
143 | 143 |
for (Object localeCode : localeCodes) { |
144 |
Locale locale = LocaleUtils.toLocale((String) localeCode); |
|
145 |
locales.add(locale); |
|
144 |
try { |
|
145 |
Locale locale = LocaleUtils.toLocale((String) localeCode); |
|
146 |
locales.add(locale); |
|
147 |
} catch(IllegalArgumentException ex) { |
|
148 |
logger.warn("Can't load locale '"+localeCode+"' from config '"+localesFile.getAbsolutePath()+"'.",ex); |
|
149 |
} |
|
146 | 150 |
} |
147 | 151 |
return locales; |
148 | 152 |
} |
... | ... | |
194 | 198 |
if (t1 == null || t0 == null) { |
195 | 199 |
return 0; |
196 | 200 |
} |
197 |
return getLanguageDisplayName(t0).compareToIgnoreCase(getLanguageDisplayName(t1)); |
|
201 |
// return getLanguageDisplayName(t0).compareToIgnoreCase(getLanguageDisplayName(t1)); |
|
202 |
return t0.toString().compareToIgnoreCase(t1.toString()); |
|
198 | 203 |
} |
199 | 204 |
}); |
200 | 205 |
|
... | ... | |
209 | 214 |
} else { |
210 | 215 |
XMLEntity localesEntity = getRegisteredLocalesPersistence(); |
211 | 216 |
for (int i = 0; i < localesEntity.getChildrenCount(); i++) { |
217 |
Locale locale = null; |
|
212 | 218 |
XMLEntity localeEntity = localesEntity.getChild(i); |
213 | 219 |
String language = localeEntity.getStringProperty(LANGUAGE); |
214 | 220 |
String country = localeEntity.getStringProperty(COUNTRY); |
215 | 221 |
String variant = localeEntity.getStringProperty(VARIANT); |
216 |
Locale locale = new Locale(language, country, variant);
|
|
222 |
locale = new Locale(language, country, variant); |
|
217 | 223 |
installedLocales.add(locale); |
218 | 224 |
} |
219 | 225 |
} |
Also available in: Unified diff