Set default locale to English if it is set to an invalid one in config

This commit is contained in:
Phoenix616 2020-11-12 23:16:40 +01:00
parent 4bd443c69f
commit cbb605df81
No known key found for this signature in database
GPG Key ID: 40E2321E71738EB0
1 changed files with 5 additions and 0 deletions

View File

@ -125,6 +125,11 @@ public class Messages {
}
manager = new LanguageManager(ChestShop.getPlugin(), Properties.DEFAULT_LANGUAGE);
if (manager.getDefaultConfig() == null) {
manager.setDefaultLocale("en");
ChestShop.getBukkitLogger().log(Level.WARNING, "There is no language file for your DEFAULT_LANGUAGE config setting of '" + Properties.DEFAULT_LANGUAGE + "' in your languages folder! Using default English as default until you have created one or changed the config option to another, existing language file.");
}
// Legacy locale.yml file
File legacyFile = new File(ChestShop.getPlugin().getDataFolder(), "local.yml");
if (legacyFile.exists()) {