@@ -26,21 +26,27 @@ public class BundleTranslations extends HashMap<String, LinkedHashMap<String, St
26
26
public BundleTranslations () throws NonEnglishVanillaBundlesFileException {
27
27
// Populate /this/ with hashmaps of bundle name translations for every language
28
28
for (String [] lang : langs ) {
29
+ boolean isEnglish = lang [0 ].equals ("en" );
29
30
// Initialise hashmap
30
31
LinkedHashMap <String , String > translations ;
31
32
// Populate hashmap
32
33
translations = new LinkedHashMap <String , String >();
33
34
// Read the bundles file for the current language
34
- ReadableJsonFile readableBundlesFile = new ReadableJsonFile ("Bundles/Vanilla" , "Bundles." + lang [0 ] + "-" + lang [1 ]);
35
+ ReadableJsonFile readableBundlesFile = (
36
+ isEnglish ?
37
+ new ReadableJsonFile ("Bundles/Vanilla" , "Bundles" ):
38
+ new ReadableJsonFile ("Bundles/Vanilla" , "Bundles." + lang [0 ] + "-" + lang [1 ])
39
+ );
35
40
try {
36
41
try {
37
42
JsonObject bundles = readableBundlesFile .getJson ();
38
43
// Add bundleEnglishName -> bundleLangName entries
39
44
for (Entry <String , JsonElement > bundleEntry : bundles .entrySet ()) {
45
+ String bundleName = getName (readableBundlesFile , bundleEntry );
40
46
translations .put (
41
- getName ( readableBundlesFile , bundleEntry ) , (
42
- lang [ 0 ]. equals ( "en" ) ?
43
- getName ( readableBundlesFile , bundleEntry ) :
47
+ bundleName , (
48
+ isEnglish ?
49
+ bundleName :
44
50
getNameTranslation (readableBundlesFile , bundleEntry )
45
51
)
46
52
);
0 commit comments