docs/i18n-script-usage.md
This document describes the usage of the tools/add-missing-i18n-variables.js script, which helps manage internationalization (i18n) files for Super Productivity.
The script manages translation files located in src/assets/i18n/. The base language is English (en.json), and other languages like de.json (German), tr.json (Turkish), etc., contain translations.
The script supports three modes:
en.json: The reference English file with all keys.{lang}.json: Main translation files (e.g., de.json, tr.json).{lang}-wip.json: Temporary work-in-progress files containing only missing translations.To extract missing translations for a specific language (e.g., Turkish):
node tools/add-missing-i18n-variables.js extract tr
This creates tr-wip.json with all keys that exist in en.json but are missing or empty in tr.json.
Edit the generated {lang}-wip.json file and provide translations for the keys.
Example tr-wip.json:
{
"APP": {
"SKIP_SYNC_WAIT": "Skip waiting for sync"
},
"F": {
"CALDAV": {
"ISSUE_CONTENT": {
"DESCRIPTION": "Description"
}
}
}
}
After translating the WIP file, merge it back into the main language file:
node tools/add-missing-i18n-variables.js merge tr
This:
tr-wip.json into tr.jsonen.jsontr-wip.json fileTo add missing keys to all language files at once (preserving existing translations):
node tools/add-missing-i18n-variables.js
This updates all {lang}.json files to include any new keys from en.json, placing them in the same order.
en.json with new keys.node tools/add-missing-i18n-variables.js extract dede-wip.json.node tools/add-missing-i18n-variables.js merge dede.json.en.json.