Makes the fallback language configurable
This commit is contained in:
parent
4f7f33be27
commit
341fce44e5
6
pom.xml
6
pom.xml
@ -84,5 +84,11 @@
|
||||
<version>1.19.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>5.9.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -48,10 +48,11 @@ public final class Translator {
|
||||
* Loads the languages used by this translator
|
||||
*
|
||||
* @param dataFolder <p>The data folder to load custom strings from</p>
|
||||
* @param fallbackLanguage <p>The default language to fall back on in the case of missing translations</p>
|
||||
* @param selectedLanguage <p>The currently selected language</p>
|
||||
*/
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user