Skip to content

feat(i18n): add fi, sv, hu, is, eu, fa (RTL) locales#174

Merged
qnbs merged 2 commits into
mainfrom
feat/i18n-six-locales
Jun 17, 2026
Merged

feat(i18n): add fi, sv, hu, is, eu, fa (RTL) locales#174
qnbs merged 2 commits into
mainfrom
feat/i18n-six-locales

Conversation

@qnbs

@qnbs qnbs commented Jun 16, 2026

Copy link
Copy Markdown
Owner

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 β€” Language union, RTL_LOCALES (+fa), SUPPORTED_LOCALES, VALID_LANGS
  • components/ui/LanguageSelector.tsx β€” LANGUAGE_METADATA (Basque uses 🌐 globe β€” no ikurriΓ±a emoji in Unicode)
  • components/writing/AiScratchpad.tsx β€” TTS_LOCALE
  • services/i18nBootstrap.ts β€” I18N_BOOTSTRAP with native cold-start title/logline/chapter-1 (no English flash)

Translations (hand-translated, production quality, all 6 langs):

  • Priority chrome: full portal.json, sidebar.json, dashboard.json, top common.* verbs
  • Glossary: 6 lang-first blocks in locales/translation-glossary.json
  • The other 16 modules ship as English-fallback stubs (parity-green) pending the user-run bulk translator

Scripts:

  • 6 langs added to check-i18n-keys.mjs, build-i18n.mjs, bulk-translate-locales.mjs (SUPPORTED_LANGS)
  • bulk-translate-locales.mjs hardened: 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, fa RTL + Arabic font, 5 LTR Beta langs
  • i18nPlaceholders.test.ts: guard now covers all 17 bundles

fa RTL is automatic β€” RTL_LOCALES drives App.tsx dir="rtl", and the [dir="rtl"] font swap in index.css already points at Noto Sans/Naskh Arabic (cover Persian glyphs). No App/CSS/font/sw.js changes.

Docs: new docs/LANGUAGE-EXPANSION-2026.md; updated I18N-GLOSSARY.md, CLAUDE.md, ROADMAP.md, TODO.md, CHANGELOG.md.

Verification (local, green)

  • node scripts/check-i18n-keys.mjs β†’ 17 locales match 2699 keys
  • pnpm run i18n:bundle β†’ all 17 bundles rebuilt
  • pnpm run typecheck β†’ 0 errors (all Record<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/writes

Follow-up (user-run; agent makes no network calls)

node scripts/bulk-translate-locales.mjs --lang=fi,sv,hu,is,eu,fa --all --delay=600
pnpm run i18n:bundle

Then node scripts/check-i18n-keys.mjs --quality to 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

  • Added 6 new beta locales to the app language picker and saved language list, bringing supported languages from 11 to 17
  • Persian now works as a right-to-left language, and Basque uses a globe icon in the language menu
  • New users in these locales see translated starter project text, sidebar labels, and help content, including native opening values for the first project
  • Voice and text-to-speech settings now match the new languages
  • Added coverage to confirm all 17 locales load correctly, including right-to-left behavior for Persian

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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

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>
@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

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 @codeant-ai : review. For better signal, consider splitting the PR into smaller chunks.

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldscript-studio Ready Ready Preview, Comment Jun 17, 2026 5:07am

@qnbs

qnbs commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! πŸŽ‰

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X Β·
Reddit Β·
LinkedIn

@qnbs

qnbs commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI : review

@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! πŸŽ‰

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X Β·
Reddit Β·
LinkedIn

@codeant-ai codeant-ai Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files label Jun 16, 2026
@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Sequence Diagram

This 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
Loading

Generated by CodeAnt AI

Comment thread components/ui/LanguageSelector.tsx Outdated
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>
@qnbs

qnbs commented Jun 17, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI : review

@codeant-ai

codeant-ai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! πŸŽ‰

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X Β·
Reddit Β·
LinkedIn

@qnbs
qnbs merged commit 0a24c91 into main Jun 17, 2026
17 of 18 checks passed
@qnbs
qnbs deleted the feat/i18n-six-locales branch June 17, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant