agentleFS
vechainvechain/vechain-ai-skills/skills/translate/SKILL.md

translate

Skill15 starsChanged 9 months agoMITView on GitHub

Manages translation files for react-i18next. Adds/removes keys across 15 languages, keeps files sorted, enforces fixed-word rules, and verifies sync with en.json.

18 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use explain.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • allieraysSkill

    explain

    Explain what code does line by line so you can understand and learn from it.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 9 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add the new key to en.json with the English value

    line 21
  2. Distinctive:

    Add the same key to ALL other language files with the correct translation for the language of the file

    line 22
  3. Distinctive:

    After adding to all files, sort ALL translation files alphabetically by key (case-insensitive)

    line 23
  4. Distinctive:

    Remove the key from ALL 15 language files

    line 27
  5. Distinctive:

    All translation JSON files MUST have keys sorted alphabetically (case-insensitive)

    line 32
  6. Distinctive:

    After any modification, verify keys are sorted

    line 34
  7. Distinctive:

    Write back with 2-space indentation and trailing newline

    line 43
  8. Very specific:

    Use a Node.js script or jq to sort.

    line 45
  9. Distinctive:

    After any translation change, verify:

    line 64
  10. Very specific:

    All non-English files have the EXACT same keys as en.json

    line 67
  11. Distinctive:

    All files are sorted alphabetically by key

    line 70
  12. Distinctive:

    When translating, ALWAYS check this file first.

    line 81
  13. Very specific:

    If the app uses @vechain/vechain-kit, keep Kit UI language in sync with the host app:

    line 85
  14. Very specific:

    Unused keys in en.json: Run a script that finds keys in en.json never used in code (t("..."), i18nKey="...") and exit non-zero so …

    line 94
  15. Very specific:

    Missing keys in other locales: Run a script that compares each locale's keys to en.json and fails if any locale has missing or extra keys.

    line 95

“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Translate Skill

Manages translation files in apps/frontend/src/i18n/languages/.

Translation Files

  • 15 languages: en (source), de, es, fr, hi, it, ja, ko, nl, pt, sv, tr, tw, vi, zh
  • Format: flat JSON key-value pairs (keys = English phrases)
  • Interpolation: {{variableName}}
  • Library: react-i18next configured in apps/frontend/src/i18n/index.tsx
  • Language list defined in apps/frontend/src/i18n/index.tsx (languages array)

When Adding New Translation Keys

  1. Add the new key to en.json with the English value
  2. Add the same key to ALL other language files with the correct translation for the language of the file
  3. After adding to all files, sort ALL translation files alphabetically by key (case-insensitive)

When Removing Translation Keys

  1. Remove the key from ALL 15 language files
  2. Files should remain sorted after removal

Sorting Rules

  • All translation JSON files MUST have keys sorted alphabetically (case-insensitive)
  • Sorting applies to ALL language files, not just en.json
  • After any modification, verify keys are sorted

Sort Procedure

For each .json file in apps/frontend/src/i18n/languages/:

  1. Parse the JSON
  2. Get all keys and sort them case-insensitively
  3. Rebuild the object with sorted keys
  4. Write back with 2-space indentation and trailing newline

Use a Node.js script or jq to sort. Example with Node.js:

node -e "
const fs = require('fs');
const glob = require('glob');
const files = glob.sync('apps/frontend/src/i18n/languages/*.json');
files.forEach(f => {
  const obj = JSON.parse(fs.readFileSync(f, 'utf8'));
  const sorted = Object.keys(obj)
    .sort((a, b) => a.localeCompare(b, undefined, { sensitivity: 'base' }))
    .reduce((acc, key) => { acc[key] = obj[key]; return acc; }, {});
  fs.writeFileSync(f, JSON.stringify(sorted, null, 2) + '\n');
});
"

Sync Check

After any translation change, verify:

  • en.json has all keys that exist in code (search for t("...") usage)
  • All non-English files have the EXACT same keys as en.json
  • Missing keys in non-English files get the correct translation for the language of the file
  • Extra keys in non-English files (not in en.json) should be removed
  • All files are sorted alphabetically by key

Fixed Words

See apps/frontend/src/i18n/fixedWords.json. Grouped by language code ("all" applies to every language).

Two use cases:

  1. Untranslated words — value equals the English word (e.g. "round": "round" keeps "round" in English for Italian)
  2. Fixed translations — value is the mandatory translation for that concept (e.g. "endorsement": "supporto" means always use "supporto" for endorsement in Italian)

When translating, ALWAYS check this file first. If a word has a fixed translation for the target language, use it consistently in every sentence.

VeChain Kit: bi-directional language sync

If the app uses @vechain/vechain-kit, keep Kit UI language in sync with the host app:

  • App → Kit: Inside VeChainKitProvider, subscribe to i18n.on("languageChanged", ...) and call setLanguage(lng) from useCurrentLanguage() so when the user changes language in the app (e.g. footer selector), Kit updates.
  • Kit → App: Pass language={i18n.language} and onLanguageChange={(lng) => i18n.changeLanguage(lng)} into VeChainKitProvider so when the user changes language in Kit (e.g. wallet modal), the app updates.

See the vechain-kit skill reference translations-vechain-kit.md for the full implementation pattern.

Pre-commit and ESLint (missing / unused keys)

  • Unused keys in en.json: Run a script that finds keys in en.json never used in code (t("..."), i18nKey="...") and exit non-zero so pre-commit fails. Run when en.json or code is staged.
  • Missing keys in other locales: Run a script that compares each locale's keys to en.json and fails if any locale has missing or extra keys. Run when any translation file is staged or in CI.
  • ESLint: Optionally add eslint-plugin-i18next (or similar) to flag missing keys in the editor/lint.

See the vechain-kit skill reference translations-vechain-kit.md for a short summary table.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.