mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5068] [GUI] chat speed chip shows {0}{1} braces and English "last reply" in the Chinese interface, with the number after the words #2356
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#2356
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?
Originally created by @xvcezrqpbxtpzblrt on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5068
Area
[GUI] (the desktop app)
Desktop app, Terminal or source?
Desktop app (Windows, Linux or Mac)
What happened
The chat telemetry strip's first chip (the speed gauge) shows raw placeholders and untranslated English in the Chinese interface:
It should read
46 词元/秒 · 上次回复. Three things are wrong in that one string: the literal{0}{1}braces are visible,· last replyis English inside a 中文 interface, and the number sits after the words. The chip beside it in the same row is correct (8.6M 个总词元), so the intended shape is right there next to it.The strip, as rendered (the screenshot is from the person at the keyboard; the exact characters, read off a 6x zoom of the 463x34 strip, are):
The speed chip's characters are
{,0,},{,1,},,词,元,/,秒,,·,,l,a,s,t,,r,e,p,l,y, then the live number. The number46is the<Num>element, appended after the words.Cause, read from the source at
v0.2.10(ffa80d7) — read, not run in a debugger:apps/host/src/components/TelemetryPopover.tsx:53renders the visible chip througharound(m.streaming ? "{0}{1} tok/s" : "{0}{1} tok/s · last reply", approx, <Num value={speed} format={int}/>), andaroundisTelemetryPopover.tsx:49:const [head, tail = ''] = tr(template, [before, PLACE]).split(PLACE), wherePLACEis the single character U+0001 (I read the codepoint out of the file, so the sentinel is real and the split is not the bug).*-en.jsonmerged in the order ofi18n.ts:132: the catalog containss2542 = "{0}{1} tok/s{2}"ands2496 = "· last reply", not"{0}{1} tok/s"and not"{0}{1} tok/s · last reply".TelemetryPopover.tsx:54passes"{0}{1} total tokens", which is a catalog string — and that chip is the one that renders correctly.tr()falls into the pattern path ati18n.ts:158: it matches the caller's raw, untranslated template against the regex compiled froms2542, so the "slot values" it captures are the literal texts{0}and{1}, and· last replyfor slot 2.i18n.ts:160substitutes those captures into the Chinese templates2542 = "{0}{1} 词元/秒{2}"and produces{0}{1} 词元/秒 · last reply— character for character what is on screen.localizedTemplateSlots(i18n.ts:150) listss1242, s2473, s0825, s2455, s2456, s7400and nots2542, so the captured· last replyis never re-translated. The Chinese string exists (s2496 = "· 上次回复") and is never consulted.PLACEsentinel never reaches the localized text (the fallback discards the caller's[before, PLACE]values), sosplitfinds nothing:headis the whole string,tailis empty, and the<Num>element is appended after the words — which is exactly the ordering the comment onTelemetryPopover.tsx:48says thearoundhelper exists to avoid ("the words around the number keep the language's own order").tr("{0}{1} tok/s{2}", [approx, Math.round(speed), …]), which does hits2542and composes46词元/秒 · 上次回复. So a screen reader is given the correct sentence while the eye is given the braces.Shape of the fix, for scope: the two templates the caller passes have to exist as catalog strings in the locales, and
s2542's tail slot belongs inlocalizedTemplateSlots. The working chip onTelemetryPopover.tsx:54is the working example. I am not sending a patch.Smallest steps or command that reproduce it
{0}{1} 词元/秒 · last reply <number>in both states.8.6M 个总词元: number first, no braces, no English — the control case.Reproduction status
Reproduced locally — seen by the person at the keyboard in the desktop app, the rendering above; the screenshot itself is from the person at the keyboard and is available on request. The causal chain is read from the source at
v0.2.10and is marked as read-from-code above.Strata version
Strata 0.2.10 (desktop app, Windows x64) · engine
0.1.56-windows-x86_64-cuda-cuda13· UI language 中文(简体)Graphics card, memory and system
NVIDIA GeForce RTX 3080 Ti Laptop GPU · 64 GB RAM · Windows 11 专业版 (build 26300).
Win32_VideoController.AdapterRAMreports 4 GB for this laptop part, so I am not recording a VRAM figure.Model, size and settings
Swift 1.5
Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S(IQ3_S, two shards) with the picture readermmproj-Swift-Qwen3.8-Flash-Next-BF16.gguf. The strip is visible with the model loaded; the defect is interface copy and shows whatever model is running.Logs
Not relevant: a string-composition defect in the interface, with no engine involvement, and nothing in the logs.