mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-18 13:23:33 +08:00
refactor(desktop): remove i18n from spinner verbs, use English only
Drop Chinese spinner verb array and locale-based selection. StreamingIndicator now uses English status verbs directly without going through the i18n system. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
276169015c
commit
85969318b9
@ -1,7 +1,5 @@
|
||||
import { useChatStore } from '../../stores/chatStore'
|
||||
import { useTabStore } from '../../stores/tabStore'
|
||||
import { useTranslation } from '../../i18n'
|
||||
import type { TranslationKey } from '../../i18n/locales/en'
|
||||
|
||||
function formatElapsed(seconds: number): string {
|
||||
if (seconds < 60) return `${seconds}s`
|
||||
@ -17,16 +15,11 @@ export function StreamingIndicator() {
|
||||
const statusVerb = sessionState?.statusVerb ?? ''
|
||||
const elapsedSeconds = sessionState?.elapsedSeconds ?? 0
|
||||
const tokenUsage = sessionState?.tokenUsage ?? { input_tokens: 0, output_tokens: 0 }
|
||||
const t = useTranslation()
|
||||
|
||||
// Translate known server-sent verbs (e.g. "Thinking", "Task started")
|
||||
let verb: string
|
||||
if (statusVerb) {
|
||||
const serverKey = `serverVerb.${statusVerb}` as TranslationKey
|
||||
const translated = t(serverKey)
|
||||
verb = translated !== serverKey ? translated : statusVerb
|
||||
verb = statusVerb
|
||||
} else {
|
||||
verb = chatState === 'thinking' ? t('streaming.thinking') : chatState === 'tool_executing' ? t('streaming.running') : t('streaming.working')
|
||||
verb = chatState === 'thinking' ? 'Thinking' : chatState === 'tool_executing' ? 'Running' : 'Working'
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
import { useSettingsStore } from '../stores/settingsStore'
|
||||
|
||||
const SPINNER_VERBS_EN = [
|
||||
const SPINNER_VERBS = [
|
||||
'Accomplishing',
|
||||
'Actioning',
|
||||
'Actualizing',
|
||||
@ -190,198 +188,6 @@ const SPINNER_VERBS_EN = [
|
||||
'Zigzagging',
|
||||
]
|
||||
|
||||
const SPINNER_VERBS_ZH = [
|
||||
'成就中',
|
||||
'行动中',
|
||||
'实现中',
|
||||
'架构中',
|
||||
'烘焙中',
|
||||
'发射中',
|
||||
'嘟嘟叫',
|
||||
'困惑中',
|
||||
'翻腾中',
|
||||
'焯水中',
|
||||
'吹牛中',
|
||||
'扭扭舞',
|
||||
'磨蹭中',
|
||||
'嘟嘟响',
|
||||
'启动中',
|
||||
'酿造中',
|
||||
'揉面中',
|
||||
'钻洞中',
|
||||
'计算中',
|
||||
'亲昵中',
|
||||
'焦糖化',
|
||||
'奔涌中',
|
||||
'弹射中',
|
||||
'冥想中',
|
||||
'引导中',
|
||||
'疏导中',
|
||||
'编舞中',
|
||||
'搅拌中',
|
||||
'Claude中',
|
||||
'凝聚中',
|
||||
'沉思中',
|
||||
'修复中',
|
||||
'谱曲中',
|
||||
'运算中',
|
||||
'调配中',
|
||||
'考虑中',
|
||||
'深思中',
|
||||
'烹饪中',
|
||||
'打造中',
|
||||
'创造中',
|
||||
'咔嚓中',
|
||||
'结晶中',
|
||||
'培育中',
|
||||
'破译中',
|
||||
'斟酌中',
|
||||
'决定中',
|
||||
'磨叽中',
|
||||
'搅乱中',
|
||||
'干活中',
|
||||
'涂鸦中',
|
||||
'细雨中',
|
||||
'退潮中',
|
||||
'生效中',
|
||||
'阐明中',
|
||||
'修饰中',
|
||||
'施魔法',
|
||||
'畅想中',
|
||||
'蒸发中',
|
||||
'发酵中',
|
||||
'小打闹',
|
||||
'周旋中',
|
||||
'烤炙中',
|
||||
'叨叨中',
|
||||
'流淌中',
|
||||
'迷惑中',
|
||||
'扑腾中',
|
||||
'锻造中',
|
||||
'成形中',
|
||||
'嬉闹中',
|
||||
'裱花中',
|
||||
'闲逛中',
|
||||
'驰骋中',
|
||||
'点缀中',
|
||||
'生成中',
|
||||
'比划中',
|
||||
'萌芽中',
|
||||
'Git中',
|
||||
'摇摆中',
|
||||
'狂风中',
|
||||
'和谐中',
|
||||
'哈希中',
|
||||
'孵化中',
|
||||
'放牧中',
|
||||
'鸣笛中',
|
||||
'欢呼中',
|
||||
'超空间',
|
||||
'构思中',
|
||||
'想象中',
|
||||
'即兴中',
|
||||
'孵育中',
|
||||
'推断中',
|
||||
'浸泡中',
|
||||
'电离中',
|
||||
'跳舞中',
|
||||
'切丝中',
|
||||
'揉面中',
|
||||
'发酵中',
|
||||
'悬浮中',
|
||||
'闲晃中',
|
||||
'显化中',
|
||||
'腌制中',
|
||||
'漫步中',
|
||||
'蜕变中',
|
||||
'雾化中',
|
||||
'太空步',
|
||||
'溜达中',
|
||||
'琢磨中',
|
||||
'集结中',
|
||||
'遐想中',
|
||||
'雾化中',
|
||||
'筑巢中',
|
||||
'读报中',
|
||||
'瞎琢磨',
|
||||
'聚合中',
|
||||
'环绕中',
|
||||
'指挥中',
|
||||
'渗透中',
|
||||
'漫游中',
|
||||
'渗滤中',
|
||||
'细读中',
|
||||
'哲思中',
|
||||
'光合中',
|
||||
'授粉中',
|
||||
'思索中',
|
||||
'高谈中',
|
||||
'扑腾中',
|
||||
'沉淀中',
|
||||
'变戏法',
|
||||
'处理中',
|
||||
'校对中',
|
||||
'传播中',
|
||||
'捣鼓中',
|
||||
'费解中',
|
||||
'量子化',
|
||||
'眼花缭乱',
|
||||
'闪闪发光',
|
||||
'重组中',
|
||||
'编织中',
|
||||
'栖息中',
|
||||
'反刍中',
|
||||
'煎炒中',
|
||||
'蹦跶中',
|
||||
'拖拽中',
|
||||
'奔忙中',
|
||||
'调味中',
|
||||
'恶作剧',
|
||||
'摇曳中',
|
||||
'炖煮中',
|
||||
'溜走中',
|
||||
'素描中',
|
||||
'滑行中',
|
||||
'揉搓中',
|
||||
'跳摇滚',
|
||||
'探洞中',
|
||||
'旋转中',
|
||||
'萌发中',
|
||||
'炖汤中',
|
||||
'升华中',
|
||||
'漩涡中',
|
||||
'俯冲中',
|
||||
'共生中',
|
||||
'合成中',
|
||||
'回火中',
|
||||
'思考中',
|
||||
'雷鸣中',
|
||||
'修补中',
|
||||
'胡闹中',
|
||||
'颠倒中',
|
||||
'变形中',
|
||||
'嬗变中',
|
||||
'扭转中',
|
||||
'波动中',
|
||||
'展开中',
|
||||
'解开中',
|
||||
'感应中',
|
||||
'摇摆中',
|
||||
'游荡中',
|
||||
'扭曲中',
|
||||
'不知所云',
|
||||
'漩涡中',
|
||||
'嗡嗡响',
|
||||
'搅打中',
|
||||
'摇晃中',
|
||||
'工作中',
|
||||
'搏斗中',
|
||||
'调味中',
|
||||
'曲折中',
|
||||
]
|
||||
|
||||
export function randomSpinnerVerb(): string {
|
||||
const locale = useSettingsStore.getState().locale
|
||||
const list = locale === 'zh' ? SPINNER_VERBS_ZH : SPINNER_VERBS_EN
|
||||
return list[Math.floor(Math.random() * list.length)] ?? '思考中'
|
||||
return SPINNER_VERBS[Math.floor(Math.random() * SPINNER_VERBS.length)] ?? 'Thinking'
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user