Skip to content

Commit

Permalink
Add lang setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Feodor0090 committed May 28, 2023
1 parent 83e5748 commit 709168c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/mahomaps/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ private Settings() {
public static boolean proxyTiles = false;
public static boolean proxyApi = false;
public static int uiSize = 0;
public static int lang = 0;

public static String proxyServer = "http://nnp.nnchan.ru:80/mahoproxy.php?u=";

Expand Down Expand Up @@ -52,6 +53,7 @@ public static boolean Read() {
proxyTiles = j.optBoolean("proxy_tiles");
proxyApi = j.optBoolean("proxy_api");
uiSize = j.optInt("ui_size", 0);
lang = j.optInt("lang", 0);
return true;
} catch (Throwable e) {
e.printStackTrace();
Expand Down Expand Up @@ -82,6 +84,7 @@ public static String Serialize() {
j.put("proxy_tiles", proxyTiles);
j.put("proxy_api", proxyApi);
j.put("ui_size", uiSize);
j.put("lang", lang);
return j.toString();
}

Expand All @@ -99,4 +102,17 @@ public static void Save() {
e.printStackTrace();
}
}

public static String GetLangString() {
switch (lang) {
case 0:
return "ru_RU";
case 1:
return "en_US";
case 2:
return "tr_TR";
default:
throw new IndexOutOfBoundsException("Unknown language code!");
}
}
}

0 comments on commit 709168c

Please sign in to comment.