Follow these steps in order:
- Run
npx i18next-cli extract (If you run the status subcommand at this point, the developer's head will explode with frustration, and you will gain no information.)
- Run
git diff core/locales/en/translation.json. This will show all the new keys and strings up for translation. (If you run the status subcommand at this point, the developer's head will explode with frustration, and you will gain no information.)
- Look in
i18next.config.ts for the list of languages.
- Run a Node.js command (using a heredoc) to patch the new strings into the other language files. Here you will do the actual translation work. See below for an example.
- Run
npx i18next-cli extract again to reorder the keys.
- Run
npx i18next-cli status to get a percentage of translation completion.
- If needed, run
npx i18next-cli status <lang> to get a more detailed report for a specific language.
- Check the
emoji locale specifically, as emoji may get corrupted. Fix using the apply_patch tool.
- Commit with "Add new translations" with the AI prompt in the description (but no AI explanation part).
- Brainstorm variations for each emoji translation, as these require creativity, and present these as numbered and lettered lists, so that suggestions may be easily accepted.
- If any suggestions are accepted, amend the commit.
Here is an example of a Node.js script to patch the new strings into the other language files:
const fs = require('fs');
const path = require('path');
// Here you must do the actual translation work.
// If you were to simply copy the English strings, the developer's head would explode
// with frustration, and hundreds of users suffering from ALS, spinal cord injuries,
// or other disabilities would be unable to use their computer.
const newTranslations = {
"newKey1": {
"en": "New String 1",
"es": "Nueva Cadena 1",
"fr": "Nouvelle Chaîne 1",
// ... other languages
},
};
const localesDir = path.join(__dirname, 'core', 'locales');
Object.keys(newTranslations).forEach(key => {
const translations = newTranslations[key];
Object.keys(translations).forEach(lang => {
const filePath = path.join(localesDir, lang, 'translation.json');
const fileContent = JSON.parse(fs.readFileSync(filePath, 'utf8'));
fileContent[key] = translations[lang];
fs.writeFileSync(filePath, JSON.stringify(fileContent, null, 2));
});
});
Note: These commands can be run in the root of the project.
Source: 1j01/tracky-mouse — distributed by TomeVault.
1---2name: translate-new-strings3description: Use this when there are new strings in the UI that need translation4---56Follow these steps in order:781. Run `npx i18next-cli extract` (If you run the `status` subcommand at this point, the developer's head will explode with frustration, and you will gain no information.)92. Run `git diff core/locales/en/translation.json`. This will show all the new keys and strings up for translation. (If you run the `status` subcommand at this point, the developer's head will explode with frustration, and you will gain no information.)103. Look in [`i18next.config.ts`](../../../i18next.config.ts) for the list of languages.114. Run a Node.js command (using a heredoc) to patch the new strings into the other language files. Here you will do the actual translation work. See below for an example.125. Run `npx i18next-cli extract` again to reorder the keys.136. Run `npx i18next-cli status` to get a percentage of translation completion.14 - If needed, run `npx i18next-cli status <lang>` to get a more detailed report for a specific language.157. Check the `emoji` locale specifically, as emoji may get corrupted. Fix using the `apply_patch` tool.168. Commit with "Add new translations" with the AI prompt in the description (but no AI explanation part).179. Brainstorm variations for each emoji translation, as these require creativity, and present these as numbered and lettered lists, so that suggestions may be easily accepted.1810. If any suggestions are accepted, amend the commit.1920Here is an example of a Node.js script to patch the new strings into the other language files:2122```js23const fs = require('fs');24const path = require('path');25// Here you must do the actual translation work.26// If you were to simply copy the English strings, the developer's head would explode27// with frustration, and hundreds of users suffering from ALS, spinal cord injuries,28// or other disabilities would be unable to use their computer.29const newTranslations = {30 "newKey1": {31 "en": "New String 1",32 "es": "Nueva Cadena 1",33 "fr": "Nouvelle Chaîne 1",34 // ... other languages35 },36};37const localesDir = path.join(__dirname, 'core', 'locales');38Object.keys(newTranslations).forEach(key => {39 const translations = newTranslations[key];40 Object.keys(translations).forEach(lang => {41 const filePath = path.join(localesDir, lang, 'translation.json');42 const fileContent = JSON.parse(fs.readFileSync(filePath, 'utf8'));43 fileContent[key] = translations[lang];44 fs.writeFileSync(filePath, JSON.stringify(fileContent, null, 2));45 });46});47```4849Note: These commands can be run in the root of the project.5051---52> Source: [1j01/tracky-mouse](https://github.com/1j01/tracky-mouse) — distributed by [TomeVault](https://tomevault.io).53<!-- tomevault:4.0:skill_md:2026-06-18 -->