Skip to content

Commit b3e060f

Browse files
authored
Support for patches in languages ​​other than English. (#34)
* Support for patches in languages ​​other than English. * Change the tmp variable to non-global.
1 parent f873562 commit b3e060f

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

www/modloader/_oneloader_configuration.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ if (window.nw.App.argv[0] !== "test") {
77
"ogg": { "encrypt": "rpgmaker", "target_extension": "rpgmvo" }
88
};
99

10+
let LANGUAGE = "en";
11+
try {
12+
const fs = require("fs");
13+
const js = fs.readFileSync("www/js/plugins.js", "utf8")
14+
eval(js.replace("var $plugins", "window.___tmp_plugins"))
15+
LANGUAGE = window.___tmp_plugins.filter(
16+
a => a.name.toLowerCase() === "text_language_processor"
17+
)[0].parameters["Default Language"];
18+
} catch (error) {
19+
console.log("Failed to read default language.");
20+
console.log(error);
21+
} finally {
22+
window.___tmp_plugins = undefined;
23+
}
24+
1025
const DATA_RULES = [
1126
{
1227
jsonKeys: [
@@ -35,7 +50,7 @@ if (window.nw.App.argv[0] !== "test") {
3550
"yamld": { target: "HERO", delta: true, delta_method: "yaml", encrypt: true },
3651
"hero": { target: "HERO", delta: false, encrypt: false }
3752
},
38-
mountPoint: "languages/en"
53+
mountPoint: "languages/" + LANGUAGE
3954
},
4055
{
4156
jsonKeys: [

0 commit comments

Comments
 (0)