mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4620] [GUI] chat speed line showed raw {0}{1} placeholders in non-English languages: register its two live templates in every catalog #5115
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5115
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4620
Author: @lamboJw
Created: 10/29/2026
Status: 🔄 Open
Base:
main← Head:fix-chat-speed-locale📝 Commits (1)
717924bLocales: register the chat speed pill's two live templates in every catalog📊 Changes
10 files changed (+66 additions, -9 deletions)
View changed files
📝
apps/host/src/locales/de.json(+3 -1)📝
apps/host/src/locales/en.json(+3 -1)📝
apps/host/src/locales/es.json(+3 -1)📝
apps/host/src/locales/fr.json(+3 -1)📝
apps/host/src/locales/ja.json(+3 -1)📝
apps/host/src/locales/ko.json(+3 -1)📝
apps/host/src/locales/pt.json(+3 -1)📝
apps/host/src/locales/ru.json(+3 -1)📝
apps/host/src/locales/zh.json(+3 -1)➕
apps/host/tests/chat-speed-locale.test.mjs(+39 -0)📄 Description
Problem and result:
The chat footer speed line (UI language 中文, Strata 0.2.7) rendered as
{0}{1} 词元/秒 · last reply 71: raw placeholders on screen, the speed number glued at the end, and· last replyleft in English. Observed on my own PC (Windows 11). After this change the same line reads≈ 18 词元/秒 · 上次回复(≈only while the figure is estimated): the number sits where the language's own word order wants it, in all nine languages.Approach:
ChatTelemetrybuilds the live speed line througharound()fromtr("{0}{1} tok/s")(while a reply streams) andtr("{0}{1} tok/s · last reply")(after it). Neither literal has an English catalog key — only the label form{0}{1} tok/s{2}(s2542) is registered. In English the lookup returns the template itself so nothing looks wrong; in every other languagetr()falls to its pattern path, which re-extracts slot values from the template text itself, so the{0}and{1}literals get captured and poured into the translated line. The"{0}{1} total tokens"chip did have a key, which is why only the speed chip broke. The fix is catalog-only: keyss9038ands9039, each value derived from that language's own s2542 (speed unit) and s2496 (last reply) strings, so the slot parity checks hold and the existing terminology is reused (zh词元/秒and上次回复come from s2542/s2496 as they are).around()and the number element itself are untouched.Validation:
(0){1} 词元/秒 · last reply 71). Second, mechanically: the new test file on untouched main@46c152a1 fails both tests before the change, and the zh assertion prints{0}{1} 词元/秒18(raw placeholder, number glued on).node --test tests/chat-speed-locale.test.mjs tests/languages-and-catalog.test.mjs tests/locale-gaps.test.mjs tests/tune-locales.test.mjs tests/tools-locales.test.mjs tests/answer-speed.test.mjs— 25 tests, 25 pass, including the two new ones and every existing catalog key/slot-parity check.npm teston my machine exits with environment-only failures: the guided-setup-empty-catalog tests die on esbuild temp-file writes (Access is denied, sandboxed shell), the model-directory test on a Windows symlink privilege (EPERM), the Harness-dependent agent tests skip withSTRATA_HARNESS_DIR is not set, and the real-browser tests skip as designed (STRATA_TEST_BROWSER). I ran those same two test files on untouched main@46c152a1 with this change stashed: identical failures, so they belong to my machine, not to this change. CI should run the full suite properly.Limits:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.