Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vietnamese language support on web #3549

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions web/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { App, ConfigProvider, ConfigProviderProps } from 'antd';
import enUS from 'antd/locale/en_US';
import vi_VN from 'antd/locale/vi_VN';
import zhCN from 'antd/locale/zh_CN';
import zh_HK from 'antd/locale/zh_HK';
import dayjs from 'dayjs';
Expand All @@ -27,6 +28,7 @@ const AntLanguageMap = {
en: enUS,
zh: zhCN,
'zh-TRADITIONAL': zh_HK,
vi: vi_VN,
};

const queryClient = new QueryClient();
Expand Down
3 changes: 3 additions & 0 deletions web/src/constants/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const LanguageList = [
'Traditional Chinese',
'Indonesia',
'Spanish',
'Vietnamese',
];

export const LanguageMap = {
Expand All @@ -53,6 +54,7 @@ export const LanguageMap = {
'Traditional Chinese': '繁體中文',
Indonesia: 'Indonesia',
Spanish: 'Español',
Vietnamese: 'Tiếng việt',
};

export const LanguageTranslationMap = {
Expand All @@ -61,6 +63,7 @@ export const LanguageTranslationMap = {
'Traditional Chinese': 'zh-TRADITIONAL',
Indonesia: 'id',
Spanish: 'es',
Vietnamese: 'vi',
};

export const FileMimeTypeMap = {
Expand Down
5 changes: 4 additions & 1 deletion web/src/locales/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ import { initReactI18next } from 'react-i18next';
import translation_en from './en';
import translation_es from './es';
import translation_id from './id';
import translation_vi from './vi';
import translation_zh from './zh';
import translation_zh_traditional from './zh-traditional';

const resources = {
en: translation_en,
zh: translation_zh,
'zh-TRADITIONAL': translation_zh_traditional,
id: translation_id,
es: translation_es,
vi: translation_vi,
};

i18n
Expand All @@ -22,7 +25,7 @@ i18n
detection: {
lookupLocalStorage: 'lng',
},
supportedLngs: ['en', 'zh', 'zh-TRADITIONAL', 'id', 'es'],
supportedLngs: ['en', 'zh', 'zh-TRADITIONAL', 'id', 'es', 'vi'],
resources,
fallbackLng: 'en',
interpolation: {
Expand Down
5 changes: 3 additions & 2 deletions web/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ export default {
'Conduct a retrieval test to check if RAGFlow can recover the intended content for the LLM.',
similarityThreshold: 'Similarity threshold',
similarityThresholdTip:
"RAGFlow employs either a combination of weighted keyword similarity and weighted vector cosine similarity, or a combination of weighted keyword similarity and weighted reranking score during retrieval. This parameter sets the threshold for similarities between the user query and chunks. Any chunk with a similarity score below this threshold will be excluded from the results.",
'RAGFlow employs either a combination of weighted keyword similarity and weighted vector cosine similarity, or a combination of weighted keyword similarity and weighted reranking score during retrieval. This parameter sets the threshold for similarities between the user query and chunks. Any chunk with a similarity score below this threshold will be excluded from the results.',
vectorSimilarityWeight: 'Keywords similarity weight',
vectorSimilarityWeightTip:
"This sets the weight of keyword similarity in the combined similarity score, either used with vector cosine similarity or with reranking score. The total of the two weights must equal 1.0.",
'This sets the weight of keyword similarity in the combined similarity score, either used with vector cosine similarity or with reranking score. The total of the two weights must equal 1.0.',
testText: 'Test text',
testTextPlaceholder: 'Input your question here!',
testingLabel: 'Testing',
Expand Down Expand Up @@ -439,6 +439,7 @@ The above is the content you need to summarize.`,
multiTurnTip:
'In multi-round conversations, the query to the knowledge base is optimized. The large model will be called to consume additional tokens.',
howUseId: 'How to use chat ID?',
description: 'Description of assistant',
},
setting: {
profile: 'Profile',
Expand Down
1,046 changes: 1,046 additions & 0 deletions web/src/locales/vi.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions web/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ export default {
multiTurnTip:
'在多轮对话的中,对去知识库查询的问题进行优化。会调用大模型额外消耗token。',
howUseId: '如何使用聊天ID?',
description: '助理描述',
},
setting: {
profile: '概要',
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/404.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const NoFoundPage = () => {
<Result
status="404"
title="404"
subTitle="页面未找到,请输入正确的地址。"
subTitle="Page not found, please enter a correct address."
extra={
<Button type="primary" onClick={() => history.push('/')}>
返回主页
Business
</Button>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ const AssistantSetting = ({ show, form }: ISegmentedContentProps) => {
>
<Input placeholder={t('namePlaceholder')} />
</Form.Item>
<Form.Item name={'description'} label={t('description')}>
<Input placeholder={t('descriptionPlaceholder')} />
</Form.Item>
<Form.Item
name="icon"
label={t('assistantAvatar')}
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Login = () => {

if (title === 'login') {
const code = await login({
email: params.email,
email: `${params.email}`.trim(),
password: rsaPassWord,
});
if (code === 0) {
Expand Down