diff --git a/web/bun.lock b/web/bun.lock index f9a60229..e3b293cb 100644 --- a/web/bun.lock +++ b/web/bun.lock @@ -1,6 +1,5 @@ { "lockfileVersion": 1, - "configVersion": 0, "workspaces": { "": { "name": "react-template", @@ -13,7 +12,6 @@ "@visactor/vchart-semi-theme": "~1.8.8", "axios": "1.12.0", "clsx": "^2.1.1", - "country-flag-icons": "^1.5.19", "dayjs": "^1.11.11", "history": "^5.3.0", "i18next": "^23.16.8", @@ -884,8 +882,6 @@ "cosmiconfig": ["cosmiconfig@7.1.0", "", { "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", "parse-json": "^5.0.0", "path-type": "^4.0.0", "yaml": "^1.10.0" } }, "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA=="], - "country-flag-icons": ["country-flag-icons@1.5.19", "", {}, "sha512-D/ZkRyj+ywJC6b2IrAN3/tpbReMUqmuRLlcKFoY/o0+EPQN9Ev/e8tV+D3+9scvu/tarxwLErNwS73C3yzxs/g=="], - "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], "cssesc": ["cssesc@3.0.0", "", { "bin": { "cssesc": "bin/cssesc" } }, "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="], diff --git a/web/package.json b/web/package.json index 9ac8e266..4d8c7e7f 100644 --- a/web/package.json +++ b/web/package.json @@ -12,7 +12,6 @@ "@visactor/vchart-semi-theme": "~1.8.8", "axios": "1.12.0", "clsx": "^2.1.1", - "country-flag-icons": "^1.5.19", "dayjs": "^1.11.11", "history": "^5.3.0", "i18next": "^23.16.8", diff --git a/web/src/components/layout/headerbar/LanguageSelector.jsx b/web/src/components/layout/headerbar/LanguageSelector.jsx index fdcc0d6a..85e9945a 100644 --- a/web/src/components/layout/headerbar/LanguageSelector.jsx +++ b/web/src/components/layout/headerbar/LanguageSelector.jsx @@ -20,7 +20,6 @@ For commercial licensing, please contact support@quantumnous.com import React from 'react'; import { Button, Dropdown } from '@douyinfe/semi-ui'; import { Languages } from 'lucide-react'; -import { CN, GB, FR, RU, JP, VN } from 'country-flag-icons/react/3x2'; const LanguageSelector = ({ currentLang, onLanguageChange, t }) => { return ( @@ -31,46 +30,39 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => { {/* Language sorting: Order by English name (Chinese, English, French, Japanese, Russian) */} onLanguageChange('zh')} - className={`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'zh' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`} + className={`!px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'zh' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`} > - - 中文 + 中文 onLanguageChange('en')} - className={`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'en' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`} + className={`!px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'en' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`} > - - English + English onLanguageChange('fr')} - className={`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'fr' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`} + className={`!px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'fr' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`} > - - Français + Français onLanguageChange('ja')} - className={`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'ja' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`} + className={`!px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'ja' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`} > - {/* Japanese flag using emoji as country-flag-icons/react/3x2 does not export JP */} - - 日本語 + 日本語 onLanguageChange('ru')} - className={`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'ru' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`} + className={`!px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'ru' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`} > - - Русский + Русский onLanguageChange('vi')} - 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'}`} + className={`!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'}`} > - - Tiếng Việt + Tiếng Việt } diff --git a/web/src/components/settings/personal/cards/PreferencesSettings.jsx b/web/src/components/settings/personal/cards/PreferencesSettings.jsx index 6417061f..10a47454 100644 --- a/web/src/components/settings/personal/cards/PreferencesSettings.jsx +++ b/web/src/components/settings/personal/cards/PreferencesSettings.jsx @@ -24,14 +24,14 @@ import { useTranslation } from 'react-i18next'; import { API, showSuccess, showError } from '../../../../helpers'; import { UserContext } from '../../../../context/User'; -// Language options with native names and flags +// Language options with native names const languageOptions = [ - { value: 'zh', label: '中文', flag: '🇨🇳' }, - { value: 'en', label: 'English', flag: '🇺🇸' }, - { value: 'fr', label: 'Français', flag: '🇫🇷' }, - { value: 'ru', label: 'Русский', flag: '🇷🇺' }, - { value: 'ja', label: '日本語', flag: '🇯🇵' }, - { value: 'vi', label: 'Tiếng Việt', flag: '🇻🇳' }, + { value: 'zh', label: '中文' }, + { value: 'en', label: 'English' }, + { value: 'fr', label: 'Français' }, + { value: 'ru', label: 'Русский' }, + { value: 'ja', label: '日本語' }, + { value: 'vi', label: 'Tiếng Việt' }, ]; const PreferencesSettings = ({ t }) => { @@ -151,24 +151,8 @@ const PreferencesSettings = ({ t }) => { loading={loading} optionList={languageOptions.map((opt) => ({ value: opt.value, - label: ( -
- {opt.flag} - {opt.label} -
- ), + label: opt.label, }))} - renderSelectedItem={(optionNode) => { - const selected = languageOptions.find( - (opt) => opt.value === optionNode.value, - ); - return ( -
- {selected?.flag} - {selected?.label} -
- ); - }} />