feat: add Swedish (sv-SE) localization#833
Open
mooncos wants to merge 7 commits into
Open
Conversation
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.
There was a problem hiding this comment.
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-SEto configured locales and locale definitions (labels, aliases, search keywords) - Added
locale.svSElabel 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. |
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.
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-UApattern:sv-SEregistered inAPP_LOCALESandLOCALE_DEFINITIONS(src/lib/i18n.ts)sv-SEadded as a target inlara.yamllocale.svSElabel added to every catalogsrc/lib/locales/sv-SE.json— 808 keys, full parity withen.jsoni18n.test.tsassertions (display name + label)Decisions worth noting (so they aren't "corrected")
sv-SE(BCP-47:sv= Swedish,SE= Sweden), matching every other locale in the registry (it-IT,fr-FR, …). This is whatIntldate formatting and browser-language detection expect.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 requiringIntl.PluralRules.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✅