feat(i18n): internationalise CLI with 14 languages via i18next#2
Open
thoroc wants to merge 41 commits intogustavodiasdev:mainfrom
Open
feat(i18n): internationalise CLI with 14 languages via i18next#2thoroc wants to merge 41 commits intogustavodiasdev:mainfrom
thoroc wants to merge 41 commits intogustavodiasdev:mainfrom
Conversation
- 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
…keys from both sides)
- 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.
Add imports and i18next resources for fr, es, de, it, pl, zh-CN, zh-TW, ja, ko, ru, tr, nl. Expand detectLocale() to map OS locale prefixes to each new language code. Update --lang help text with full language list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
--langflag to override it at runtime.Languages added
Changes
LC_ALL/LANG, andchangeLanguage()supportsrc/locales/<code>/common.jsonper localeadd,remove,list,sync,import,status) and wizards (main,server,provider) to uset()-lang <locale>global flag, pre-parsed beforecreateCli()so--helpoutput is also translatedREADME.mdandREADME.pt-BR.mdwith the new flag and architectureTesting
All 14 locales smoke-tested via
mcpx --lang <code> --help- each renders correctly in its target language with no English fallback leakage.Closes: #1