mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-10 13:23:01 +08:00
Handle with undetermined locale language config (#611)
* Update GiveAllCommand.java giveall command nomore give arts * Update Grasscutter.java * Update Grasscutter.java
This commit is contained in:
parent
557e641fca
commit
0690e23116
@ -149,7 +149,13 @@ public final class Grasscutter {
|
|||||||
|
|
||||||
public static void loadLanguage() {
|
public static void loadLanguage() {
|
||||||
var locale = config.LocaleLanguage;
|
var locale = config.LocaleLanguage;
|
||||||
language = Language.getLanguage(locale.toLanguageTag());
|
String languageTag = locale.toLanguageTag();
|
||||||
|
if (languageTag.equals("und")) {
|
||||||
|
Grasscutter.getLogger().error("Illegal locale language, using en-US instead.");
|
||||||
|
language = Language.getLanguage("en-US");
|
||||||
|
} else {
|
||||||
|
language = Language.getLanguage(languageTag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void saveConfig() {
|
public static void saveConfig() {
|
||||||
|
Loading…
Reference in New Issue
Block a user