From a436d993151fb7a29081886b95fc3b0d60bac2c2 Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 7 Sep 2020 10:01:24 -0700 Subject: [PATCH] Use constant for "en-US" --- .../world/bentobox/bentobox/managers/LocalesManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/managers/LocalesManager.java b/src/main/java/world/bentobox/bentobox/managers/LocalesManager.java index 504f7a5e2..9f0a4838e 100644 --- a/src/main/java/world/bentobox/bentobox/managers/LocalesManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/LocalesManager.java @@ -40,6 +40,7 @@ public class LocalesManager { private static final String LOCALE_FOLDER = "locales"; private static final String BENTOBOX = "BentoBox"; private static final String SPACER = "*************************************************"; + private static final String EN_US_TAG = "en-US"; public LocalesManager(BentoBox plugin) { this.plugin = plugin; @@ -98,8 +99,8 @@ public class LocalesManager { return languages.get(Locale.forLanguageTag(plugin.getSettings().getDefaultLanguage())).get(reference); } // Get the translation from the en-US locale - if (languages.get(Locale.forLanguageTag("en-US")).contains(reference)) { - return languages.get(Locale.forLanguageTag("en-US")).get(reference); + if (languages.get(Locale.forLanguageTag(EN_US_TAG)).contains(reference)) { + return languages.get(Locale.forLanguageTag(EN_US_TAG)).get(reference); } return null; } @@ -135,7 +136,7 @@ public class LocalesManager { prefixes.addAll(languages.get(Locale.forLanguageTag(plugin.getSettings().getDefaultLanguage())).getPrefixes()); // Get the prefixes from the en-US locale - prefixes.addAll(languages.get(Locale.forLanguageTag("en-US")).getPrefixes()); + prefixes.addAll(languages.get(Locale.forLanguageTag(EN_US_TAG)).getPrefixes()); return prefixes; }