Skip to content

feat(i18n): internationalise CLI with 14 languages via i18next#2

Open
thoroc wants to merge 41 commits intogustavodiasdev:mainfrom
thoroc:main
Open

feat(i18n): internationalise CLI with 14 languages via i18next#2
thoroc wants to merge 41 commits intogustavodiasdev:mainfrom
thoroc:main

Conversation

@thoroc
Copy link
Copy Markdown

@thoroc thoroc commented Apr 6, 2026

Description

Replaces all hardcoded Portuguese-Brazilian strings with a full i18n system using i18next. The CLI now auto-detects the OS locale and supports a --lang flag to override it at runtime.

Languages added

  • German (de)
  • English (en)
  • Spanis (es)
  • French (fr)
  • Italian (it)
  • Japanese (ja)
  • Korean (ko)
  • Dutch (nl)
  • Polish (pl)
  • Portugese - Brazil (pt-BR)
  • Russian (ru)
  • Turkish (tr)
  • Chinese - simplified (zh-CN)
  • Chinese - traditional (zh-TW)

Changes

  • Added src/utils/i18n.ts — i18next setup, detectLocale() from LC_ALL/LANG, and changeLanguage() support
  • Extracted all 175 UI strings into src/locales/<code>/common.json per locale
  • Updated all commands (add, remove, list, sync, import, status) and wizards (main, server, provider) to use t()
  • Added --lang <locale> global flag, pre-parsed before createCli() so --help output is also translated
  • Updated both README.md and README.pt-BR.md with the new flag and architecture

Testing

All 14 locales smoke-tested via mcpx --lang <code> --help - each renders correctly in its target language with no English fallback leakage.

Closes: #1

thoroc added 30 commits April 6, 2026 13:57
- src/i18n.ts: initialise i18next with OS locale detection (LC_ALL/LANG)
  falling back to 'en'; export t() and i18next instance
- src/locales/pt-BR/common.json: full key skeleton preserving 5 existing keys
- src/locales/en/common.json: matching key skeleton (fallback locale)

Wave 0 of the i18n plan — unblocks Wave 1 locale-filling worktrees.
Extract all hardcoded PT-BR strings from cli.ts, commands/, and wizard/ into
src/locales/pt-br/common.json with i18next interpolation syntax.
- Add i18next foundation: src/i18n.ts with detectLocale() exported
- Add locale files: src/locales/en/common.json and src/locales/pt-br/common.json
- Replace all hardcoded PT-BR strings in src/cli.ts with t() calls using cli.* keys
- Add --lang <locale> global flag with detectLocale() as default
- Apply selected language in getContext() via i18next.changeLanguage()
Replace all hardcoded PT-BR string literals in add, list, remove, status,
sync, and import commands with i18next t() calls using keys from the
common.json locale files.
- Add src/i18n.ts: lightweight translation module with pt-br/en support
- Add src/locales/pt-br/common.json and src/locales/en/common.json
- Replace all hardcoded PT-BR strings in main-wizard.ts, server-wizard.ts,
  and provider-wizard.ts with t() calls using structured wizard.* keys
- src/i18n.ts: export detectLocale() so cli.ts can import it
- bin/mcpx.ts: pre-parse --lang from argv before createCli() so
  command descriptions are translated before Commander renders help
Add Japanese translation for all CLI strings in src/locales/ja/common.json.
Uses polite ます/です form appropriate for a developer CLI tool, with all
interpolation placeholders and technical terms preserved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Localised interactive mode

1 participant