mirror of
https://github.com/infinilabs/coco-app.git
synced 2026-09-01 19:51:52 +02:00
refactor: improve tooltip display in chinese (#660)
This commit is contained in:
@@ -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]">
|
||||
|
||||
@@ -343,7 +343,7 @@
|
||||
"search": "Search Operation"
|
||||
},
|
||||
"askCocoAi": {
|
||||
"title": "Ask {{0}}",
|
||||
"title": "{{0}} {{1}}",
|
||||
"placeholder": "Ask More",
|
||||
"continueInChat": "Continue in chat",
|
||||
"copy": "Copy"
|
||||
|
||||
@@ -343,7 +343,7 @@
|
||||
"search": "搜索操作"
|
||||
},
|
||||
"askCocoAi": {
|
||||
"title": "问{{0}}",
|
||||
"title": "{{0}}{{1}}",
|
||||
"placeholder": "问更多",
|
||||
"continueInChat": "继续聊天",
|
||||
"copy": "复制"
|
||||
|
||||
Reference in New Issue
Block a user