Translates untranslated strings in a locale JSON file for the Oinkoin app. Use when the user wants to localise or update translations for a specific language, or says "translate <locale>".
Translate untranslated strings in a locale JSON file for the Oinkoin app.
/translate <locale-file>
Example: /translate assets/locales/it.json
If no file is specified, address all the locale files
assets/locales/ (e.g. it.json, de.json, pt-BR.json).assets/locales/en-US.json is the source of truth: every key AND its English value are listed there.Run the sync script from the project root to ensure en-US.json is up-to-date and stale keys are removed from all locale files:
python3 scripts/update_en_strings.py
This regenerates en-US.json from all .i18n strings found in lib/, and removes obsolete keys from every other locale file. Run it before translating so you are working against the current set of keys.
Read the full file specified by the user.
A string is untranslated when value == key. Collect every such entry.
If there are no untranslated strings, tell the user and stop.
Do not guess from the key text alone. For each untranslated key:
lib/) for the exact key string to find where it is used.Edit the locale file, replacing only the untranslated values. Keep every other entry byte-for-byte identical.
After editing, print a compact table of the strings you translated:
| Key | Translation |
|---|---|
| … | … |
%s, %d, %1$s, etc.For British english use en-GB.json - in this case, key and value will most of case matches. Consider all the strings as already translated and skip it.
Edit PDFs with natural-language instructions using the nano-pdf CLI.