diff --git a/pom.xml b/pom.xml index ae5f6fd..7d09aec 100644 --- a/pom.xml +++ b/pom.xml @@ -84,5 +84,11 @@ 1.19.2-R0.1-SNAPSHOT provided + + org.junit.jupiter + junit-jupiter + 5.9.2 + test + diff --git a/src/main/java/net/knarcraft/knarlib/formatting/Translator.java b/src/main/java/net/knarcraft/knarlib/formatting/Translator.java index b241748..1692c55 100644 --- a/src/main/java/net/knarcraft/knarlib/formatting/Translator.java +++ b/src/main/java/net/knarcraft/knarlib/formatting/Translator.java @@ -48,10 +48,11 @@ public final class Translator { * Loads the languages used by this translator * * @param dataFolder

The data folder to load custom strings from

+ * @param fallbackLanguage

The default language to fall back on in the case of missing translations

* @param selectedLanguage

The currently selected language

*/ - public void loadLanguages(File dataFolder, String selectedLanguage) { - backupTranslatedMessages = loadTranslatedMessages("en"); + public void loadLanguages(File dataFolder, String fallbackLanguage, String selectedLanguage) { + backupTranslatedMessages = loadTranslatedMessages(fallbackLanguage); translatedMessages = loadCustomTranslatedMessages(dataFolder, selectedLanguage); if (translatedMessages == null) { translatedMessages = loadTranslatedMessages(selectedLanguage);