Remove country code flags in language selector
This commit is contained in:
6
client/package-lock.json
generated
6
client/package-lock.json
generated
@@ -23,7 +23,6 @@
|
|||||||
"@yudiel/react-qr-scanner": "^1.2.10",
|
"@yudiel/react-qr-scanner": "^1.2.10",
|
||||||
"antd": "^5.24.3",
|
"antd": "^5.24.3",
|
||||||
"axios": "^1.8.3",
|
"axios": "^1.8.3",
|
||||||
"flag-icons": "^7.3.2",
|
|
||||||
"html-to-image": "^1.11.13",
|
"html-to-image": "^1.11.13",
|
||||||
"i18next": "^24.2.3",
|
"i18next": "^24.2.3",
|
||||||
"i18next-browser-languagedetector": "^8.0.4",
|
"i18next-browser-languagedetector": "^8.0.4",
|
||||||
@@ -5330,11 +5329,6 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/flag-icons": {
|
|
||||||
"version": "7.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/flag-icons/-/flag-icons-7.3.2.tgz",
|
|
||||||
"integrity": "sha512-QkaZ6Zvai8LIjx+UNAHUJ5Dhz9OLZpBDwCRWxF6YErxIcR16jTkIFm3bFu54EkvKQy4+wicW+Gm7/0631wVQyQ=="
|
|
||||||
},
|
|
||||||
"node_modules/flat-cache": {
|
"node_modules/flat-cache": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
"@yudiel/react-qr-scanner": "^1.2.10",
|
"@yudiel/react-qr-scanner": "^1.2.10",
|
||||||
"antd": "^5.24.3",
|
"antd": "^5.24.3",
|
||||||
"axios": "^1.8.3",
|
"axios": "^1.8.3",
|
||||||
"flag-icons": "^7.3.2",
|
|
||||||
"html-to-image": "^1.11.13",
|
"html-to-image": "^1.11.13",
|
||||||
"i18next": "^24.2.3",
|
"i18next": "^24.2.3",
|
||||||
"i18next-browser-languagedetector": "^8.0.4",
|
"i18next-browser-languagedetector": "^8.0.4",
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { ColorModeContext } from "../../contexts/color-mode";
|
|||||||
|
|
||||||
import { languages } from "../../i18n";
|
import { languages } from "../../i18n";
|
||||||
import QRCodeScannerModal from "../qrCodeScanner";
|
import QRCodeScannerModal from "../qrCodeScanner";
|
||||||
import "/node_modules/flag-icons/css/flag-icons.min.css";
|
|
||||||
|
|
||||||
const { useToken } = theme;
|
const { useToken } = theme;
|
||||||
|
|
||||||
@@ -22,7 +21,6 @@ export const Header: React.FC<RefineThemedLayoutV2HeaderProps> = ({ sticky }) =>
|
|||||||
const menuItems: MenuProps["items"] = [...(Object.keys(languages) || [])].sort().map((lang: string) => ({
|
const menuItems: MenuProps["items"] = [...(Object.keys(languages) || [])].sort().map((lang: string) => ({
|
||||||
key: lang,
|
key: lang,
|
||||||
onClick: () => changeLanguage(lang),
|
onClick: () => changeLanguage(lang),
|
||||||
icon: <span className={"fi fi-" + languages[lang].countryCode} style={{ marginRight: 8 }} />,
|
|
||||||
label: languages[lang].name,
|
label: languages[lang].name,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -52,7 +50,6 @@ export const Header: React.FC<RefineThemedLayoutV2HeaderProps> = ({ sticky }) =>
|
|||||||
>
|
>
|
||||||
<Button type="text">
|
<Button type="text">
|
||||||
<Space>
|
<Space>
|
||||||
<span className={"fi fi-" + languages[currentLocale ?? "en"].countryCode} />
|
|
||||||
{languages[currentLocale ?? "en"].name}
|
{languages[currentLocale ?? "en"].name}
|
||||||
<DownOutlined />
|
<DownOutlined />
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { getBasePath } from "./utils/url";
|
|||||||
|
|
||||||
interface Language {
|
interface Language {
|
||||||
name: string;
|
name: string;
|
||||||
countryCode: string;
|
|
||||||
fullCode: string;
|
fullCode: string;
|
||||||
djs: () => Promise<ILocale>;
|
djs: () => Promise<ILocale>;
|
||||||
}
|
}
|
||||||
@@ -16,128 +15,107 @@ interface Language {
|
|||||||
* List of languages to load
|
* List of languages to load
|
||||||
* The key of each object is the folder name in the locales dir.
|
* The key of each object is the folder name in the locales dir.
|
||||||
* name: Name of the language in the list
|
* name: Name of the language in the list
|
||||||
* countryCode: Country code of the country's flag to display for this language
|
|
||||||
* fullCode: Full language code, used for Ant Design's locale
|
* fullCode: Full language code, used for Ant Design's locale
|
||||||
* djs: Function to load the dayjs locale, see https://github.com/iamkun/dayjs/tree/dev/src/locale for list of locales
|
* djs: Function to load the dayjs locale, see https://github.com/iamkun/dayjs/tree/dev/src/locale for list of locales
|
||||||
*/
|
*/
|
||||||
export const languages: { [key: string]: Language } = {
|
export const languages: { [key: string]: Language } = {
|
||||||
["en"]: {
|
["en"]: {
|
||||||
name: "English",
|
name: "English",
|
||||||
countryCode: "gb",
|
|
||||||
fullCode: "en-GB",
|
fullCode: "en-GB",
|
||||||
djs: () => import("dayjs/locale/en"),
|
djs: () => import("dayjs/locale/en"),
|
||||||
},
|
},
|
||||||
["sv"]: {
|
["sv"]: {
|
||||||
name: "Svenska",
|
name: "Svenska",
|
||||||
countryCode: "se",
|
|
||||||
fullCode: "sv-SE",
|
fullCode: "sv-SE",
|
||||||
djs: () => import("dayjs/locale/sv"),
|
djs: () => import("dayjs/locale/sv"),
|
||||||
},
|
},
|
||||||
["de"]: {
|
["de"]: {
|
||||||
name: "Deutsch",
|
name: "Deutsch",
|
||||||
countryCode: "de",
|
|
||||||
fullCode: "de-DE",
|
fullCode: "de-DE",
|
||||||
djs: () => import("dayjs/locale/de"),
|
djs: () => import("dayjs/locale/de"),
|
||||||
},
|
},
|
||||||
["es"]: {
|
["es"]: {
|
||||||
name: "Español",
|
name: "Español",
|
||||||
countryCode: "es",
|
|
||||||
fullCode: "es-ES",
|
fullCode: "es-ES",
|
||||||
djs: () => import("dayjs/locale/es"),
|
djs: () => import("dayjs/locale/es"),
|
||||||
},
|
},
|
||||||
["zh"]: {
|
["zh"]: {
|
||||||
name: "简体中文",
|
name: "简体中文",
|
||||||
countryCode: "cn",
|
|
||||||
fullCode: "zh-CN",
|
fullCode: "zh-CN",
|
||||||
djs: () => import("dayjs/locale/zh-cn"),
|
djs: () => import("dayjs/locale/zh-cn"),
|
||||||
},
|
},
|
||||||
["zh-Hant"]: {
|
["zh-Hant"]: {
|
||||||
name: "繁體中文",
|
name: "繁體中文",
|
||||||
countryCode: "cn",
|
|
||||||
fullCode: "zh-TW",
|
fullCode: "zh-TW",
|
||||||
djs: () => import("dayjs/locale/zh-hk"),
|
djs: () => import("dayjs/locale/zh-hk"),
|
||||||
},
|
},
|
||||||
["pl"]: {
|
["pl"]: {
|
||||||
name: "Polski",
|
name: "Polski",
|
||||||
countryCode: "pl",
|
|
||||||
fullCode: "pl-PL",
|
fullCode: "pl-PL",
|
||||||
djs: () => import("dayjs/locale/pl"),
|
djs: () => import("dayjs/locale/pl"),
|
||||||
},
|
},
|
||||||
["ru"]: {
|
["ru"]: {
|
||||||
name: "Русский",
|
name: "Русский",
|
||||||
countryCode: "ru",
|
|
||||||
fullCode: "ru-RU",
|
fullCode: "ru-RU",
|
||||||
djs: () => import("dayjs/locale/ru"),
|
djs: () => import("dayjs/locale/ru"),
|
||||||
},
|
},
|
||||||
["cs"]: {
|
["cs"]: {
|
||||||
name: "Česky",
|
name: "Česky",
|
||||||
countryCode: "cz",
|
|
||||||
fullCode: "cs-CZ",
|
fullCode: "cs-CZ",
|
||||||
djs: () => import("dayjs/locale/cs"),
|
djs: () => import("dayjs/locale/cs"),
|
||||||
},
|
},
|
||||||
["nb-NO"]: {
|
["nb-NO"]: {
|
||||||
name: "Norsk bokmål",
|
name: "Norsk bokmål",
|
||||||
countryCode: "no",
|
|
||||||
fullCode: "nb-NO",
|
fullCode: "nb-NO",
|
||||||
djs: () => import("dayjs/locale/nb"),
|
djs: () => import("dayjs/locale/nb"),
|
||||||
},
|
},
|
||||||
["nl"]: {
|
["nl"]: {
|
||||||
name: "Nederlands",
|
name: "Nederlands",
|
||||||
countryCode: "nl",
|
|
||||||
fullCode: "nl-NL",
|
fullCode: "nl-NL",
|
||||||
djs: () => import("dayjs/locale/nl"),
|
djs: () => import("dayjs/locale/nl"),
|
||||||
},
|
},
|
||||||
["fr"]: {
|
["fr"]: {
|
||||||
name: "Français",
|
name: "Français",
|
||||||
countryCode: "fr",
|
|
||||||
fullCode: "fr-FR",
|
fullCode: "fr-FR",
|
||||||
djs: () => import("dayjs/locale/fr"),
|
djs: () => import("dayjs/locale/fr"),
|
||||||
},
|
},
|
||||||
["hu"]: {
|
["hu"]: {
|
||||||
name: "Magyar",
|
name: "Magyar",
|
||||||
countryCode: "hu",
|
|
||||||
fullCode: "hu-HU",
|
fullCode: "hu-HU",
|
||||||
djs: () => import("dayjs/locale/hu"),
|
djs: () => import("dayjs/locale/hu"),
|
||||||
},
|
},
|
||||||
["it"]: {
|
["it"]: {
|
||||||
name: "Italiano",
|
name: "Italiano",
|
||||||
countryCode: "it",
|
|
||||||
fullCode: "it-IT",
|
fullCode: "it-IT",
|
||||||
djs: () => import("dayjs/locale/it"),
|
djs: () => import("dayjs/locale/it"),
|
||||||
},
|
},
|
||||||
["uk"]: {
|
["uk"]: {
|
||||||
name: "Українська",
|
name: "Українська",
|
||||||
countryCode: "ua",
|
|
||||||
fullCode: "uk-UA",
|
fullCode: "uk-UA",
|
||||||
djs: () => import("dayjs/locale/uk"),
|
djs: () => import("dayjs/locale/uk"),
|
||||||
},
|
},
|
||||||
["el"]: {
|
["el"]: {
|
||||||
name: "Ελληνικά",
|
name: "Ελληνικά",
|
||||||
countryCode: "gr",
|
|
||||||
fullCode: "el-GR",
|
fullCode: "el-GR",
|
||||||
djs: () => import("dayjs/locale/el"),
|
djs: () => import("dayjs/locale/el"),
|
||||||
},
|
},
|
||||||
["da"]: {
|
["da"]: {
|
||||||
name: "Dansk",
|
name: "Dansk",
|
||||||
countryCode: "dk",
|
|
||||||
fullCode: "da-DK",
|
fullCode: "da-DK",
|
||||||
djs: () => import("dayjs/locale/da"),
|
djs: () => import("dayjs/locale/da"),
|
||||||
},
|
},
|
||||||
["pt"]: {
|
["pt"]: {
|
||||||
name: "Português",
|
name: "Português",
|
||||||
countryCode: "pt",
|
|
||||||
fullCode: "pt-PT",
|
fullCode: "pt-PT",
|
||||||
djs: () => import("dayjs/locale/pt"),
|
djs: () => import("dayjs/locale/pt"),
|
||||||
},
|
},
|
||||||
["fa"]: {
|
["fa"]: {
|
||||||
name: "فارسی",
|
name: "فارسی",
|
||||||
countryCode: "ir",
|
|
||||||
fullCode: "fa-IR",
|
fullCode: "fa-IR",
|
||||||
djs: () => import("dayjs/locale/fa"),
|
djs: () => import("dayjs/locale/fa"),
|
||||||
},
|
},
|
||||||
["ro"]: {
|
["ro"]: {
|
||||||
name: "Român",
|
name: "Român",
|
||||||
countryCode: "ro",
|
|
||||||
fullCode: "ro-RO",
|
fullCode: "ro-RO",
|
||||||
djs: () => import("dayjs/locale/ro"),
|
djs: () => import("dayjs/locale/ro"),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user