Repository navigation
Add parity test and translator guidance for language files - #15265
Merged
Merged
Conversation
Language files drifted from _language.yml (#14822) because nothing checks them. The test fails on stale keys, missing keys not listed in language-known-gaps.yml, stale gap entries, and placeholders that differ from the English value. Region overlays may omit keys.
Contributors, and the AI tools many of them use, translate the new accessibility and UI keys without knowing which sense is meant, so values come out wrong (for example "Dismiss" as reject) or fall back to English. - _language.yml: translator comments above the 14 keys that are missing somewhere, saying what the string is, where it shows and which sense to use. - README.md: table of all language files with the correct names (kr -> ko), plus contributing guidance (read the notes, reuse existing vocabulary, region files are overlays, disclose AI help, known-gaps list). - AGENTS.md and a rule pointer so coding agents read the same guidance. - Changelog entry for the lt/sv key renames.
If an English key is renamed, its old name would stay in language-known-gaps.yml and the test kept passing, so the list could go stale. Also correct the code-links-title translator comment: the Code Links list holds the repository, Binder and Dev Container links, not source notebooks.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
The runtime boundary check failed on the three direct Deno calls the test added. The contract cases only wrote temp files to feed the checker, so the checker now takes the parsed files, and the cases pass objects directly. Reading the shipped files goes through walkSync from deno_ral, and a test checks that base, region and script files are all loaded.
5 tasks
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.
Keys added to
_language.ymldon't reach the per-language files, and nothing checks it, so localized pages fall back to English for those strings (#14822). This is the groundwork for filling the gaps, as planned in #14822 (comment). It adds no new translations.Parity test
tests/unit/language-parity.test.tsreads_language.ymland every_language-*.ymland fails when:_language.yml(howltandsvbroke),tests/unit/language-known-gaps.yml,{0}placeholders of its English value.Region files (
de-CH,fr-CA,pt-BR,zh-TW) are read on top of their base language, so they are exempt from the missing-key check only. The known-gaps list starts with everything missing today (165 pairs) and shrinks as keys get translated.Stale keys
Both strings fell back to English.
ltstill usedsearch, renamed tosearch-labelin 498f71a.svusedcallout-danger-title, which never existed in_language.yml:callout-danger-captionbecamecallout-caution-captionin 25e3eb2, thencallout-caution-titlein 748c66d, a month before the Swedish file was added (#5000). Both keys are renamed, keeping the existing values.Guidance for translators
Most wrong translations come from not knowing what a short string is: "Dismiss announcement" read as reject, "Slide menu" as a single slide, "Download" as a noun where the file uses verbs. So:
_language.ymlgets a translator comment above each key that is missing somewhere, saying what the string is, where it shows and which sense to use, in the same style as the existing comments.src/resources/language/README.mdgets the full list of language files (the table listed 20 of the 35 and a non-existent_language-kr.yml) and contributing guidance: read the comments, reuse the file's vocabulary, keep placeholders, region files are overlays, say when AI helped, and how the known-gaps list works.src/resources/language/AGENTS.mdpoints AI tools at the same guidance.The open #14203 adds
_language-ar.yml. Once this is merged, that file needs every key or its missing keys added to the known-gaps list.Part of #14822
Checklist
I have (if applicable):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.