Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: localize hardcoded UI strings across 10 surfaces (#20795)

YuTengjing2b234cd39250
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index d546b7814e9..1885b91b6de 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -1684,6 +1684,9 @@
"qoderInstallGuide.menuNotification.title": "Qoder CLI not found",
"qoderInstallGuide.reason": "LobeHub could not start Qoder: {{message}}",
"qoderInstallGuide.title": "Install Qoder CLI",
+ "quickChatSwitcher.empty": "No agents found",
+ "quickChatSwitcher.more": "More agents",
+ "quickChatSwitcher.searchPlaceholder": "Search agents...",
"rag.referenceChunks": "Reference Source",
"rag.userQuery.actions.delete": "Delete Query Rewrite",
"rag.userQuery.actions.regenerate": "Regenerate Query",
@@ -1978,6 +1981,14 @@
"taskCallback.error": "Task failed",
"taskCallback.interrupted": "Task interrupted",
"taskCallback.viewTask": "View task",
+ "taskCard.field.activities": "Activities",
+ "taskCard.field.dependencies": "Dependencies",
+ "taskCard.field.description": "Description",
+ "taskCard.field.instruction": "Instruction",
+ "taskCard.field.review": "Review",
+ "taskCard.field.reviewRubrics": "Review rubrics",
+ "taskCard.field.subtasks": "Subtasks",
+ "taskCard.field.workspace": "Workspace",
"taskDetail.acceptance.checklist": "Acceptance checklist",
"taskDetail.acceptance.closeDetail": "Close check detail",
"taskDetail.acceptance.collapseAll": "Collapse all groups",
@@ -2510,6 +2521,9 @@
"upload.validation.mediaNotSupported": "The current model cannot read these media files, so they were not added: {{files}}. Switch to a model that supports them, or upload a different file type.",
"upload.validation.unsupportedFileType": "Unsupported file type: {{files}}. Supported images: JPG, PNG, GIF, WebP. Supported documents include PDF, Word, Excel, PowerPoint, Markdown, text, CSV, JSON, and code files.",
"upload.validation.videoSizeExceeded": "Video file size must not exceed {{maxSize}}. Current file size is {{actualSize}}.",
+ "userFeedbackCard.count_one": "{{count}} comment",
+ "userFeedbackCard.count_other": "{{count}} comments",
+ "userFeedbackCard.title": "User feedback",
"verifyConfig.addCriterion": "Add criterion",
"verifyConfig.collapsedHint": "Generate criteria from the task",
"verifyConfig.criteriaCount": "{{count}} criteria",
diff --git a/locales/en-US/components.json b/locales/en-US/components.json
index 838b18f475f..9fccdff57cb 100644
--- a/locales/en-US/components.json
+++ b/locales/en-US/components.json
@@ -39,7 +39,10 @@
"FileManager.actions.deleteAll": "Delete All Items",
"FileManager.actions.deleteAllOwn": "Delete All Items I Created",
"FileManager.actions.deleteSuccess": "File deleted successfully.",
+ "FileManager.actions.downloadPageEmpty": "Failed to download page: no content available",
+ "FileManager.actions.downloadPageError": "Failed to download page",
"FileManager.actions.downloading": "Downloading file...",
+ "FileManager.actions.folderNameRequired": "Folder name cannot be empty",
"FileManager.actions.goBack": "Go to previous page",
"FileManager.actions.goForward": "Go to next page",
"FileManager.actions.goToParent": "Go to parent folder",
diff --git a/locales/en-US/discover.json b/locales/en-US/discover.json
index 1f2aa853ef5..f0b168242ac 100644
--- a/locales/en-US/discover.json
+++ b/locales/en-US/discover.json
@@ -620,6 +620,7 @@
"tab.skill": "Skills",
"tab.user": "User",
"tab.workspace": "Workspace",
+ "toc.permalink": "Permalink for this section",
"user.accountType.organization": "Organization",
"user.agents": "Agents",
"user.cancel": "Cancel",
diff --git a/locales/en-US/eval.json b/locales/en-US/eval.json
index 7b2c99ade60..545e8a40440 100644
--- a/locales/en-US/eval.json
+++ b/locales/en-US/eval.json
@@ -214,6 +214,8 @@
"evalMode.answer-relevance.desc": "Use LLM to evaluate answer relevance (yes or no)",
"evalMode.contains": "Contains Match",
"evalMode.contains.desc": "Output must contain the expected text",
+ "evalMode.criteria.label": "Eval Prompt",
+ "evalMode.criteria.placeholder": "Prompt template for the LLM judge",
"evalMode.equals": "Exact Match",
"evalMode.equals.desc": "Output must be exactly the same as expected",
"evalMode.external": "External Eval",
@@ -221,11 +223,17 @@
"evalMode.label": "Eval Mode",
"evalMode.llm-rubric": "LLM Judge",
"evalMode.llm-rubric.desc": "Use LLM to evaluate output quality based on custom criteria (0.0 to 1.0)",
+ "evalMode.model.label": "Model",
+ "evalMode.model.placeholder": "LLM model to use for evaluation (e.g. gpt-4)",
"evalMode.placeholder": "Select eval mode",
"evalMode.prompt.label": "Judge Prompt",
"evalMode.prompt.placeholder": "Enter the evaluation criteria or prompt for LLM judge",
+ "evalMode.provider.label": "Provider",
+ "evalMode.provider.placeholder": "LLM provider (e.g. openai, azure)",
"evalMode.rubric": "Rubric Scoring",
"evalMode.rubric.desc": "Score output using benchmark rubrics with weighted criteria",
+ "evalMode.systemRole.label": "System Prompt",
+ "evalMode.systemRole.placeholder": "Optional system prompt for the LLM judge",
"experiment.actions.create": "Create Experiment",
"experiment.actions.delete": "Delete Experiment",
"experiment.actions.delete.confirm": "Are you sure you want to delete this experiment? Its runs and scoped datasets will no longer be grouped here.",
diff --git a/locales/en-US/file.json b/locales/en-US/file.json
index 29ff23f79fb..ab1e807d2f3 100644
--- a/locales/en-US/file.json
+++ b/locales/en-US/file.json
@@ -314,6 +314,7 @@
"pageList.copySuccess": "Page copied",
"pageList.copyTitle": "Copy page",
"pageList.copyTo": "Copy to…",
+ "pageList.createFailed": "Failed to create page",
"pageList.duplicate": "Duplicate",
"pageList.empty": "No pages yet. Click the button above to create your first one.",
"pageList.filter.all": "All",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index 88365502a51..f707dd81bfd 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -1684,6 +1684,9 @@
"qoderInstallGuide.menuNotification.title": "未找到 Qoder CLI",
"qoderInstallGuide.reason": "LobeHub 无法启动 Qoder:{{message}}",
"qoderInstallGuide.title": "安装 Qoder CLI",
+ "quickChatSwitcher.empty": "未找到助理",
+ "quickChatSwitcher.more": "更多助理",
+ "quickChatSwitcher.searchPlaceholder": "搜索助理...",
"rag.referenceChunks": "引用源",
"rag.userQuery.actions.delete": "删除 Query 重写",
"rag.userQuery.actions.regenerate": "重新生成 Query",
@@ -1978,6 +1981,14 @@
"taskCallback.error": "任务失败",
"taskCallback.interrupted": "任务已中断",
"taskCallback.viewTask": "查看任务",
+ "taskCard.field.activities": "活动",
+ "taskCard.field.dependencies": "依赖",
+ "taskCard.field.description": "描述",
+ "taskCard.field.instruction": "指令",
+ "taskCard.field.review": "审核",
+ "taskCard.field.reviewRubrics": "审核标准",
+ "taskCard.field.subtasks": "子任务",
+ "taskCard.field.workspace": "工作区",
"taskDetail.acceptance.checklist": "验收清单",
"taskDetail.acceptance.closeDetail": "关闭检查详情",
"taskDetail.acceptance.collapseAll": "折叠全部分组",
@@ -2510,6 +2521,9 @@
"upload.validation.mediaNotSupported": "当前模型无法解析以下媒体文件,未添加:{{files}}。请切换到支持该媒体的模型,或改用其他文件类型。",
"upload.validation.unsupportedFileType": "不支持的文件类型:{{files}}。支持的图片格式:JPG、PNG、GIF、WebP。支持的文档包括PDF、Word、Excel、PowerPoint、Markdown、文本、CSV、JSON和代码文件。",
"upload.validation.videoSizeExceeded": "视频文件不能超过 {{maxSize}}。当前为 {{actualSize}}",
+ "userFeedbackCard.count_one": "{{count}} 条评论",
+ "userFeedbackCard.count_other": "{{count}} 条评论",
+ "userFeedbackCard.title": "用户反馈",
"verifyConfig.addCriterion": "添加验收项",
"verifyConfig.collapsedHint": "基于任务内容生成验收标准",
"verifyConfig.criteriaCount": "{{count}} 项检查",
diff --git a/locales/zh-CN/components.json b/locales/zh-CN/components.json
index 8ae06e2a065..40fe53cc9d6 100644
--- a/locales/zh-CN/components.json
+++ b/locales/zh-CN/components.json
@@ -39,7 +39,10 @@
"FileManager.actions.deleteAll": "删除全部资源",
"FileManager.actions.deleteAllOwn": "删除我创建的全部资源",
"FileManager.actions.deleteSuccess": "文件删除成功",
+ "FileManager.actions.downloadPageEmpty": "下载页面失败:页面没有内容",
+ "FileManager.actions.downloadPageError": "下载页面失败",
"FileManager.actions.downloading": "文件下载中…",
+ "FileManager.actions.folderNameRequired": "文件夹名称不能为空",
"FileManager.actions.goBack": "返回上一页",
"FileManager.actions.goForward": "前往下一页",
"FileManager.actions.goToParent": "返回上级文件夹",
diff --git a/locales/zh-CN/discover.json b/locales/zh-CN/discover.json
index 838ee67068d..055f1fb3f41 100644
--- a/locales/zh-CN/discover.json
+++ b/locales/zh-CN/discover.json
@@ -620,6 +620,7 @@
"tab.skill": "Skills",
"tab.user": "用户",
"tab.workspace": "工作区",
+ "toc.permalink": "本节的永久链接",
"user.accountType.organization": "组织",
"user.agents": "助理",
"user.cancel": "取消",
diff --git a/locales/zh-CN/eval.json b/locales/zh-CN/eval.json
index 94d8821f9bf..dde28209cb1 100644
--- a/locales/zh-CN/eval.json
+++ b/locales/zh-CN/eval.json
@@ -214,6 +214,8 @@
"evalMode.answer-relevance.desc": "使用 LLM 评估答案相关性(是或否)",
"evalMode.contains": "包含匹配",
"evalMode.contains.desc": "输出中必须包含期望的文本",
+ "evalMode.criteria.label": "评测提示词",
+ "evalMode.criteria.placeholder": "LLM 评判的提示词模板",
"evalMode.equals": "精确匹配",
"evalMode.equals.desc": "输出必须与期望内容完全一致",
"evalMode.external": "外部评估",
@@ -221,11 +223,17 @@
"evalMode.label": "评估模式",
"evalMode.llm-rubric": "LLM 评判",
"evalMode.llm-rubric.desc": "使用 LLM 评估输出质量",
+ "evalMode.model.label": "模型",
+ "evalMode.model.placeholder": "用于评测的 LLM 模型(如 gpt-4)",
"evalMode.placeholder": "选择评估模式",
"evalMode.prompt.label": "评判提示词",
"evalMode.prompt.placeholder": "输入 LLM 评判的评估标准或提示词",
+ "evalMode.provider.label": "服务商",
+ "evalMode.provider.placeholder": "LLM 服务商(如 openai、azure)",
"evalMode.rubric": "混合指标评分",
"evalMode.rubric.desc": "使用基准的加权指标进行混合评分",
+ "evalMode.systemRole.label": "系统提示词",
+ "evalMode.systemRole.placeholder": "LLM 评判的系统提示词(可选)",
"experiment.actions.create": "创建实验",
"experiment.actions.delete": "删除实验",
"experiment.actions.delete.confirm": "确定要删除此实验吗?其运行和作用域数据集将不再归组于此。",
diff --git a/locales/zh-CN/file.json b/locales/zh-CN/file.json
index f01d9198e5f..fd438c468f0 100644
--- a/locales/zh-CN/file.json
+++ b/locales/zh-CN/file.json
@@ -314,6 +314,7 @@
"pageList.copySuccess": "页面已复制",
"pageList.copyTitle": "复制页面",
"pageList.copyTo": "复制到…",
+ "pageList.createFailed": "创建页面失败",
"pageList.duplicate": "创建副本",
"pageList.empty": "还没有文稿。点击上方按钮创建第一篇",
"pageList.filter.all": "全部",
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index 5a2307240be..ab9230fbcb3 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -211,6 +211,14 @@ export default {
'goalProcess.deliverables.from': 'From “{{title}}”',
'goalProcess.deliverables.title': 'Deliverables',
'goalProcess.deliverables.untitled': 'Untitled',
+ 'taskCard.field.activities': 'Activities',
+ 'taskCard.field.dependencies': 'Dependencies',
+ 'taskCard.field.description': 'Description',
+ 'taskCard.field.instruction': 'Instruction',
+ 'taskCard.field.review': 'Review',
+ 'taskCard.field.reviewRubrics': 'Review rubrics',
+ 'taskCard.field.subtasks': 'Subtasks',
+ 'taskCard.field.workspace': 'Workspace',
'taskExecution.fixedTip': 'The execution environment is fixed in the Agent Profile.',
'taskExecution.followAgent': 'Follow the agent',
'taskExecution.followAgentDesc': "Use the assignee agent's execution environment",
@@ -1165,6 +1173,9 @@ export default {
'qoderInstallGuide.menuNotification.title': 'Qoder CLI not found',
'qoderInstallGuide.reason': 'LobeHub could not start Qoder: {{message}}',
'qoderInstallGuide.title': 'Install Qoder CLI',
+ 'quickChatSwitcher.empty': 'No agents found',
+ 'quickChatSwitcher.more': 'More agents',
+ 'quickChatSwitcher.searchPlaceholder': 'Search agents...',
'kimiCodeInstallGuide.actions.openDocs': 'Open Install Guide',
'kimiCodeInstallGuide.actions.openSystemTools': 'Open System Tools',
'kimiCodeInstallGuide.afterInstall':
@@ -3644,5 +3655,8 @@ export default {
'internalLink.preview.verifyStatus.uncertain': 'Uncertain',
'internalLink.preview.verifyStatus.unverified': 'Unverified',
'internalLink.preview.verifyStatus.verifying': 'Verifying',
+ 'userFeedbackCard.count_one': '{{count}} comment',
+ 'userFeedbackCard.count_other': '{{count}} comments',
+ 'userFeedbackCard.title': 'User feedback',
'you': 'You',
};
diff --git a/packages/locales/src/default/components.ts b/packages/locales/src/default/components.ts
index bc717b12065..e9d50de0f83 100644
--- a/packages/locales/src/default/components.ts
+++ b/packages/locales/src/default/components.ts
@@ -50,7 +50,10 @@ export default {
'FileManager.actions.deleteSuccess': 'File deleted successfully.',
'FileManager.actions.deleteAll': 'Delete All Items',
'FileManager.actions.deleteAllOwn': 'Delete All Items I Created',
+ 'FileManager.actions.downloadPageEmpty': 'Failed to download page: no content available',
+ 'FileManager.actions.downloadPageError': 'Failed to download page',
'FileManager.actions.downloading': 'Downloading file...',
+ 'FileManager.actions.folderNameRequired': 'Folder name cannot be empty',
'FileManager.actions.goBack': 'Go to previous page',
'FileManager.actions.goForward': 'Go to next page',
'FileManager.actions.goToParent': 'Go to parent folder',
diff --git a/packages/locales/src/default/discover.ts b/packages/locales/src/default/discover.ts
index d077b475a7f..c85c4517728 100644
--- a/packages/locales/src/default/discover.ts
+++ b/packages/locales/src/default/discover.ts
@@ -1127,6 +1127,8 @@ export default {
'skills.sorts.updatedAt': 'Recently Updated',
+ 'toc.permalink': 'Permalink for this section',
+
'tab.assistant': 'Agent',
'tab.home': 'Home',
diff --git a/packages/locales/src/default/eval.ts b/packages/locales/src/default/eval.ts
index c2a66bc775e..85bee5c3962 100644
--- a/packages/locales/src/default/eval.ts
+++ b/packages/locales/src/default/eval.ts
@@ -287,7 +287,15 @@ export default {
'Use LLM to evaluate output quality based on custom criteria (0.0 to 1.0)',
'evalMode.answer-relevance': 'LLM Relevance',
'evalMode.answer-relevance.desc': 'Use LLM to evaluate answer relevance (yes or no)',
+ 'evalMode.criteria.label': 'Eval Prompt',
+ 'evalMode.criteria.placeholder': 'Prompt template for the LLM judge',
+ 'evalMode.model.label': 'Model',
+ 'evalMode.model.placeholder': 'LLM model to use for evaluation (e.g. gpt-4)',
'evalMode.placeholder': 'Select eval mode',
+ 'evalMode.provider.label': 'Provider',
+ 'evalMode.provider.placeholder': 'LLM provider (e.g. openai, azure)',
+ 'evalMode.systemRole.label': 'System Prompt',
+ 'evalMode.systemRole.placeholder': 'Optional system prompt for the LLM judge',
'evalMode.prompt.label': 'Judge Prompt',
'evalMode.prompt.placeholder': 'Enter the evaluation criteria or prompt for LLM judge',
'evalMode.rubric': 'Rubric Scoring',
diff --git a/packages/locales/src/default/file.ts b/packages/locales/src/default/file.ts
index c5b7b0f997e..70635270495 100644
--- a/packages/locales/src/default/file.ts
+++ b/packages/locales/src/default/file.ts
@@ -349,6 +349,7 @@ export default {
'pageList.copySuccess': 'Page copied',
'pageList.copyTitle': 'Copy page',
'pageList.copyTo': 'Copy to…',
+ 'pageList.createFailed': 'Failed to create page',
'pageList.duplicate': 'Duplicate',
'pageList.empty': 'No pages yet. Click the button above to create your first one.',
'pageList.filter.all': 'All',
diff --git a/src/features/ChatInput/InputEditor/useMentionCategories.tsx b/src/features/ChatInput/InputEditor/useMentionCategories.tsx
index 578f3c28110..73204d84ac9 100644
--- a/src/features/ChatInput/InputEditor/useMentionCategories.tsx
+++ b/src/features/ChatInput/InputEditor/useMentionCategories.tsx
@@ -208,7 +208,7 @@ export const useMentionCategories = (): MentionCategory[] => {
const items = topics
.filter((t) => t.id !== activeTopicId)
.map((topic) => {
- const title = topic.title || 'Untitled';
+ const title = topic.title || t('topic.defaultTitle');
const label =
title.length > MAX_TOPIC_LABEL ? `${title.slice(0, MAX_TOPIC_LABEL)}...` : title;
return {
diff --git a/src/features/Conversation/Markdown/plugins/Task/Render.tsx b/src/features/Conversation/Markdown/plugins/Task/Render.tsx
index 10c48b6172b..b13f55bc02f 100644
--- a/src/features/Conversation/Markdown/plugins/Task/Render.tsx
+++ b/src/features/Conversation/Markdown/plugins/Task/Render.tsx
@@ -3,6 +3,7 @@ import { Text } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { ClipboardList } from 'lucide-react';
import { memo, useMemo } from 'react';
+import { useTranslation } from 'react-i18next';
import { type MarkdownElementProps } from '../type';
import { useTaskCardScope } from './context';
@@ -134,6 +135,7 @@ const Render = memo<TaskRenderProps>(({ children }) => {
const enabled = useTaskCardScope();
const text = typeof children === 'string' ? children : String(children ?? '');
const parsed = useMemo<ParsedTaskContent>(() => parseTaskContent(text), [text]);
+ const { t } = useTranslation('chat');
if (!enabled) {
return <pre className={styles.fallback}>{text}</pre>;
@@ -162,7 +164,7 @@ const Render = memo<TaskRenderProps>(({ children }) => {
<div className={styles.divider} />
<Flexbox gap={4}>
<Text fontSize={12} type={'secondary'}>
- Instruction
+ {t('taskCard.field.instruction')}
</Text>
<div className={styles.instruction}>{parsed.instruction}</div>
</Flexbox>
@@ -171,9 +173,9 @@ const Render = memo<TaskRenderProps>(({ children }) => {
{(parsed.description || parsed.dependencies || parsed.review) && (
<Flexbox gap={4}>
- <FieldRow label="Description" value={parsed.description} />
- <FieldRow label="Dependencies" value={parsed.dependencies} />
- <FieldRow label="Review" value={parsed.review} />
+ <FieldRow label={t('taskCard.field.description')} value={parsed.description} />
+ <FieldRow label={t('taskCard.field.dependencies')} value={parsed.dependencies} />
+ <FieldRow label={t('taskCard.field.review')} value={parsed.review} />
</Flexbox>
)}
@@ -182,10 +184,13 @@ const Render = memo<TaskRenderProps>(({ children }) => {
parsed.workspace?.length ||
parsed.reviewRubrics?.length) && (
<Flexbox gap={4}>
- <RawSection items={parsed.subtasks ?? []} label="Subtasks" />
- <RawSection items={parsed.activities ?? []} label="Activities" />
- <RawSection items={parsed.workspace ?? []} label="Workspace" />
- <RawSection items={parsed.reviewRubrics ?? []} label="Review rubrics" />
+ <RawSection items={parsed.subtasks ?? []} label={t('taskCard.field.subtasks')} />
+ <RawSection items={parsed.activities ?? []} label={t('taskCard.field.activities')} />
+ <RawSection items={parsed.workspace ?? []} label={t('taskCard.field.workspace')} />
+ <RawSection
+ items={parsed.reviewRubrics ?? []}
+ label={t('taskCard.field.reviewRubrics')}
+ />
</Flexbox>
)}
</Flexbox>
diff --git a/src/features/Conversation/Markdown/plugins/UserFeedback/Render.tsx b/src/features/Conversation/Markdown/plugins/UserFeedback/Render.tsx
index b5d214c8049..25a5e930c65 100644
--- a/src/features/Conversation/Markdown/plugins/UserFeedback/Render.tsx
+++ b/src/features/Conversation/Markdown/plugins/UserFeedback/Render.tsx
@@ -3,6 +3,7 @@ import { Text } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { MessageSquareText } from 'lucide-react';
import { memo, useMemo } from 'react';
+import { useTranslation } from 'react-i18next';
import { type MarkdownElementProps } from '../type';
import { type ParsedUserFeedbackComment, parseUserFeedback } from './parseUserFeedback';
@@ -82,10 +83,11 @@ Comment.displayName = 'UserFeedbackComment';
const Render = memo<MarkdownElementProps>(({ children }) => {
const text = typeof children === 'string' ? children : String(children ?? '');
const comments = useMemo(() => parseUserFeedback(text), [text]);
+ const { t } = useTranslation('chat');
if (comments.length === 0) return null;
- const countLabel = comments.length === 1 ? '1 comment' : `${comments.length} comments`;
+ const countLabel = t('userFeedbackCard.count', { count: comments.length });
return (
<details className={styles.root}>
@@ -96,7 +98,7 @@ const Render = memo<MarkdownElementProps>(({ children }) => {
</span>
<Flexbox horizontal align={'center'} flex={1} gap={8} style={{ minWidth: 0 }}>
<Text ellipsis weight={500}>
- User feedback
+ {t('userFeedbackCard.title')}
</Text>
<span className={styles.countBadge}>{countLabel}</span>
</Flexbox>
diff --git a/src/features/HomeSidebar/hooks/useCreateMenuItems.tsx b/src/features/HomeSidebar/hooks/useCreateMenuItems.tsx
index 4f518f009cd..0e42b9745b5 100644
--- a/src/features/HomeSidebar/hooks/useCreateMenuItems.tsx
+++ b/src/features/HomeSidebar/hooks/useCreateMenuItems.tsx
@@ -422,7 +422,7 @@ export const useCreateMenuItems = () => {
navigate(`/page/${newPageId}`);
} catch (error) {
console.error('Failed to create page:', error);
- toast.error('Failed to create page');
+ toast.error(tFile('pageList.createFailed'));
}
}, [canCreate, tFile, navigate, activeWorkspaceId]);
diff --git a/src/features/ResourceManager/components/Explorer/ItemDropdown/useFileItemDropdown.tsx b/src/features/ResourceManager/components/Explorer/ItemDropdown/useFileItemDropdown.tsx
index a304fd43bf2..05a5f35e535 100644
--- a/src/features/ResourceManager/components/Explorer/ItemDropdown/useFileItemDropdown.tsx
+++ b/src/features/ResourceManager/components/Explorer/ItemDropdown/useFileItemDropdown.tsx
@@ -408,11 +408,11 @@ export const useFileItemDropdown = ({
await downloadFile(blobUrl, mdFilename);
URL.revokeObjectURL(blobUrl);
} else {
- toast.error('Failed to download page: no content available');
+ toast.error(t('FileManager.actions.downloadPageEmpty'));
}
} catch (error) {
console.error('Failed to download page:', error);
- toast.error('Failed to download page');
+ toast.error(t('FileManager.actions.downloadPageError'));
}
} else {
// For regular files, download from URL
diff --git a/src/features/ResourceManager/components/LibraryHierarchy/HierarchyNode.tsx b/src/features/ResourceManager/components/LibraryHierarchy/HierarchyNode.tsx
index 51f00610053..525423e573c 100644
--- a/src/features/ResourceManager/components/LibraryHierarchy/HierarchyNode.tsx
+++ b/src/features/ResourceManager/components/LibraryHierarchy/HierarchyNode.tsx
@@ -103,7 +103,7 @@ export const HierarchyNode = memo<HierarchyNodeProps>(
const handleRenameConfirm = useCallback(async () => {
if (!renamingValue.trim()) {
- toast.error('Folder name cannot be empty');
+ toast.error(t('FileManager.actions.folderNameRequired', { ns: 'components' }));
return;
}
@@ -114,13 +114,13 @@ export const HierarchyNode = memo<HierarchyNodeProps>(
try {
await renameItem(item.id, parentKey, renamingValue.trim());
- toast.success('Renamed successfully');
+ toast.success(t('FileManager.actions.renameSuccess', { ns: 'components' }));
setIsRenaming(false);
} catch (error) {
console.error('Rename error:', error);
- toast.error('Rename failed');
+ toast.error(t('FileManager.actions.renameError', { ns: 'components' }));
}
- }, [item.id, item.name, parentKey, renamingValue, renameItem]);
+ }, [item.id, item.name, parentKey, renamingValue, renameItem, t]);
// A folder freshly created from the tree's per-folder "+" enters inline
// rename as soon as its row mounts (the parent was expanded/revalidated by
diff --git a/src/routes/(main)/community/(detail)/features/Toc/Heading.tsx b/src/routes/(main)/community/(detail)/features/Toc/Heading.tsx
index ed818bdb732..fb80cc0bbca 100644
--- a/src/routes/(main)/community/(detail)/features/Toc/Heading.tsx
+++ b/src/routes/(main)/community/(detail)/features/Toc/Heading.tsx
@@ -6,6 +6,7 @@ import { kebabCase } from 'es-toolkit/compat';
import { Heading2, Heading3, Heading4, Heading5 } from 'lucide-react';
import { type ComponentProps, type FC, type ReactNode } from 'react';
import { Children, isValidElement, useEffect, useMemo } from 'react';
+import { useTranslation } from 'react-i18next';
import { useToc } from './useToc';
@@ -50,6 +51,7 @@ const styles = createStaticStyles(({ cx, css, cssVar }) => ({
const createHeading = (Tag: `h${1 | 2 | 3 | 4 | 5 | 6}`) => {
const Heading: FC<ComponentProps<'h2'>> = ({ children, className, style, ...props }) => {
+ const { t } = useTranslation('discover');
const { setToc, setFinished } = useToc();
const text = useMemo(() => extractTextChildren(children), [children]);
const id = kebabCase(text);
@@ -85,7 +87,7 @@ const createHeading = (Tag: `h${1 | 2 | 3 | 4 | 5 | 6}`) => {
>
{children}
<a
- aria-label="Permalink for this section"
+ aria-label={t('toc.permalink')}
className={styles.anchor}
href={`#${id}`}
style={{ scrollMarginTop: 96 }}
diff --git a/src/routes/(main)/eval/features/DatasetEditModal/Content.tsx b/src/routes/(main)/eval/features/DatasetEditModal/Content.tsx
index fc050a06999..db80b96919d 100644
--- a/src/routes/(main)/eval/features/DatasetEditModal/Content.tsx
+++ b/src/routes/(main)/eval/features/DatasetEditModal/Content.tsx
@@ -204,17 +204,17 @@ const DatasetEditContent: FC<DatasetEditContentProps> = ({
{(evalModeValue === 'llm-rubric' || evalModeValue === 'answer-relevance') && (
<>
- <Form.Field label={'Provider'} name="evalConfig.provider">
- <TextArea placeholder={'LLM provider (e.g. openai, azure)'} rows={1} />
+ <Form.Field label={t('evalMode.provider.label')} name="evalConfig.provider">
+ <TextArea placeholder={t('evalMode.provider.placeholder')} rows={1} />
</Form.Field>
- <Form.Field label={'Model'} name="evalConfig.model">
- <TextArea placeholder={'LLM model to use for evaluation (e.g. gpt-4)'} rows={1} />
+ <Form.Field label={t('evalMode.model.label')} name="evalConfig.model">
+ <TextArea placeholder={t('evalMode.model.placeholder')} rows={1} />
</Form.Field>
- <Form.Field label={'System Prompt'} name="evalConfig.systemRole">
- <TextArea placeholder={'Optional system prompt for the LLM judge'} rows={3} />
+ <Form.Field label={t('evalMode.systemRole.label')} name="evalConfig.systemRole">
+ <TextArea placeholder={t('evalMode.systemRole.placeholder')} rows={3} />
</Form.Field>
- <Form.Field label={'Eval Prompt'} name="evalConfig.criteria">
- <TextArea placeholder={'Prompt template for the LLM judge'} rows={3} />
+ <Form.Field label={t('evalMode.criteria.label')} name="evalConfig.criteria">
+ <TextArea placeholder={t('evalMode.criteria.placeholder')} rows={3} />
</Form.Field>
<Form.Field label={t('evalMode.prompt.label')} name="evalConfig.judgePrompt">
<TextArea placeholder={t('evalMode.prompt.placeholder')} rows={3} />
diff --git a/src/routes/(main)/group/profile/features/Header/AgentBuilderToggle.tsx b/src/routes/(main)/group/profile/features/Header/AgentBuilderToggle.tsx
index d4f9c1be12e..bc382c64b1d 100644
--- a/src/routes/(main)/group/profile/features/Header/AgentBuilderToggle.tsx
+++ b/src/routes/(main)/group/profile/features/Header/AgentBuilderToggle.tsx
@@ -1,21 +1,23 @@
import { ActionIcon } from '@lobehub/ui/base-ui';
import { BotMessageSquareIcon } from 'lucide-react';
import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
import { useGroupProfileStore } from '@/store/groupProfile';
const AgentBuilderToggle = memo(() => {
+ const { t } = useTranslation('chat');
const chatPanelExpanded = useGroupProfileStore((s) => s.chatPanelExpanded);
const setChatPanelExpanded = useGroupProfileStore((s) => s.setChatPanelExpanded);
return (
<ActionIcon
active={chatPanelExpanded}
- aria-label="Agent Builder"
+ aria-label={t('agentBuilder.title')}
icon={BotMessageSquareIcon}
size={DESKTOP_HEADER_ICON_SIZE}
- title="Agent Builder"
+ title={t('agentBuilder.title')}
onClick={() => setChatPanelExpanded((prev) => !prev)}
/>
);
diff --git a/src/routes/(popup)/agent/[aid]/QuickChatAgentSwitcher.tsx b/src/routes/(popup)/agent/[aid]/QuickChatAgentSwitcher.tsx
index 6c824dbbbfd..9ef4ebd0b0f 100644
--- a/src/routes/(popup)/agent/[aid]/QuickChatAgentSwitcher.tsx
+++ b/src/routes/(popup)/agent/[aid]/QuickChatAgentSwitcher.tsx
@@ -8,6 +8,7 @@ import { createStaticStyles, cx } from 'antd-style';
import isEqual from 'fast-deep-equal';
import { MoreHorizontalIcon } from 'lucide-react';
import { memo, useMemo, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { useParams } from 'react-router';
import { DEFAULT_AVATAR, DEFAULT_INBOX_AVATAR } from '@/const/meta';
@@ -160,6 +161,7 @@ const QuickChatAgentSwitcher = memo(() => {
// so we trigger the agent list fetch ourselves.
useFetchAgentList();
+ const { t } = useTranslation('chat');
const navigate = useWorkspaceAwareNavigate();
const { aid } = useParams<{ aid: string }>();
const inboxAgentId = useAgentStore(builtinAgentSelectors.inboxAgentId);
@@ -221,14 +223,14 @@ const QuickChatAgentSwitcher = memo(() => {
<div className={styles.popoverContent}>
<Input
allowClear
- placeholder={'Search agents...'}
+ placeholder={t('quickChatSwitcher.searchPlaceholder')}
size={'small'}
value={search}
onChange={(e) => setSearch(e.target.value)}
/>
<div className={styles.popoverList} style={{ marginTop: 8 }}>
{filteredRemaining.length === 0 ? (
- <div className={styles.popoverEmpty}>No agents found</div>
+ <div className={styles.popoverEmpty}>{t('quickChatSwitcher.empty')}</div>
) : (
filteredRemaining.map((item) => (
<div
@@ -259,7 +261,7 @@ const QuickChatAgentSwitcher = memo(() => {
}
onOpenChange={setPopoverOpen}
>
- <button aria-label={'More agents'} className={styles.more} type={'button'}>
+ <button aria-label={t('quickChatSwitcher.more')} className={styles.more} type={'button'}>
<Icon icon={MoreHorizontalIcon} size={16} />
</button>
</Popover>