{{ message }}
Repository navigation
fix(i18n): give Dutch users the Dutch editor UI, and hold the language registries together - #5502
Merged
Merged
Conversation
Contributor
|
Build artifacts for PR #5502: Run: https://github.com/marktext/marktext/actions/runs/35680347028 |
Jocs
force-pushed
the
fix/5499-dutch-editor-locale
branch
from
September 22, 2026 02:21
7b06b3a to
574e434
Compare
This was referenced Sep 22, 2026
Jocs
added a commit
that referenced
this pull request
Sep 22, 2026
…#5504) (#5505) `copies a 600-level nested list without exhausting the stack` failed intermittently on CI with RangeError — twice on unrelated PRs (#5496, #5502), passing on re-run with no code change. The recursion was in the test, not in `deepClone`. Measured ceilings for the fixture shape this spec builds: deepClone(nested(d)) alone 100000 levels, never threw the test body, verbatim ok <= 900, RangeError @ 1000 expect(a).not.toBe(b) ok <= 900, RangeError @ 1000 structuredClone (the #4747 ok <= 600, throws @ 700 control) `expect(copy).not.toBe(state)` hands the whole 600-level structure (~2400 nested containers) to Vitest, which recurses once per level inspecting the argument. That left a margin of 600 -> ~900, and the ceiling moves with the Node build and the worker thread's stack size, so CI landed on the wrong side of it about half the time. Compare identity outside the matcher so only booleans reach `expect`. With the fixture raised to 10000 levels the spec now passes; restoring just those two lines at the same depth reproduces the CI RangeError exactly. The spec's own comment already warned that "a recursive equality check" would overflow this input — `expect(deepObject)` is one. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The map from the desktop language preference to the engine's locale objects lived inside a 2000-line SFC, where no unit test can reach it. Lift it to `util/muyaLocale.ts` unchanged so the next commits can fix and then guard it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`nl.ts` has been complete since #5137 and `locales/index.ts` exports it, but `nl` never reached the three lists the desktop reads: the `@muyajs/core` export hub, the desktop's type surface for it, and MUYA_LOCALES. Picking Nederlands therefore hit the `?? en` fallback, leaving the inline format toolbar, quick-insert menu, emoji picker, image selector and preview-block strings in English while the rest of the app was Dutch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adding a UI language means editing lists in five places that nothing checks against each other, and they have drifted twice under a green CI run: `nl` never reached the engine locale map (#5499) and `ru` never reached `electronLanguages` (#5496). Assert that SUPPORTED_LANGUAGES, the locale JSON files on disk, the Preferences dropdown, MUYA_LOCALES and electronLanguages all describe the same set, and name the file to edit in each failure message. The electronLanguages arm matches on the primary subtag, since Electron ships pt-BR/pt-PT rather than a bare `pt`, and spells macOS bundles with an underscore. The yml block is hand-parsed: no YAML parser is a declared dependency here, and reaching for the one electron-builder hoists into node_modules would be the phantom dependency that broke #5159. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Jocs
force-pushed
the
fix/5499-dutch-editor-locale
branch
from
September 22, 2026 02:40
574e434 to
cb94df4
Compare
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.

Closes #5499
Closes #5500
Summary
Dutch was offered as a UI language but never reached the editor engine, so picking Nederlands gave Dutch application chrome and an English editor UI. The cause is structural: adding a language means editing lists in five places that nothing checks against each other, and they have now drifted twice —
nlnever reachedMUYA_LOCALES, and in #5496runever reachedelectronLanguages. Both slipped through green CI.Changes
refactor(desktop)— liftMUYA_LOCALES/getMuyaLocaleout ofeditor.vueintoutil/muyaLocale.ts. No behaviour change; it makes the map reachable from a unit test.fix(i18n)(#5499) — addnlto the three lists it was missing from:packages/muya/src/index.tsexport { de, en, es, fr, ja, ko, pt, tr, zhCN, zhTW }packages/desktop/src/types/muya-core.d.tsnlutil/muyaLocale.ts(MUYA_LOCALES)nlentrynl.tshas been complete since #5137 (85/85 keys,name: 'nl') andlocales/index.tsexported it all along — only the export hub and the consumers were short, sogetMuyaLocale('nl')hit its?? enfallback.test(desktop)(#5500) — newlanguage-registries.spec.tsasserting thatSUPPORTED_LANGUAGES, the locale JSON files on disk, the Preferences dropdown,MUYA_LOCALESandelectronLanguagesall describe the same set. Each failure message names the file to edit.The
electronLanguagesarm matches on the primary subtag — Electron shipspt-BR/pt-PTrather than a barept, and macOS.lprojbundles use an underscore. The yml block is hand-parsed rather than read with js-yaml: no YAML parser is a declared dependency of this package, and using the copy electron-builder hoists intonode_moduleswould be the phantom dependency that broke #5159.What the user sees
Before, with Nederlands selected: menus, preferences, dialogs and sidebar in Dutch; inline format toolbar tooltips, the
/quick-insert menu, emoji picker categories, image selector and preview-block strings in English. After: all Dutch.Verification
Both regressions were reproduced against the new spec before being fixed:
nlfromMUYA_LOCALES→maps every supported language to an engine locale (util/muyaLocale.ts)fails, diff shows- "nl"trfromelectronLanguages→keeps a resource for every supported languagefails with the actionable hintLocal gate, all green:
vue-tsc --noEmit,tsc --noEmit(muya), desktop unit 870 passed (66 files), muya unit 1994 passed (256 files),madge --circular src/index.tsclean, ESLint clean on touched files.Note for reviewers
The
electronLanguagesarm of the new spec will fail on #5496 as it stands today, which is the point — that PR addsrueverywhere except the packaging whitelist. I have the fix for it ready to push to that branch.🤖 Generated with Claude Code