ac4af582301a4e8a29245dbba767eba31334ddf9
1
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f49f6ba686 |
tray: a usage window's name and unit read as its card says them (yi_time)
yi_time on Discord (Windows, v0.1.2777, magpie in Chinese): the tray
icon's tooltip said "WorkBuddy / Credits 0 / 500 credits · 已用 0% · 27 天
13 小时 后重置". The window's name and unit come from the WorkBuddy plugin
in English. The Usage page's card says both with t() (t(w.name),
t(w.unit)), so it read 积分 there, but trayCardText wrote them as given.
The fix is for every window, not WorkBuddy only:
- traywords.go reads the page's own table (embedded assets/i18n.js, once)
and trayCardText says each window's name, and each " · " part of a
pool's or family's name, and its count's unit, from it. The tray now
reads as the card does in zh, zh-TW, ja and de; English is unchanged.
- i18n.js gains the window names and units plugins report that it lacked
in every language, so the card had them in English too: Extra credits,
Prepaid credits, Free model tokens (workbuddy); Add-on, Dedicated,
Shared, Total credits (qoder); Monthly credits, Purchased credits,
5-hour window (agnes); Promotional Credits (gcp-ai); Free models
(devin); Free usage, Monthly, Included (cursor); Free trial (kiro);
Dollar Usage (trae); Neurons/day (free allowance) (cloudflare-workers-ai);
AI Q&A and the unit "questions" (orcaterm). Collected from
magpie-community/plugins origin/main usage() results. No plugin change
is needed: the plugins send English words, and magpie translates them.
Tests:
- TestTrayTooltipSaysWindowWordsAsTheCard: yi_time's card (Credits,
0 / 500 credits, 27d 13h) gives the exact tooltip in all five languages,
and a pool's window ("Gemini · 5 hours") is said in its parts.
- TestPluginWindowWordsSaidInEveryLanguage: each word above is in every
language's table. TestParsePageWords: two pairs to a line, escapes, a
comment and NOTICES left out.
- quota-window-words.test.cjs: the Usage card says WorkBuddy's and
Qoder's window names and unit in en, zh, zh-TW, ja, de, chromium and
webkit, 1100px and 420px.
Run at the pushed head 3886c2cc0's tree (on origin/main
|