Fix loading languages with no underscore in the name (#5105)
This commit is contained in:
parent
3b8146a06e
commit
21097a4122
1 changed files with 7 additions and 3 deletions
|
@ -1,15 +1,19 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/resources/Language.java
|
--- ../src-base/minecraft/net/minecraft/client/resources/Language.java
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/resources/Language.java
|
+++ ../src-work/minecraft/net/minecraft/client/resources/Language.java
|
||||||
@@ -17,6 +17,8 @@
|
@@ -17,6 +17,12 @@
|
||||||
this.field_135037_b = p_i1303_2_;
|
this.field_135037_b = p_i1303_2_;
|
||||||
this.field_135038_c = p_i1303_3_;
|
this.field_135038_c = p_i1303_3_;
|
||||||
this.field_135036_d = p_i1303_4_;
|
this.field_135036_d = p_i1303_4_;
|
||||||
+ String[] splitLangCode = field_135039_a.split("_", 2);
|
+ String[] splitLangCode = field_135039_a.split("_", 2);
|
||||||
|
+ if (splitLangCode.length == 1) { // Vanilla has some languages without underscores
|
||||||
|
+ this.javaLocale = new java.util.Locale(field_135039_a);
|
||||||
|
+ } else {
|
||||||
+ this.javaLocale = new java.util.Locale(splitLangCode[0], splitLangCode[1]);
|
+ this.javaLocale = new java.util.Locale(splitLangCode[0], splitLangCode[1]);
|
||||||
|
+ }
|
||||||
}
|
}
|
||||||
|
|
||||||
public String func_135034_a()
|
public String func_135034_a()
|
||||||
@@ -55,4 +57,8 @@
|
@@ -55,4 +61,8 @@
|
||||||
{
|
{
|
||||||
return this.field_135039_a.compareTo(p_compareTo_1_.field_135039_a);
|
return this.field_135039_a.compareTo(p_compareTo_1_.field_135039_a);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue