Repository navigation
Conversation
The connectors subtree of /settings was the largest Chinese block left in the English render: 304 CJK characters over 29 text nodes and 4 attributes. It sits in settings/index.html with no page-level dictionary, so every visible string is static text that renderSystemLocale could not reach. Tag each of those strings with data-ui-text / data-ui-label / data-ui-placeholder and add the matching settings.connectors.* keys (38 now, 32 new) to SETTINGS_MESSAGES in system-locale-catalog.mjs. The zh values are copied from the existing static text byte for byte, so the Chinese render is unchanged, and every new key is referenced by a marker in this page, so the file gains no orphan keys. Two structural edits were needed: the category chips split their label and count into two spans (the count is filled at runtime, so the label alone must be a leaf node for the translator), and the three custom-MCP form labels wrap their text in a span for the same reason. The pinned assertion in tests/test_settings_page.py matched the retry button's exact attribute string; it now matches the id plus hidden plus the Chinese text, which keeps the same guarantee while allowing locale markers beside them. Related #3438
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.
What
The connectors subtree of
/settingswas the largest Chinese block left in the English render: 304 CJK characters over 29 text nodes and 4 attributes (返回设置,粘贴你的 Composio API key,搜索应用…,按分类筛选, plus the key card, the catalog chrome, the empty state, the custom-MCP section and the MCP dialog). Unlike/chat, this subtree has no page-level dictionary, so every visible string is static text insettings/index.htmlthatrenderSystemLocalehad nothing to match.This PR tags those strings and adds their catalog entries. It does not touch the Composio row state machine or any runtime message string (see Out of scope).
Shape
Base
d57d6da41941822b9067cc579ad4944da3715eb3(tree8d620c66), patch tree937a965f, 4 files, +84/−52. The patch applies to that base without fuzz and touches nothing else: the patched tree differs from the base tree in exactly these four paths (both trees have 2228 entries).flybot_workspace/static/settings/index.htmle058820b39f18cd7flybot_workspace/static/shell/system-locale-catalog.mjs95cb0990bd8999abdocs/inventory/visible-controls.json49bfde636dc1ca1atests/test_settings_page.py23eb5535dec7caf1Changes
flybot_workspace/static/settings/index.html— 33 new markers (29data-ui-text, 2data-ui-label, 2data-ui-placeholder) over 32 changed lines, backed by 32 new keys; the back link (返回设置) reuses the existingsettings.back. Both hunks land inside the connectors block (it starts at line 534); nothing above it moves, and the sub-page keys already in this file are untouched.flybot_workspace/static/shell/system-locale-catalog.mjs— 32 newsettings.connectors.*key pairs appended to the existing block (6 → 38 keys;SETTINGS_MESSAGES116 → 148). Thezh-CNvalues are copied from the existing static text byte for byte. Every added key is referenced by a marker in this page, so the catalog gains no orphan keys, and every added English value is CJK-free. No JS logic changes.docs/inventory/visible-controls.json— regenerated with the tree's ownscripts/visible_inventory.py; onlylinevalues move (the markers add no controls). Regenerating again on the patched tree leaves the file byte-identical.tests/test_settings_page.py— one pinned assertion matched the retry button's exact attribute string (id="composio-retry" class="secondary" hidden>重试读取状态</button>); it now matchesid="composio-retry"plushiddenplus the Chinese text, keeping the same guarantee while allowing locale markers beside them.Two structural edits were needed because
renderSystemLocaleonly translates leaf nodes:<span data-ui-text=…>label</span> <span data-count></span>, since the count is written at runtime and a node with children is skipped;<span>for the same reason.Evidence (local, not CI)
Every reading below was taken on the patched tree built from base
d57d6da4+ this patch (tree937a965f), rendered through the realcreatePageHandler(not a directrenderSystemLocalecall), withgetSystemLanguage: () => 'en'.aria-label/placeholder/title/alt/labelvalue (connectors: text 3,671 B, attributes 1,795 B, unchanged).scripts/visible_inventory.pyon the patched tree reports1913 / 266 / 6 / 24, and rerunning it leavesdocs/inventory/visible-controls.jsonbyte-identical (sha256b3e1dd95…).SETTINGS_MESSAGES, everyzh-CNvalue equal to the static text, everyenvalue free of CJK — 0 problems.<span>drops one trailing space each.python -m unittest tests.test_visible_inventory tests.test_settings_page→ 23 tests OK (13.4 s).node --test --test-concurrency=2 tests/*.test.mjs .github/scripts/*.test.mjs→ 1093 pass / 0 fail / 0 cancelled (23.7 s), includingsettings_page.test.mjs,system_locale.test.mjs,system_locale_chat.test.mjsandsystem_locale_catalog.test.mjs(46/46 when run alone).Out of scope (residual, next slice)
The Composio row state machine in
static/settings/app.mjswrites Chinese at runtime and overwrites these markers once the catalog loads: the key badge (已保存/未配置 Composio/正在读取配置…/状态暂不可用), the key input placeholder, the two counters (N 个已连接,N 个应用 · M 个分类),composioRowState(~12 status/button/title strings) andCOMPOSIO_ERRORS(8 strings). Their catalog keys belong to the slice that wires them, so none are added here. Those strings are not in this PR; the counts above are the server-rendered HTML, not a browser session. Thelanguage(30),model-api(193),skill-configuration(225),channels(63) and shell (6) blocks are also untouched. No browser screenshot: Playwright/Chromium is not available on this host, so the English reading stops at the rendered HTML.Related #3438