refactor: improve tooltip display in chinese (#660)

This commit is contained in:
ayangweb
2025-06-11 14:01:08 +08:00
committed by GitHub
parent 4bcae5cffb
commit 35ea30626f
3 changed files with 18 additions and 3 deletions

View File

@@ -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 = () => (
<SearchIcons
lineCount={lineCount}
@@ -232,7 +247,7 @@ export default function ChatInput({
<div className="flex items-center gap-2 text-sm text-[#AEAEAE] dark:text-[#545454] whitespace-nowrap">
<span>
{t("search.askCocoAi.title", {
replace: [askAI.name],
replace: [akiAiTooltipPrefix, askAI.name],
})}
</span>
<div className="flex items-center justify-center w-8 h-[20px] text-xs rounded-md border border-black/10 dark:border-[#545454]">

View File

@@ -343,7 +343,7 @@
"search": "Search Operation"
},
"askCocoAi": {
"title": "Ask {{0}}",
"title": "{{0}} {{1}}",
"placeholder": "Ask More",
"continueInChat": "Continue in chat",
"copy": "Copy"

View File

@@ -343,7 +343,7 @@
"search": "搜索操作"
},
"askCocoAi": {
"title": "{{0}}",
"title": "{{0}}{{1}}",
"placeholder": "问更多",
"continueInChat": "继续聊天",
"copy": "复制"