diff --git a/src/components/Search/InputBox.tsx b/src/components/Search/InputBox.tsx index 31013ee5..a69e58c1 100644 --- a/src/components/Search/InputBox.tsx +++ b/src/components/Search/InputBox.tsx @@ -84,6 +84,9 @@ export default function ChatInput({ const { modifierKey, returnToInput, setModifierKeyPressed } = useShortcutsStore(); + const language = useAppStore((state) => { + return state.language; + }); useEffect(() => { return () => { @@ -180,6 +183,18 @@ export default function ChatInput({ return state.disabledExtensions; }); + const akiAiTooltipPrefix = useMemo(() => { + if (language === "zh") { + if (/^[a-zA-Z]/.test(askAI?.name)) { + return "问 "; + } + + return "问"; + } + + return "Ask"; + }, [language, askAI]); + const renderSearchIcon = () => ( {t("search.askCocoAi.title", { - replace: [askAI.name], + replace: [akiAiTooltipPrefix, askAI.name], })}
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index c958ee99..2f574b84 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -343,7 +343,7 @@ "search": "Search Operation" }, "askCocoAi": { - "title": "Ask {{0}}", + "title": "{{0}} {{1}}", "placeholder": "Ask More", "continueInChat": "Continue in chat", "copy": "Copy" diff --git a/src/locales/zh/translation.json b/src/locales/zh/translation.json index 46a0b6e4..895023e7 100644 --- a/src/locales/zh/translation.json +++ b/src/locales/zh/translation.json @@ -343,7 +343,7 @@ "search": "搜索操作" }, "askCocoAi": { - "title": "问{{0}}", + "title": "{{0}}{{1}}", "placeholder": "问更多", "continueInChat": "继续聊天", "copy": "复制"