Skip to content

Commit de3cf98

Browse files
authored
Merge pull request #2268 from chokiproai/main
feat: Add Vietnamese language support
2 parents fe02e9a + cdb1c06 commit de3cf98

File tree

3 files changed

+2710
-1
lines changed

3 files changed

+2710
-1
lines changed

web/src/components/layout/headerbar/LanguageSelector.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ For commercial licensing, please contact support@quantumnous.com
2020
import React from 'react';
2121
import { Button, Dropdown } from '@douyinfe/semi-ui';
2222
import { Languages } from 'lucide-react';
23-
import { CN, GB, FR, RU, JP } from 'country-flag-icons/react/3x2';
23+
import { CN, GB, FR, RU, JP, VN } from 'country-flag-icons/react/3x2';
2424

2525
const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
2626
return (
@@ -65,6 +65,13 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
6565
<RU title='Русский' className='!w-5 !h-auto' />
6666
<span>Русский</span>
6767
</Dropdown.Item>
68+
<Dropdown.Item
69+
onClick={() => onLanguageChange('vi')}
70+
className={`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'vi' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`}
71+
>
72+
<VN title='Tiếng Việt' className='!w-5 !h-auto' />
73+
<span>Tiếng Việt</span>
74+
</Dropdown.Item>
6875
</Dropdown.Menu>
6976
}
7077
>

web/src/i18n/i18n.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import frTranslation from './locales/fr.json';
2626
import zhTranslation from './locales/zh.json';
2727
import ruTranslation from './locales/ru.json';
2828
import jaTranslation from './locales/ja.json';
29+
import viTranslation from './locales/vi.json';
2930

3031
i18n
3132
.use(LanguageDetector)
@@ -38,6 +39,7 @@ i18n
3839
fr: frTranslation,
3940
ru: ruTranslation,
4041
ja: jaTranslation,
42+
vi: viTranslation,
4143
},
4244
fallbackLng: 'zh',
4345
interpolation: {

0 commit comments

Comments
 (0)