mit einem Klick
translate
// Translate new or untranslated i18n strings from the English locale files (core.json + peri.json) into all other locales, maintaining consistency with each language's existing translations.
// Translate new or untranslated i18n strings from the English locale files (core.json + peri.json) into all other locales, maintaining consistency with each language's existing translations.
| name | translate |
| description | Translate new or untranslated i18n strings from the English locale files (core.json + peri.json) into all other locales, maintaining consistency with each language's existing translations. |
Automatically translate new or untranslated strings from the English locale files to all other locale files, maintaining consistency with each language's existing translations.
The app uses two i18next namespaces, each backed by its own JSON file per locale:
core → core.json (main app strings, default namespace)peri → peri.json (peripheral content: onboarding ob*, help-tour hts*, Pro teaser slides pts*, months / weekday abbreviations, proTeaser*Headline/Subtext)Both files are flat key-value JSON with no nesting (keySeparator: false).
all: process all languages and both namespaces.de_DE, ja, bg): process only that language; both namespaces.core or peri): process all languages but only that namespace.lang=<code> and/or ns=<core|peri> (any order, comma-separated): scope the run.
lang=de_DE,ns=peri, ns=peri, lang=jareport: only show what's missing/untranslated, don't translate. Combinable with lang=/ns=.src/renderer/locales/en/core.json and src/renderer/locales/en/peri.jsonsrc/renderer/locales/ except en/core.json and peri.json (flat key-value JSON, no nesting). If peri.json is missing for a locale, generate it from scratch.For each namespace in scope (default: both core and peri):
src/renderer/locales/en/<ns>.json).src/renderer/locales/ to discover target languages.src/renderer/locales/<lng>/<ns>.json and compare against English:
[ns=peri]
Language | Missing | Untranslated | Orphan
----------|---------|--------------|-------
de_DE | 3 | 1 | 0
ja | 3 | 5 | 0
...
report, stop here. Otherwise, ask the user for confirmation before proceeding (unless --yes was passed).These keys are expected to have the same value as English in many/all languages. Do NOT flag them as untranslated:
"-", "/")"TagSpaces", "Mapique")"Ok", "Email", "Kanban")For each (language, namespace) pair that needs translations:
peri.json, also read core.json for context). This is critical because peri.json is small (~142 keys) and won't carry enough style signal on its own.For each (language, namespace) pair, translate all missing and untranslated keys:
en/core.json or en/peri.json — both are read-only for this skill.{{variables}} exactly — template placeholders like {{fileName}}, {{version}}, {{count}}, {{folderName}} must appear in the translation unchanged. Do not translate, reorder, or remove them.<br>, <b>, </b>, <a> etc. must remain intact.For each modified locale + namespace:
en/core.json for core, en/peri.json for peri). This keeps diffs clean and structure consistent.node -e "JSON.parse(require('fs').readFileSync('path'))" or equivalent).Language | NS | Added | Updated | Removed | Status
----------|-------|-------|---------|---------|-------
de_DE | core | 3 | 1 | 0 | OK
de_DE | peri | 2 | 0 | 0 | OK
ja | core | 3 | 5 | 0 | OK
ja | peri | 0 | 0 | 0 | OK
...
core.json and peri.json| Case | Handling |
|---|---|
| Value same as English but intentional | Use the skip-list; also check if 5+ other languages have the same value |
New language directory with empty/missing core.json or peri.json | Generate a complete translation from scratch for the missing file(s) |
Locale has core.json but no peri.json | Create peri.json from scratch, translating every English peri key |
Locale has peri.json but no core.json | Same in reverse — unusual but handle symmetrically |
| Key has only whitespace or empty string in target | Treat as untranslated |
English value contains line breaks (\n) | Preserve line breaks in translation |
| English value is very long (100+ chars) | Translate fully, do not truncate |
Key moved between core and peri namespaces | Detect by checking if an "orphan" in core appears in en/peri.json (or vice versa). Report as informational only; do not auto-migrate translations — the namespace split is a separate manual operation. |