feat(i18n): Add Swedish locale - #5190
Conversation
* Add Swedish locale translation Closes issue dequelabs#5189
There was a problem hiding this comment.
Pull request overview
Adds Swedish (sv) i18n support to axe-core by introducing a new Swedish locale JSON file and listing Swedish among the supported locales in the README.
Changes:
- Added
locales/sv.jsoncontaining Swedish translations for rules, checks, failure summaries, and the incomplete fallback message. - Updated
README.mdto include Swedish in the Supported Locales list.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| README.md | Adds Swedish to the documented list of supported locales. |
| locales/sv.json | Introduces the Swedish translation bundle used by axe-core locale configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@jeankaplansky Thank you for submitting. It may take us a while to find and get this reviewed. |
There was a problem hiding this comment.
Thanks again for this, @joesew, and sorry for the wait.
Some context on the timing: we had a Swedish translation in progress with one of our partners when this came in, and rather than close one in favour of the other we had their Swedish reviewer go over your file. It came back overwhelmingly positive — 526 of the 593 strings were kept exactly as you wrote them.
The suggestions below cover the remaining 67 strings. A handful are genuine fixes (a repeated Iramen typo, tabbbart, a few missing instances of att that change the meaning, and karaktärer where tecken is meant). The rest are a native reviewer's preferences on compound spelling, i stället as two words, and comma placement. Each one is a suggestion block, so you can accept them from the Files changed tab.
Two are worth a closer look rather than a blind accept:
checks.th-has-data-cells.fail— we went back and forth on this one. Your original phrasing was accurate but read as a literal translation; the reviewer's first alternative could be misread as "none of them". The suggestion below is the third option we landed on.checks.presentational-role.*— these refer to the ARIA role value, so they should saypresentationrather thanpresentational.
Happy to push these to the branch myself if you'd rather not click through 51 suggestions.
Axe-core 4.13 is releasing August 5th
If it's possible to get these changes in by Tuesday at the latest, we can include the translation in the next release of Axe-core. That would be ideal. Otherwise I'm not sure when the next release will be.
| "fail": "letter-spacing i stilattributet får inte använda !important, eller måste vara minst ${data.minValue}em (nuvarande ${data.value}em)" | ||
| }, | ||
| "important-line-height": { | ||
| "pass": "line-height i stilattributet är inte inställt på !important, eller uppfyller minimum", |
There was a problem hiding this comment.
| "pass": "line-height i stilattributet är inte inställt på !important, eller uppfyller minimum", | |
| "pass": "line-height i stilattributet är inte inställt på !important, eller uppfyller minimikravet", |
| "fail": "line-height i stilattributet får inte använda !important, eller måste vara minst ${data.minValue}em (nuvarande ${data.value}em)" | ||
| }, | ||
| "important-word-spacing": { | ||
| "pass": "word-spacing i stilattributet är inte inställt på !important, eller uppfyller minimum", |
There was a problem hiding this comment.
| "pass": "word-spacing i stilattributet är inte inställt på !important, eller uppfyller minimum", | |
| "pass": "word-spacing i stilattributet är inte inställt på !important, eller uppfyller minimikravet", |
| "globalAria": "Elementets roll är inte presentational eftersom det har ett globalt ARIA-attribut", | ||
| "focusable": "Elementets roll är inte presentational eftersom det är fokuserbart", | ||
| "both": "Elementets roll är inte presentational eftersom det har ett globalt ARIA-attribut och är fokuserbart", | ||
| "iframe": "Att använda attributet \"title\" på ett ${data.nodeName}-element med en presentational-roll beter sig inkonsekvent mellan skärmläsare" |
There was a problem hiding this comment.
These name the ARIA role value, which is presentation, not presentational. All four messages in this block are affected.
| "globalAria": "Elementets roll är inte presentational eftersom det har ett globalt ARIA-attribut", | |
| "focusable": "Elementets roll är inte presentational eftersom det är fokuserbart", | |
| "both": "Elementets roll är inte presentational eftersom det har ett globalt ARIA-attribut och är fokuserbart", | |
| "iframe": "Att använda attributet \"title\" på ett ${data.nodeName}-element med en presentational-roll beter sig inkonsekvent mellan skärmläsare" | |
| "globalAria": "Elementets roll är inte presentation eftersom det har ett globalt ARIA-attribut", | |
| "focusable": "Elementets roll är inte presentation eftersom det är fokuserbart", | |
| "both": "Elementets roll är inte presentation eftersom det har ett globalt ARIA-attribut och är fokuserbart", | |
| "iframe": "Att använda attributet \"title\" på ett ${data.nodeName}-element med en presentation-roll fungerar inkonsekvent mellan skärmläsare" |
| }, | ||
| "caption-faked": { | ||
| "pass": "Den första raden i en tabell används inte som en rubrik (caption)", | ||
| "fail": "Det första underelementet i tabellen ska vara en caption istället för en tabellcell" |
There was a problem hiding this comment.
| "fail": "Det första underelementet i tabellen ska vara en caption istället för en tabellcell" | |
| "fail": "Det första underelementet i tabellen ska vara en caption i stället för en tabellcell" |
| }, | ||
| "th-has-data-cells": { | ||
| "pass": "Alla tabellrubrikceller refererar till dataceller", | ||
| "fail": "Inte alla tabellrubrikceller refererar till dataceller", |
There was a problem hiding this comment.
The English source negates all — the check fails as soon as one <th> has no data cells, so a wording that could be read as "none of them" would overstate the problem. Vissa ("some") keeps it partial.
| "fail": "Inte alla tabellrubrikceller refererar till dataceller", | |
| "fail": "Vissa tabellrubrikceller refererar inte till dataceller", |
|
@joesew quick ping to get this back on your radar. |
Sorry for not seeing the above comment about the background context and the suggested changes. I have been out of office for a week, will get back next week. I have scrolled through all comments. I agree with the changes, if you have time, please push the changes to the branch. @WilcoFiers |
Co-authored-by: Wilco Fiers <[email protected]>
WilcoFiers
left a comment
There was a problem hiding this comment.
@joesew Thank you so much for this contribution to Axe-core! Just in time for the 4.13 release.
|
Oh and for the books. I reviewed this PR for security. |
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. ## [4.13.0](v4.12.1...v4.13.0) (2026-08-05) ### Features - **aria-actions:** add aria-actions to allowed ARIA attributes ([#5200](#5200)) ([029655d](029655d)), closes [#4584](#4584) [#5199](#5199), references [#5215](#5215) [#5215](#5215) - **aria-allowed-attr:** flag deprecated ARIA attributes as needs-review ([#5246](#5246)) ([518f3cc](518f3cc)), closes [#3341](#3341) - **aria-prohibited-attr:** allow many elements to be named and disallow label and body from being named ([#5259](#5259)) ([d8b1ea5](d8b1ea5)) - **aria-roles:** add sectionheader and sectionfooter roles ([#5238](#5238)) ([c36c109](c36c109)), closes [#4734](#4734), references [#4734](#4734) - **aria/get-aria-value:** new function to get aria values of a node ([#5109](#5109)) ([a7d8f3e](a7d8f3e)), references [#5042](#5042) - **aria/has-attr-value:** new function to check if node has aria value ([#5136](#5136)) ([61f2624](61f2624)), references [#5109](#5109) - **aria:** support role=image as equivalent to role=img ([#5248](#5248)) ([5aa8aaf](5aa8aaf)), closes [#4656](#4656), references [#5272](#5272) - **checks/aria:** support ARIA element internals properties ([#5172](#5172)) ([9b7f754](9b7f754)) - **checks/label:** support ARIA element internals properties ([#5170](#5170)) ([21c5f8b](21c5f8b)) - **checks/navigation:** support ARIA element internals properties ([#5167](#5167)) ([2c3a98f](2c3a98f)) - **commons/aria:** support ARIA element internals properties ([#5171](#5171)) ([31f09e7](31f09e7)) - **commons/dom:** support ARIA element internals properties ([#5163](#5163)) ([f0a12cf](f0a12cf)) - **commons/forms:** support ARIA element internals properties ([#5165](#5165)) ([27a4686](27a4686)) - **commons/matches/fromPrimative:** deprecate in favor of correct spelling ([#5270](#5270)) ([31cfb2e](31cfb2e)) - **commons/text:** support ARIA element internals properties ([#5169](#5169)) ([e841a33](e841a33)) - **commons/text:** support form-associated labels via element internals ([#5182](#5182)) ([57cfe0a](57cfe0a)), closes [#5045](#5045), references [#5170](#5170) [#5039](#5039) [#5151](#5151) [#5039](#5039) - **dom/getResolvedRefs:** new function to get the resolved virtual nodes of idrefs ([#5151](#5151)) ([489cdea](489cdea)), references [#5109](#5109) - **element-internals:** enable ElementInternals by default ([#5284](#5284)) ([2740d42](2740d42)), closes [#5277](#5277) - **i18n:** Add Swedish locale ([#5190](#5190)) ([dcd13f2](dcd13f2)), references [#5189](#5189) - **matches:** add inSectioningContent, hasChild, and isSummaryForDetails matches ([#5262](#5262)) ([c47cdcd](c47cdcd)) - **rules:** support ARIA element internals properties ([#5168](#5168)) ([065baf7](065baf7)) - **standards/ariaAttrs:** add caseInsensitive property for attributes ([#5224](#5224)) ([bcd791c](bcd791c)) ### Bug Fixes - **aria-allowed-role:** allow roles on a non-details summary ([#5242](#5242)) ([3bd9875](3bd9875)), closes [#3911](#3911), references [#3443](#3443) [#3911](#3911) - **aria-allowed-role:** restrict figure roles with child figcaption ([#5240](#5240)) ([178a635](178a635)), closes [#3443](#3443) - **aria-prohibited-attr:** visible aria-labelledby requires review only ([#5285](#5285)) ([fd6fa9f](fd6fa9f)) - **axe.d.ts:** make enabled property of RuleMetadata optional ([#5129](#5129)) ([90fce18](90fce18)) - **color-contrast:** fix various stacking context bugs ([#5214](#5214)) ([d5e5b04](d5e5b04)), references [#8](#8) [#5213](#5213) - **gather-internals:** handle non-HTMLElement nodes ([#5161](#5161)) ([06e84c3](06e84c3)) - **get-selector:** escape control characters in attribute selectors ([#5273](#5273)) ([4b60ac5](4b60ac5)), closes [#5204](#5204) [#5204](#5204) - **image-alt:** allow whitespace alt on presentational images ([#5218](#5218)) ([c5dd0ef](c5dd0ef)), closes [#5216](#5216) - **landmark-unique:** exclude section/form with non-landmark roles from landmark match ([#5085](#5085)) ([c5fd013](c5fd013)), closes [#4722](#4722) [#5064](#5064) - name the image role in role-img-alt and svg-img-alt metadata ([#5279](#5279)) ([995a269](995a269)), closes [#5272](#5272), references [#5248](#5248) [#5248](#5248) - **standards:** update aria-errormessage and aria-details to be idrefs ([#5157](#5157)) ([fb94f8a](fb94f8a)) This PR was opened by a robot 🤖 🎉
Closes: #5189