From a54e28d353c3f70a85ac2d7c1363e50ac0f39cd4 Mon Sep 17 00:00:00 2001 From: Donkie Date: Sat, 15 Jul 2023 11:01:25 +0200 Subject: [PATCH] Client: Fixed fallback language --- client/src/components/header/index.tsx | 4 +--- client/src/i18n.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/src/components/header/index.tsx b/client/src/components/header/index.tsx index a74fe5c..e57c734 100644 --- a/client/src/components/header/index.tsx +++ b/client/src/components/header/index.tsx @@ -11,7 +11,6 @@ import { theme, } from "antd"; import React, { useContext } from "react"; -import { useTranslation } from "react-i18next"; import { ColorModeContext } from "../../contexts/color-mode"; import "/node_modules/flag-icons/css/flag-icons.min.css"; @@ -23,14 +22,13 @@ export const Header: React.FC = ({ sticky, }) => { const { token } = useToken(); - const { i18n } = useTranslation(); const locale = useGetLocale(); const changeLanguage = useSetLocale(); const { mode, setMode } = useContext(ColorModeContext); const currentLocale = locale(); - const menuItems: MenuProps["items"] = [...(i18n.languages || [])] + const menuItems: MenuProps["items"] = [...(Object.keys(languages) || [])] .sort() .map((lang: string) => ({ key: lang, diff --git a/client/src/i18n.ts b/client/src/i18n.ts index 9fdfcf4..fd6c641 100644 --- a/client/src/i18n.ts +++ b/client/src/i18n.ts @@ -37,7 +37,7 @@ i18n loadPath: "/locales/{{lng}}/{{ns}}.json", }, defaultNS: "common", - fallbackLng: Object.keys(languages), + fallbackLng: "en", }); export default i18n;