fix: App switches back to default installation language when navigating to root

This commit is contained in:
Tom Moor
2023-09-07 22:48:19 -04:00
parent d8bfb0fe5d
commit 5c8bcc11b4
7 changed files with 117 additions and 77 deletions

View File

@@ -0,0 +1,17 @@
import * as React from "react";
import { useTranslation } from "react-i18next";
import { changeLanguage } from "~/utils/language";
type Props = {
locale: string;
};
export default function ChangeLanguage({ locale }: Props) {
const { i18n } = useTranslation();
React.useEffect(() => {
void changeLanguage(locale, i18n);
}, [locale, i18n]);
return null;
}