Translate Task I18n
Developmenttranslate-task-i18nTranslate Task I18n is an Agent Skill for development published in the BnanZ0/ok-nte repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Add, sync, or repair gettext translations for Python task classes in ok-script style projects. Use when Codex is asked to translate a task, sync missing translations, add i18n entries for task name/default_config/description/config_description, or compile i18n .po files into .mo files.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/BnanZ0/ok-nte/blob/HEAD/.agents/skills/translate-task-i18n/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/translate-task-i18n, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Translate Task I18n
Use this skill for task translation work in repositories that keep gettext catalogs under i18n/<locale>/LC_MESSAGES/ok.po.
Workflow
- Inspect the target task file and collect user-facing task metadata:
self.nameself.description- keys and string values in
self.default_config - string values in
self.config_description - dropdown/list option strings if they are shown in config UI
- Check whether each string already exists in all
i18n/*/LC_MESSAGES/ok.pocatalogs. - Add missing
msgidblocks to every locale. Preserve existing translations unless the user asks to change them. - Translate into every locale present under the repo's
i18ndirectory. Discover locales by listingi18n/*/LC_MESSAGES/ok.po; do not hard-code a fixed language list. - Compile every changed
ok.pointook.mo. - Verify with a syntax/format check and search for duplicate
msgidentries.
Helper Script
Use scripts/task_i18n_helper.py from this skill when helpful:
Python Environment
When running helper scripts or validation commands, use the project virtual environment if one exists. Prefer these interpreters in order:
.venv\Scripts\python.exevenv\Scripts\python.exeenv\Scripts\python.exe- Global
python
If no project virtual environment exists, fall back to global python.
.\.venv\Scripts\python.exe C:\Users\ok\.codex\skills\translate-task-i18n\scripts\task_i18n_helper.py scan --task src\tasks\LauncherTask.py
.\.venv\Scripts\python.exe C:\Users\ok\.codex\skills\translate-task-i18n\scripts\task_i18n_helper.py compile --i18n i18n
The scanner is a helper, not a substitute for reading the task. It finds common literal strings but may miss values built through constants or formatting.
Catalog Rules
- Append new entries directly as plain text to the end of the PO file (safely handling line endings by reading with
newline=""and writing back withnewline="\n"to avoid double carriage returns\r\r\n), rather than usingpolib.POFile.save()which rewrites the entire file and alters the formatting/wrapping of other entries. - Do not add log-only strings unless the user explicitly asks; focus on UI strings from task metadata/config.
- Keep
msgidexactly equal to the source string used by the code. - Empty
msgstris acceptable only when that locale intentionally falls back to the source language. - After editing
.po, always compile.mo.