瀏覽代碼

Added French language support (#9173)

### What problem does this PR solve?
Implemented French UI translation

### Type of change
- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: ramin cedric <>
Co-authored-by: Liu An <asiro@qq.com>
tags/v0.20.1
ramincedric 2 月之前
父節點
當前提交
6a0d6d2565
No account linked to committer's email address
共有 5 個文件被更改,包括 1279 次插入1 次删除
  1. 5
    1
      web/src/constants/common.ts
  2. 5
    0
      web/src/locales/config.ts
  3. 1261
    0
      web/src/locales/fr.ts
  4. 4
    0
      web/src/pages/agent/options.ts
  5. 4
    0
      web/src/pages/flow/constant.tsx

+ 5
- 1
web/src/constants/common.ts 查看文件

@@ -49,8 +49,8 @@ export const LanguageList = [
'Japanese',
'Portuguese BR',
'German',
'French',
];

export const LanguageMap = {
English: 'English',
Chinese: '简体中文',
@@ -61,6 +61,7 @@ export const LanguageMap = {
Japanese: '日本語',
'Portuguese BR': 'Português BR',
German: 'German',
French: 'Français',
};

export enum LanguageAbbreviation {
@@ -73,6 +74,7 @@ export enum LanguageAbbreviation {
Vi = 'vi',
PtBr = 'pt-BR',
De = 'de',
Fr = 'fr',
}

export const LanguageAbbreviationMap = {
@@ -85,6 +87,7 @@ export const LanguageAbbreviationMap = {
[LanguageAbbreviation.Ja]: '日本語',
[LanguageAbbreviation.PtBr]: 'Português BR',
[LanguageAbbreviation.De]: 'Deutsch',
[LanguageAbbreviation.Fr]: 'Français',
};

export const LanguageTranslationMap = {
@@ -97,6 +100,7 @@ export const LanguageTranslationMap = {
Japanese: 'ja',
'Portuguese BR': 'pt-br',
German: 'de',
French: 'fr',
};

export enum FileMimeType {

+ 5
- 0
web/src/locales/config.ts 查看文件

@@ -6,6 +6,7 @@ import { LanguageAbbreviation } from '@/constants/common';
import translation_de from './de';
import translation_en from './en';
import translation_es from './es';
import translation_fr from './fr';
import translation_id from './id';
import translation_ja from './ja';
import translation_pt_br from './pt-br';
@@ -24,6 +25,7 @@ const resources = {
[LanguageAbbreviation.Vi]: translation_vi,
[LanguageAbbreviation.PtBr]: translation_pt_br,
[LanguageAbbreviation.De]: translation_de,
[LanguageAbbreviation.Fr]: translation_fr,
};
const enFlattened = flattenObject(translation_en);
const viFlattened = flattenObject(translation_vi);
@@ -33,6 +35,7 @@ const jaFlattened = flattenObject(translation_ja);
const pt_brFlattened = flattenObject(translation_pt_br);
const zh_traditionalFlattened = flattenObject(translation_zh_traditional);
const deFlattened = flattenObject(translation_de);
const frFlattened = flattenObject(translation_fr);
export const translationTable = createTranslationTable(
[
enFlattened,
@@ -43,6 +46,7 @@ export const translationTable = createTranslationTable(
jaFlattened,
pt_brFlattened,
deFlattened,
frFlattened,
],
[
'English',
@@ -53,6 +57,7 @@ export const translationTable = createTranslationTable(
'ja',
'pt-BR',
'Deutsch',
'French',
],
);
i18n

+ 1261
- 0
web/src/locales/fr.ts
文件差異過大導致無法顯示
查看文件


+ 4
- 0
web/src/pages/agent/options.ts 查看文件

@@ -57,6 +57,10 @@ export const LanguageOptions = [
value: 'de',
label: 'Deutsch',
},
{
value: 'fr',
label: 'Français',
},
{
value: 'et',
label: 'Eesti',

+ 4
- 0
web/src/pages/flow/constant.tsx 查看文件

@@ -835,6 +835,10 @@ export const LanguageOptions = [
value: 'de',
label: 'Deutsch',
},
{
value: 'fr',
label: 'Français',
},
{
value: 'et',
label: 'Eesti',

Loading…
取消
儲存