Project Zomboid translations automation scripts, initialise translations with automatic translations.
- Python 3.11
- deep_translator 1.11
- Copy
config.ini
fromtemplates
to the top level folder. - run
repository/pz-translator/translate.py
directly or using the command line.
You can pass the directory path of either of these to the script and it will work.
- Translate folder
- Mod folder (requires: mod.info)
- Project folder (requires: project.json like from pzstudio)
Notes
- You can run the script directly, without any arguments and it will translate the folder set in the
config.ini
file; [Directories] Target. - Online translations can take a long time if you have a lot of texts, you can use KeyboardInterrupt (CTRL + C) to quit and the translated texts progress will be saved.
example for windows, you can also write this into a cmd file for shortcut.
py "repository/pz-translator/translate.py" "path to translate"
You can add a task like this to run the script. This will target the workspaceFolder for translation.
{
"version": "2.0.0",
"tasks": [
{
"label": "Translate Project",
"type": "shell",
"command": "py",
"args": [ "repository/pz-translator/translate.py", "${workspaceFolder}" ],
"group": "none",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
]
}
See https://go.microsoft.com/fwlink/?LinkId=733558 for the documentation about the tasks.json format
Select a handful of languages that either translate effectively or can be improved, as not all languages translate well or have variations, such as Brazilian Portuguese (pt-BR).
Deep translator supports different translators, you can find more information at: https://pypi.org/project/deep-translator/
The script rewrites the translation files, if you are not using version control then keep backups.