Fix loading custom en based translations

This commit is contained in:
Luck 2020-10-22 09:17:30 +01:00
parent 6b05e47deb
commit ab0e25a56d
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -101,7 +101,11 @@ public class TranslationManager {
*/
private void loadBase() {
ResourceBundle bundle = ResourceBundle.getBundle("luckperms", DEFAULT_LOCALE, UTF8ResourceBundleControl.get());
this.registry.registerAll(DEFAULT_LOCALE, bundle, false);
try {
this.registry.registerAll(DEFAULT_LOCALE, bundle, false);
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
}
/**
@ -131,7 +135,7 @@ public class TranslationManager {
// try registering the locale without a country code - if we don't already have a registration for that
loaded.forEach((locale, bundle) -> {
Locale localeWithoutCountry = new Locale(locale.getLanguage());
if (!locale.equals(localeWithoutCountry) && this.installed.add(localeWithoutCountry)) {
if (!locale.equals(localeWithoutCountry) && !localeWithoutCountry.equals(DEFAULT_LOCALE) && this.installed.add(localeWithoutCountry)) {
this.registry.registerAll(localeWithoutCountry, bundle, false);
}
});