Repository navigation
i18n: console, fleet, node, package and terminal pages in seven languages (0.4.118) - #139
Merged
Merged
Conversation
…logue; 0.4.118 Pure-text elements and attributes carry data-i18n (English kept inside, held equal to the catalogue by a test); toast/setMessage/textContent messages call t(); plural() takes its noun from the catalogue. About 900 sentences in seven languages. setHTML translates before it compares, and a MutationObserver translates markup added later. The chat page is left for its rewrite. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0194znU5X7AzhxHW4wQoKm58
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.
Requested by Maître · project thread
Before: the i18n system from #138 existed but the pages still held their sentences in English, written into the markup and the JS.
After: about 900 sentences of the console, fleet, node, package and terminal pages are catalogue keys with translations in fr, en, de, ru, zh, pl and sk. Setting
languagetode(or following a German browser) shows the console in German. The chat page is left out on purpose: it is being rewritten on this system.How: pure-text elements and attributes carry
data-i18n/data-i18n-attrwith their English kept inside (a test holds it equal to the catalogue, so the two cannot drift). Messages passed totoast(),setMessage()and.textContent =callt()with parameters, andplural()takes its noun fromcount.*entries so it follows each language's plural rules.setHTMLtranslates before it compares, so the repaint-skip still works in a translated page, and aMutationObservertranslates markup added later. Verified in headless Chromium in German and Chinese: all five pages load with no script error and show translated text.Not migrated yet (documented in
Docs/I18n/guide): paragraphs mixing text and inline markup, JS strings composed outside those three calls, command-palette labels, and the chat page. A test refuses any new literal in the three migrated calls. Translations were drafted by model and want a native read for technical vocabulary.Tests: 134 in
tests/test_i18n.py(keys, parameters and plural forms identical across languages; every key a page asks for exists; no key unused; English inline equals the catalogue). Unit 5056 passed, integration 155 passed. A few structural assertions intest_webassets,test_console_layoutandtest_map_growthwere adapted to the new markup.Generated by Claude Code