language file merge/split tool
This commit is contained in:
@@ -25,3 +25,18 @@ These might look incorrect but with `%s` inserted it will be things like
|
||||
- `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
|
||||
|
||||
make.ts merges multiple language files into one for easy editing, then splits them back into separate files. This tool lets you:
|
||||
- find the original text without searching another file
|
||||
- automatically remove duplicate text to save space
|
||||
- sort your i18n files according to the official order
|
||||
|
||||
### Usage
|
||||
|
||||
1. Open `make.ts` and edit the `targetLangFiles` and the `workFile` fields, change `zh_cn` to your language. please notice that The `suffix` and `file` values must be unique.
|
||||
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.
|
||||
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`.
|
||||
Reference in New Issue
Block a user