Skip to content

fix: name UI translation files by BCP-47 lang tag#746

Merged
andrii-bodnar merged 1 commit into
mainfrom
fix/i18n-locale-codes
Jun 9, 2026
Merged

fix: name UI translation files by BCP-47 lang tag#746
andrii-bodnar merged 1 commit into
mainfrom
fix/i18n-locale-codes

Conversation

@andrii-bodnar

Copy link
Copy Markdown
Member

Starlight keys UI translations (sidebar labels and interface strings) by each locale's lang tag, not by its folder key. The pt/es/tr files were named pt.json/es.json/tr.json while their lang tags are pt-PT/ es-ES/tr-TR, so Starlight failed the lookup and fell back to English. de/da/fr worked only because their folder key happens to equal their tag.

  • Rename i18n files to match the lang tag: pt.json -> pt-PT.json, es.json -> es-ES.json, tr.json -> tr-TR.json
  • Update imports and key the sidebar translations map by lang tag in src/utils/i18n.ts
  • Give the i18n.json entry in crowdin.yml its own languages_mapping so future syncs export the BCP-47 filenames (tr -> tr-TR, etc.)

Starlight keys UI translations (sidebar labels and interface strings)
by each locale's `lang` tag, not by its folder key. The pt/es/tr files
were named pt.json/es.json/tr.json while their lang tags are pt-PT/
es-ES/tr-TR, so Starlight failed the lookup and fell back to English.
de/da/fr worked only because their folder key happens to equal their tag.

- Rename i18n files to match the lang tag: pt.json -> pt-PT.json,
  es.json -> es-ES.json, tr.json -> tr-TR.json
- Update imports and key the sidebar `translations` map by lang tag
  in src/utils/i18n.ts
- Give the i18n.json entry in crowdin.yml its own languages_mapping so
  future syncs export the BCP-47 filenames (tr -> tr-TR, etc.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 9, 2026 7:55am

Request Review

@andrii-bodnar andrii-bodnar merged commit 0f8bf9a into main Jun 9, 2026
4 checks passed
@andrii-bodnar andrii-bodnar deleted the fix/i18n-locale-codes branch June 9, 2026 07:57
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.

1 participant