Minecraft-Mod-Translator/insert_lang.js.txt
2024-12-09 05:29:37 +08:00

15 lines
656 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

按照此伪代码编写一个Node.js脚本要求
1. 尽量不使用第三方库adm-zip 除外用来解析jar包
2. 使用双引号代替单引号
3. 使用引号
伪代码:
遍历读取 ./mods/*.jar (*.jar等同于*.zip压缩包) {
输出 正在读取 *.jar
const modId = JSON.parse(读取jar内部的 ./fabric.mod.json).id;
if (存在 `./lang/zh_cn/${modId}.json`) {
复制 ./mods/*.jar 至 ./mods_translated/[Translated]*.jar
将 `./lang/zh_cn/${modId}.json` 打包进 ./mods_translated/[Translated]*.jar 内部的 `/assets/${modId}/lang/zh_cn.json`
输出 *.jar 已重新打包
}
}