fix code bug, update readme to zh

This commit is contained in:
2026-09-23 20:12:14 +08:00
parent c67302fd95
commit 5761248cfe
2 changed files with 38 additions and 29 deletions
+30 -24
View File
@@ -1,30 +1,35 @@
# NoN translation Repo :3 # NoN 中文翻译工作区(和多版本翻译整合工具)
## SFW and NSFW 目前我们开了三个翻译版本:
### SFW
These are the lang files shiped into the NoN mod jar. They are SFW, meaning that they use 'liquid' instead of cum, 'energy' instead of heat etc
### NSFW
These are included in the lang files in the default pack and overwrite the keys that used liquid etc to now use cum, heat and so on.
## Additional info ## zh_cn_sfw
As a reminder, please double check that things are really translation mistakes. Some keys might look wrong but make sense in the context so compare it to the english counterpart. Example: 这是准备交付到 mod jar 层的内容,不应包含任何色情词汇。
```json - todo:就“中庭锁”、“性压抑”等词语,寻找更加SFW的版本。
"item.needsofnature.accessory.tooltip.liquid_decay_reduced": "Cum decay %s",
"item.needsofnature.accessory.tooltip.liquid_decay_increased": "Cum decay %s",
```
```json
"item.needsofnature.accessory.tooltip.player_energy_gain.increased": "Heat buildup %s",
"item.needsofnature.accessory.tooltip.player_energy_gain.reduced": "Heat buildup %s",
```
These might look incorrect but with `%s` inserted it will be things like
"Heat buildup -10%" and "Cum decay +25%" so keep that in mind when looking for errors.
## Terminology ## zh_cn_nsfw
这是准备交付到 NoN default pack 默认动画包中内嵌的版本,其应该覆盖掉 `zh_cn_sfw` 中那些不色情的词汇
- todo:就“性压抑”等词语寻找更准确的翻译。
## zh_cn_nsfw_meme
这是对 LongCha 翻译的保留,将单独打成 zh_cn_meme 的空动画包(应用此包将覆盖 zh_cn_nsfw 的部分进度描述以提高节目效果)
- 为什么不使用资源包?由于 mod 的逻辑,动画包优先级高于资源包,导致资源包不可能覆盖动画包的内容。
## 翻译工具
`make.ts` 将多个跨版本的 lang json 文件合并为一个,并且按照顺序排列好,使得相同的字串排列在相邻的位置。
- 还能找出相同的字符串并删掉覆盖层的内容,从而减少额外的行。
- 同时,还会自动排序为官方 lang 文件顺序。
### 使用方法
1. 打开 `make.ts`,编辑 `targetLangFiles` and the `workFile` 两项
2. 执行 `make.ts`(或者是 `ts-node make.ts` / `deno make.ts`),合并的语言文件会被输出到 `workFile` 变量的位置。
3. 编辑输出的合并版文件
4. 再次执行,脚本会根据时间戳决定改为将文件拆回去
5. 如果你不想覆盖某个特定的文件,给对应项加上 `ro: true`
6. 如果你不想自动合并重复行,加上环境变量 `KEEP_SAME_OVERRIDE_LINES`
- `skin`, `player skin`, and `base skin` refer to a Minecraft character appearance or texture, never human tissue. Use the language's established Minecraft or gaming term.
- `destroyed skin` and `ripped skin` refer to NoN's ripped-clothing appearance. Prefer wording about a damaged appearance, outfit, or clothing when a literal translation would imply bodily injury.
- Keep filenames and paths such as `destroyed_skin.png`, `destroyed_skin_mask_%s.png`, and `config/needsofnature` unchanged.
- Keep mod and project names such as `Quick Skin`, `Skin Overrides`, `CPM`, `Figura`, `NoFigura`, and `NoN` unchanged.
## Translation Utility ## Translation Utility
@@ -39,4 +44,5 @@ make.ts merges multiple language files into one for easy editing, then splits th
2. Run `./make.ts` (or `ts-node make.ts` / `deno make.ts`). The language files will be merged into the `workFile` location (e.g. `zh_cn.json`). 2. Run `./make.ts` (or `ts-node make.ts` / `deno make.ts`). The language files will be merged into the `workFile` location (e.g. `zh_cn.json`).
3. Edit the output file. 3. Edit the output file.
4. Run `./make.ts` again. If the workfile is newer than the other files, the script will write the changes back to the language files (at the locations specified by `targetLangFiles`). 4. Run `./make.ts` again. If the workfile is newer than the other files, the script will write the changes back to the language files (at the locations specified by `targetLangFiles`).
5. If you don't want a language to be written back, add `ro: true` to its entry in `targetLangFiles`. 5. If you don't want a language to be written back, add `ro: true` to its entry in `targetLangFiles`.
6. use env `KEEP_SAME_OVERRIDE_LINES` to avoid remove same line in override layer.
+8 -5
View File
@@ -9,8 +9,7 @@ const targetLangFiles: LanguageInstance[] = [
{suffix: "en_us_nsfw", file: "NSFW (Default Pack)/en_us.json", overrideSuffix: "en_us_sfw", ro: true}, {suffix: "en_us_nsfw", file: "NSFW (Default Pack)/en_us.json", overrideSuffix: "en_us_sfw", ro: true},
{suffix: "en_us_sfw", file: "SFW (baked in NoN)/en_us.json", ro: true}, {suffix: "en_us_sfw", file: "SFW (baked in NoN)/en_us.json", ro: true},
{suffix: "zh_cn_nsfw", file: "NSFW (Default Pack)/zh_cn.json", overrideSuffix: "zh_cn_sfw"}, {suffix: "zh_cn_nsfw", file: "NSFW (Default Pack)/zh_cn.json", overrideSuffix: "zh_cn_sfw"},
{suffix: "zh_cn_nsfw_nomeme", file: "zh_cn_nomeme.json", overrideSuffix: "zh_cn_nsfw_nomeme"}, {suffix: "zh_cn_nsfw_meme", file: "zh_cn_meme.json", overrideSuffix: "zh_cn_sfw"},
{suffix: "zh_cn_nsfw_meme", file: "zh_cn_meme.json", overrideSuffix: "zh_cn_nsfw_meme"},
{suffix: "zh_cn_sfw", file: "SFW (baked in NoN)/zh_cn.json"} {suffix: "zh_cn_sfw", file: "SFW (baked in NoN)/zh_cn.json"}
] ]
const workFile = "zh_cn.json" const workFile = "zh_cn.json"
@@ -27,7 +26,8 @@ type LanguageInstance = {
const mainLangFile = "SFW (baked in NoN)/en_us.json"; const mainLangFile = "SFW (baked in NoN)/en_us.json";
const KEEP_SAME_OVERRIDE_LINES = !(process.env.KEEP_SAME_OVERRIDE_LINES ?? "").match(/^(0|false)$/i) const KEEP_SAME_OVERRIDE_LINES = !(process.env.KEEP_SAME_OVERRIDE_LINES ?? "").match(/^(0|false)?$/i)
if(KEEP_SAME_OVERRIDE_LINES) console.warn("enabled KEEP_SAME_OVERRIDE_LINES, same lines will not be removed")
const targetLangFilesBySuffix: Record<string, LanguageInstance> = {} const targetLangFilesBySuffix: Record<string, LanguageInstance> = {}
for (let l of targetLangFiles) { for (let l of targetLangFiles) {
@@ -108,9 +108,12 @@ function writeBackLang() {
}, null); }, null);
if (!latestFile) return if (!latestFile) return
if (latestFile.fileName === workFile) if (latestFile.fileName === workFile) {
console.log("write back to split versions")
writeBackLang() writeBackLang()
else } else {
console.log("generate the merge version");
genMergedLang() genMergedLang()
}
})(); })();