Repository navigation
fix(i18n): translate English placeholders, remove unused keys, validate keys on build - #6120
Merged
Merged
Conversation
Several feature PRs added English placeholder values to most locales and they were never translated: - sideBar.move.* (13 keys, #5945): de, es, fr, ja, ko, nl, pt, ru, tr, zh-TW - multi-folder sidebar strings (12 keys, #5835): de, es, fr, ja, ko, nl, pt, ru, tr - preferences.editor.fileRepresentation.tabInputNotes (#5891): same 9 locales Also fills one-off gaps: GitHub Alerts labels in pl (desktop and Muya) and it (Muya), the Academic export theme in it, and the super/subscript extension label in es and pt. Co-Authored-By: Claude Opus 5.5 <[email protected]>
None of these keys is referenced anywhere in packages/desktop/src, either as a literal or through a template/prefix key: - menu.counter.document, documentSelection, charactersNoSpaces, allCharacters - sideBar.tree.noFolders, overlappingFolder - sideBar.search.searchInFolder (the UI uses searchInFolders) - preferences.theme.modeThemes - dialog.file, files, keepOpen, saveFailure - error.report, unexpectedErrorWithMessage - store.editor.anchorLinkCopied - editor.sourceCode.cursorNullComment, imageStructureDeletedComment - readingMode.skipped Co-Authored-By: Claude Opus 5.5 <[email protected]>
minify-locales now fails, before writing any .min.json, when:
- a locale is missing a key from en.json or has a key en.json lacks
- an en.json key is not referenced by any .ts or .vue file under
packages/desktop/src
The usage check is a single ripgrep pass that collects quoted dotted
strings. Template literals (`menu.theme.${name}`) and concatenation
prefixes ('sideBar.move.') match as patterns, so keys built from a
variable still count as used. ripgrep comes from @vscode/ripgrep,
resolved through packages/desktop, which already declares it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Jocs
approved these changes
Nov 23, 2026
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.
No linked issue. Found while reviewing #6111.
Summary
Recent feature PRs added English placeholder values to most locale files, and nobody translated them afterwards. The existing locale specs only check that every locale has the same keys, so they didn't catch it. This PR fixes the strings, deletes keys nothing uses, and adds a check that runs before every build. There are three commits:
Translate strings left in English (264 values)
sideBar.move.*(13 keys, from feat: #3565 move files and folders by dragging in the sidebar #5945): de, es, fr, ja, ko, nl, pt, ru, tr, zh-TWpreferences.editor.fileRepresentation.tabInputNotes(from fix: #1592 support real Tab input and list indentation #5891): de, es, fr, ja, ko, nl, pt, ru, trexportSettings.options.themes.academic: itpreferences.markdown.extensions.superSubScript: es, ptRemove 18 unused keys from all 14 locale files. Nothing in
packages/desktop/srcreferences them, either directly or through a key built in code. For example,readingMode.skippedstopped being used in feat: enable durable startup, workspace and multi-window recovery (5/5) #5922, andsideBar.search.searchInFolderwas replaced bysearchInFolders. The full list is in the commit message.Size saved: 11,171 bytes (2.23%) across the shipped
.min.jsonfiles, from 500,878 to 489,707. In the source JSON it is 13,061 bytes (2.11%), from 618,562 to 605,501. That works out to about 710–890 bytes per minified locale, or about 1,090 for ru, whose Cyrillic text takes 2 bytes per character in UTF-8.Validate locale keys in
scripts/minify-locales.tsbefore writing the.min.jsonfiles. The script now exits 1 if:en.json, or has a key thaten.jsondoesn't, oren.jsonkey isn't referenced by any.tsor.vuefile underpackages/desktop/src.The usage check is a single ripgrep pass, about 2 seconds, that collects quoted dotted strings. Template literals (
`menu.theme.${name}`) and concatenated prefixes ('sideBar.move.' + reason) match as patterns, so keys built in code still count as used. ripgrep comes from@vscode/ripgrep, resolved throughpackages/desktop, which already depends on it. No new dependency.Type of change
Test plan
build:*script. I confirmed it fails with exit 1 when I added a key missing from one locale, an extra key, and an unused key.pnpm run minify-locales: 14 locales, 809 keys, all present and referenced. It also works frompackages/desktop, which is how the build scripts call it.locale-validation,language-registries,i18n,context-menu-locales, and MuyalocaleCompleteness.sidebar-move.spec.ts, which fail withEPERMbecause creating symlinks on Windows needs Developer Mode. They're unrelated to this PR.scripts/minify-locales.ts.Notes for reviewers [optional]
„…“,« … »,「…」) and terms for "sidebar" and "folder". Native speakers should still check them.en.jsonwithout using it, or without adding it to every locale, will fail the build until that's fixed.By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.