mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-22 17:24:45 +01:00
Add support for loading the handbook in different languages
This commit is contained in:
@@ -25,6 +25,7 @@ public class Config {
|
|||||||
|
|
||||||
public int customDataVersion = 0;
|
public int customDataVersion = 0;
|
||||||
public String region = "global";
|
public String region = "global";
|
||||||
|
public String language = "en_US";
|
||||||
|
|
||||||
public String resourceDir = "./resources";
|
public String resourceDir = "./resources";
|
||||||
public String webFilesDir = "./web";
|
public String webFilesDir = "./web";
|
||||||
|
|||||||
@@ -117,7 +117,8 @@ public class Handbook {
|
|||||||
Map<String, String> map = null;
|
Map<String, String> map = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
map = JsonUtils.loadToMap(Nebula.getConfig().getResourceDir() + "/language/en_US/" + type.name(), String.class, String.class);
|
String fileName = Nebula.getConfig().getResourceDir() + "/language/" + Nebula.getConfig().getLanguage() + "/" + type.name();
|
||||||
|
map = JsonUtils.loadToMap(fileName, String.class, String.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user