feat(i18n): add fi, sv, hu, is, eu, fa (RTL) locales#174
Conversation
Expand from 11 to 17 shipped locales: Finnish, Swedish, Hungarian, Icelandic, Basque (LTR Beta) and Persian/Farsi (RTL, Arabic script). - Infra: Language union, RTL_LOCALES (+fa), SUPPORTED_LOCALES, VALID_LANGS, LANGUAGE_METADATA (eu uses globe; no ikurriΓ±a emoji), TTS_LOCALE, I18N_BOOTSTRAP (native cold-start values). - Priority files hand-translated for all 6: portal, sidebar, dashboard, top common.* verbs. Remaining 16 modules ship as EN-fallback stubs (parity-green) pending the user-run bulk job. - Glossary: 6 lang-first blocks in translation-glossary.json. - Scripts: 6 langs added to check-i18n-keys/build-i18n/bulk-translate; bulk-translate gains placeholder masking + --dry-run. - Tests: I18nContext (17 locales + fa RTL + 5 LTR Beta asserts); i18nPlaceholders guard now covers all 17 bundles. - fa RTL/fonts automatic via RTL_LOCALES + existing [dir=rtl] Noto Arabic swap β no App/CSS/font changes. - Docs: LANGUAGE-EXPANSION-2026.md, I18N-GLOSSARY, CLAUDE/ROADMAP/ TODO/CHANGELOG. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Skipping CodeAnt AI review β this PR changes more than 100 files, which usually means a migration, codemod, or vendored drop. Line-level review on diffs this large produces duplicate findings on the same rewrite pattern and drowns out anything that actually matters. If you still want a review, comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@CodeAnt-AI review |
Thanks for using CodeAnt! πWe're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X Β· |
|
@CodeAnt-AI : review |
Thanks for using CodeAnt! πWe're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X Β· |
Sequence DiagramThis PR enhances the locale bulk-translation script to safely translate new languages by masking interpolation placeholders and supporting a dry-run mode that reports work without making network calls or file changes. sequenceDiagram
participant Dev as Developer
participant Script as bulk-translate-locales.mjs
participant Glossary
participant MT as Translation service
participant FS as File system
Dev->>Script: Run bulk-translate with langs, files, options
Script->>FS: Load source locale and existing target file
Script->>Glossary: Try glossary translation for each key
alt Dry-run mode
Script->>Script: Count keys to translate and glossary hits
Script-->>Dev: Log per-file summary (no network, no writes)
else Real translation
alt Glossary provides translation
Glossary-->>Script: Return localized text
else Needs machine translation
Script->>Script: Mask {{placeholders}} with sentinels
Script->>MT: Translate masked text to target language
MT-->>Script: Translated masked text
Script->>Script: Restore original placeholders from sentinels
end
Script->>FS: Merge and write updated locale bundle
Script-->>Dev: Report per-file translation progress
end
Generated by CodeAnt AI |
Resolve CodeAnt custom_rule finding: the secondary exonym label (e.g.
"Finnish") and the search term are now resolved through
t('portal.language.names.<code>') instead of a hardcoded string.
nativeName stays a hardcoded endonym by design (standard language-picker
UX β users must find their own language regardless of active UI locale).
Adds portal.language.names.<17 codes> to all 17 locales (core en/de/fr/es/it
translated; Beta locales English-fallback pending bulk translator).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@CodeAnt-AI : review |
Thanks for using CodeAnt! πWe're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X Β· |
User description
Summary
Expand WorldScript Studio from 11 β 17 shipped locales: Finnish (
fi), Swedish (sv), Hungarian (hu), Icelandic (is), Basque (eu) β LTR Beta β and Persian/Farsi (fa) β RTL, Arabic script. All ship as Beta and reuse the proven Beta-stub β bulk-translate β human-QA pipeline that delivered ja/zh/pt/el.What's in this PR
Infra (all tsc-exhaustive
Record<Language>maps + the union):contexts/I18nContext.tsxβLanguageunion,RTL_LOCALES(+fa),SUPPORTED_LOCALES,VALID_LANGScomponents/ui/LanguageSelector.tsxβLANGUAGE_METADATA(Basque uses π globe β no ikurriΓ±a emoji in Unicode)components/writing/AiScratchpad.tsxβTTS_LOCALEservices/i18nBootstrap.tsβI18N_BOOTSTRAPwith native cold-start title/logline/chapter-1 (no English flash)Translations (hand-translated, production quality, all 6 langs):
portal.json,sidebar.json,dashboard.json, topcommon.*verbslocales/translation-glossary.jsonScripts:
check-i18n-keys.mjs,build-i18n.mjs,bulk-translate-locales.mjs(SUPPORTED_LANGS)bulk-translate-locales.mjshardened: placeholder masking ({{token}}β sentinel β restore so MT can't mangle interpolation) +--dry-run(counts only, no network, no writes)Tests:
I18nContext.test.tsx: 17 locales,faRTL + Arabic font, 5 LTR Beta langsi18nPlaceholders.test.ts: guard now covers all 17 bundlesfaRTL is automatic βRTL_LOCALESdrivesApp.tsxdir="rtl", and the[dir="rtl"]font swap inindex.cssalready points at Noto Sans/Naskh Arabic (cover Persian glyphs). No App/CSS/font/sw.js changes.Docs: new
docs/LANGUAGE-EXPANSION-2026.md; updatedI18N-GLOSSARY.md,CLAUDE.md,ROADMAP.md,TODO.md,CHANGELOG.md.Verification (local, green)
node scripts/check-i18n-keys.mjsβ 17 locales match 2699 keyspnpm run i18n:bundleβ all 17 bundles rebuiltpnpm run typecheckβ 0 errors (allRecord<Language>maps exhaustive)pnpm exec vitest run(4 i18n test files) β 116 passed (incl. 17-locale placeholder guard)pnpm run lintβ clean (1477 files, no warnings)node scripts/bulk-translate-locales.mjs --lang=fi --files=common,portal --dry-runβ masking + counts, no network/writesFollow-up (user-run; agent makes no network calls)
Then
node scripts/check-i18n-keys.mjs --qualityto track the English-placeholder % toward β€5%, plus native review.π€ Generated with Claude Code
CodeAnt-AI Description
Add Finnish, Swedish, Hungarian, Icelandic, Basque, and Persian interface support
What Changed
Impact
β More users can use the app in their own languageβ Persian users see right-to-left text from the startβ Fewer untranslated screens on first launchπ‘ Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.