mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 04:35:50 +01:00
Fix locale loading when setting is empty
This commit is contained in:
parent
a5253da44e
commit
585cbb2888
@ -318,7 +318,9 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||
|
||||
private void setupTranslator() {
|
||||
Locale locale = Locale.getDefault();
|
||||
String[] parts = Setting.LOCALE.asString().split("[\\._]");
|
||||
String setting = Setting.LOCALE.asString();
|
||||
if (!setting.isEmpty()) {
|
||||
String[] parts = setting.split("[\\._]");
|
||||
switch (parts.length) {
|
||||
case 1:
|
||||
locale = new Locale(parts[0]);
|
||||
@ -332,6 +334,7 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
Translator.setInstance(new File(getDataFolder(), "lang"), locale);
|
||||
Messaging.logTr(Messages.LOCALE_NOTIFICATION, locale);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user