@@ -65,7 +67,7 @@ const RoleList = () => {
onChange={(e) => {
setSearchName(e.target.value);
}}
- placeholder="搜索"
+ placeholder={t('search')}
shortKey="f"
spotlight
type={'block'}
@@ -93,7 +95,7 @@ const RoleList = () => {
items={[
{
children:
,
- label: '角色列表',
+ label: t('roleList'),
key: 'default',
},
]}
diff --git a/src/features/SessionList/Elsa/index.tsx b/src/features/SessionList/Elsa/index.tsx
index 379743c8..17412c6a 100644
--- a/src/features/SessionList/Elsa/index.tsx
+++ b/src/features/SessionList/Elsa/index.tsx
@@ -1,5 +1,6 @@
import { Space, Tag } from 'antd';
import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
import { LOBE_VIDOL_DEFAULT_AGENT_ID } from '@/constants/agent';
import useSessionContext from '@/hooks/useSessionContext';
@@ -8,6 +9,7 @@ import { useAgentStore } from '@/store/agent';
import ListItem from '../ListItem';
const Elsa = memo(() => {
+ const { t } = useTranslation('common');
const defaultAgent = useAgentStore((s) => s.defaultAgent);
const { activeSessionId, switchSession } = useSessionContext();
@@ -19,7 +21,7 @@ const Elsa = memo(() => {
title={
{defaultAgent.meta.name}
- 默认助手
+ {t('defaultAssistant')}
}
description={defaultAgent.greeting || defaultAgent.meta.description || ''}
diff --git a/src/features/SessionList/List/Item/Actions.tsx b/src/features/SessionList/List/Item/Actions.tsx
index 2d6a5b98..e6a652d3 100644
--- a/src/features/SessionList/List/Item/Actions.tsx
+++ b/src/features/SessionList/List/Item/Actions.tsx
@@ -1,6 +1,7 @@
import { ActionIcon } from '@lobehub/ui';
import { App, Dropdown, MenuProps } from 'antd';
import { MoreVertical, Trash2 } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
import { useSessionStore } from '@/store/session';
@@ -12,6 +13,7 @@ interface ActionsProps {
export default (props: ActionsProps) => {
const { id, setOpen } = props;
const { modal } = App.useApp();
+ const { t } = useTranslation('common');
const [removeSession] = useSessionStore((s) => [s.removeSession]);
const items: MenuProps['items'] = [
@@ -19,7 +21,7 @@ export default (props: ActionsProps) => {
danger: true,
icon:
,
key: 'delete',
- label: '删除会话',
+ label: t('delSession'),
onClick: ({ domEvent }) => {
domEvent.stopPropagation();
modal.confirm({
@@ -28,9 +30,9 @@ export default (props: ActionsProps) => {
onOk: () => {
removeSession(id);
},
- okText: '删除',
- cancelText: '取消',
- title: '确认删除对话吗?删除后无法恢复, 请谨慎操作!',
+ okText: t('actions.del'),
+ cancelText: t('cancel'),
+ title: t('delSessionAlert'),
});
},
},
diff --git a/src/features/SessionList/index.tsx b/src/features/SessionList/index.tsx
index e009fdc6..01278211 100644
--- a/src/features/SessionList/index.tsx
+++ b/src/features/SessionList/index.tsx
@@ -1,6 +1,7 @@
import { SearchBar } from '@lobehub/ui';
import { createStyles } from 'antd-style';
import React, { useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';
import { HEADER_HEIGHT } from '@/constants/token';
@@ -45,7 +46,7 @@ const useStyles = createStyles(({ css, token, prefixCls }) => ({
const SideBar = () => {
const { styles } = useStyles();
const [searchName, setSearchName] = useState
();
-
+ const { t } = useTranslation('common');
return (
<>
{
onChange={(e) => {
setSearchName(e.target.value);
}}
- placeholder="搜索"
+ placeholder={t('search')}
shortKey="f"
spotlight
type={'block'}
diff --git a/src/features/Settings/common.tsx b/src/features/Settings/common.tsx
index 4ce5afeb..981f31f4 100644
--- a/src/features/Settings/common.tsx
+++ b/src/features/Settings/common.tsx
@@ -3,10 +3,12 @@ import { createStyles } from 'antd-style';
import classNames from 'classnames';
import { Monitor, Settings2, User2Icon } from 'lucide-react';
import React from 'react';
+import { useTranslation } from 'react-i18next';
import ClearSession from '@/features/Actions/ClearSession';
import ResetConfig from '@/features/Actions/ResetConfig';
import BackgroundEffect from '@/features/Settings/features/BackgroundEffect';
+import LanguageSetting from '@/features/Settings/features/LanguageSetting';
import NickName from '@/features/Settings/features/NickName';
import ThemeSwatchesNetural from '@/features/Settings/features/ThemeSwatchesNetural';
import ThemeSwatchesPrimary from '@/features/Settings/features/ThemeSwatchesPrimary';
@@ -33,46 +35,65 @@ const useStyles = createStyles(({ css }) => ({
const CommonConfig = (props: CommonConfigProps) => {
const { style, className } = props;
const { styles } = useStyles();
-
+ const { t } = useTranslation('common');
+ t('words.');
return (