From cbb605df8197432093f09179251f5e404e080f9e Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Thu, 12 Nov 2020 23:16:40 +0100 Subject: [PATCH] Set default locale to English if it is set to an invalid one in config --- .../java/com/Acrobot/ChestShop/Configuration/Messages.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/Acrobot/ChestShop/Configuration/Messages.java b/src/main/java/com/Acrobot/ChestShop/Configuration/Messages.java index 13114f3..612a8fa 100644 --- a/src/main/java/com/Acrobot/ChestShop/Configuration/Messages.java +++ b/src/main/java/com/Acrobot/ChestShop/Configuration/Messages.java @@ -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()) {