Skip to content

feat: add Swedish (sv-SE) localization#833

Open
mooncos wants to merge 7 commits into
refactoringhq:mainfrom
mooncos:main
Open

feat: add Swedish (sv-SE) localization#833
mooncos wants to merge 7 commits into
refactoringhq:mainfrom
mooncos:main

Conversation

@mooncos

@mooncos mooncos commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

I started using Tolaria and noticed that, while a number of languages are supported, Swedish was missing. This PR adds Swedish (sv-SE) localization.

What's included

Follows the existing id-ID / uk-UA pattern:

  • sv-SE registered in APP_LOCALES and LOCALE_DEFINITIONS (src/lib/i18n.ts)
  • sv-SE added as a target in lara.yaml
  • locale.svSE label added to every catalog
  • A full src/lib/locales/sv-SE.json — 808 keys, full parity with en.json
  • Added i18n.test.ts assertions (display name + label)

Decisions worth noting (so they aren't "corrected")

  • Locale code is sv-SE (BCP-47: sv = Swedish, SE = Sweden), matching every other locale in the registry (it-IT, fr-FR, …). This is what Intl date formatting and browser-language detection expect.
  • Count-sensitive strings (status.remote.aheadTitle/behindTitle, status.conflict.count) keep the {count}{plural} placeholders for validator parity, but are phrased count-neutral. The runtime strips {plural} for non-English locales, and Swedish plural rules differ from English — neutral phrasing avoids grammatically wrong output without requiring Intl.PluralRules.
  • "Tolaria" and other product/brand names (Git, AutoGit, GitHub, MCP, Claude Code, Gemini, OpenAI, Stable/Alpha) are kept as-is.

Validation

  • pnpm l10n:validate ✅ — key + placeholder parity across all 19 catalogs (808 keys)
  • i18n.test.ts
  • tsc --noEmit ✅ · pnpm lint
  • Full frontend suite ✅ (400 files / 4389 tests) · frontend coverage 84.6% (≥70%)
  • Playwright core smoke lane ✅ (55 tests)
  • Manually verified by switching the UI language to Svenska in the running app

Follows the existing id-ID/uk-UA pattern:
- sv-SE registered in APP_LOCALES and LOCALE_DEFINITIONS (src/lib/i18n.ts)
- sv-SE added as a target in lara.yaml
- locale.svSE label added to every catalog
- Full src/lib/locales/sv-SE.json with full parity vs en.json (808 keys)
- i18n.test.ts assertions (display name + label)

Count-sensitive strings keep {count}{plural} for placeholder parity but are
phrased count-neutral, since the runtime strips {plural} for non-English
locales. Product/brand names (Tolaria, Git, AutoGit, GitHub, MCP, Claude Code)
are preserved.
Copilot AI review requested due to automatic review settings June 7, 2026 19:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Swedish (sv-SE) as a supported application locale, including a full Swedish translation catalog and wiring it into the locale configuration.

Changes:

  • Added sv-SE to configured locales and locale definitions (labels, aliases, search keywords)
  • Added locale.svSE label translations across existing locale catalogs
  • Introduced a new Swedish translation catalog file (sv-SE.json) and updated i18n tests/config tooling

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/lib/locales/zh-TW.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/zh-CN.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/vi.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/sv-SE.json Adds the new Swedish translation catalog.
src/lib/locales/ru-RU.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/pt-PT.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/pt-BR.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/pl-PL.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/ko-KR.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/ja-JP.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/it-IT.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/id-ID.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/fr-FR.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/es-ES.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/es-419.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/en.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/de-DE.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/be-Latn.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/locales/be-BY.json Adds Swedish locale label and fixes trailing comma for valid JSON.
src/lib/i18n.ts Registers sv-SE in supported locales and locale definitions.
src/lib/i18n.test.ts Extends i18n tests to cover Swedish display name and label key presence.
lara.yaml Adds sv-SE to localization tooling config.

Comment thread src/lib/locales/zh-TW.json
Comment thread src/lib/locales/zh-CN.json
Comment thread src/lib/locales/ko-KR.json
Comment thread src/lib/locales/ru-RU.json
Comment thread src/lib/locales/es-ES.json
Comment thread src/lib/locales/es-419.json
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.

2 participants