mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Made localized normal bundle take precedence over default custom locale
bundles
This commit is contained in:
parent
db2128daeb
commit
628f59ba54
@ -37,32 +37,28 @@ public final class LocaleLoader {
|
|||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(ResourceBundle bundle : bundles) {
|
for(ResourceBundle customBundle : bundles) {
|
||||||
|
if(customBundle.containsKey(key)) {
|
||||||
|
return getString(key, customBundle, messageArguments);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(bundle.containsKey(key)) {
|
if(bundle.containsKey(key)) {
|
||||||
return getString(key, bundle, messageArguments);
|
return getString(key, bundle, messageArguments);
|
||||||
}
|
}
|
||||||
}
|
for(ResourceBundle defaultCustomBundle : defaultBundles) {
|
||||||
for(ResourceBundle bundle : defaultBundles) {
|
if(defaultCustomBundle.containsKey(key)) {
|
||||||
if(bundle.containsKey(key)) {
|
return getString(key, defaultCustomBundle, messageArguments);
|
||||||
return getString(key, bundle, messageArguments);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
if(enBundle.containsKey(key)) {
|
||||||
return getString(key, bundle, messageArguments);
|
|
||||||
}
|
|
||||||
catch (MissingResourceException ex) {
|
|
||||||
try {
|
|
||||||
return getString(key, enBundle, messageArguments);
|
return getString(key, enBundle, messageArguments);
|
||||||
}
|
}
|
||||||
catch (MissingResourceException ex2) {
|
|
||||||
if (!key.contains("Guides")) {
|
if (!key.contains("Guides")) {
|
||||||
mcMMO.p.getLogger().warning("Could not find locale string: " + key);
|
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 {
|
||||||
return formatString(bundle.getString(key), messageArguments);
|
return formatString(bundle.getString(key), messageArguments);
|
||||||
|
Loading…
Reference in New Issue
Block a user