Made localized normal bundle take precedence over default custom locale

bundles
This commit is contained in:
ile123ile 2014-08-31 17:14:25 -07:00
parent db2128daeb
commit 628f59ba54

View File

@ -37,31 +37,27 @@ public final class LocaleLoader {
initialize(); initialize();
} }
for(ResourceBundle bundle : bundles) { for(ResourceBundle customBundle : bundles) {
if(bundle.containsKey(key)) { if(customBundle.containsKey(key)) {
return getString(key, bundle, messageArguments); return getString(key, customBundle, messageArguments);
} }
} }
for(ResourceBundle bundle : defaultBundles) { if(bundle.containsKey(key)) {
if(bundle.containsKey(key)) { return getString(key, bundle, messageArguments);
return getString(key, bundle, messageArguments); }
for(ResourceBundle defaultCustomBundle : defaultBundles) {
if(defaultCustomBundle.containsKey(key)) {
return getString(key, defaultCustomBundle, messageArguments);
} }
} }
try { if(enBundle.containsKey(key)) {
return getString(key, bundle, messageArguments); return getString(key, enBundle, messageArguments);
}
if (!key.contains("Guides")) {
mcMMO.p.getLogger().warning("Could not find locale string: " + key);
} }
catch (MissingResourceException ex) {
try {
return getString(key, enBundle, messageArguments);
}
catch (MissingResourceException ex2) {
if (!key.contains("Guides")) {
mcMMO.p.getLogger().warning("Could not find locale string: " + key);
}
return '!' + key + '!'; return '!' + key + '!';
}
}
} }
private static String getString(String key, ResourceBundle bundle, Object... messageArguments) throws MissingResourceException { private static String getString(String key, ResourceBundle bundle, Object... messageArguments) throws MissingResourceException {