docs: translation docs

This commit is contained in:
Ibrahima G. Coulibaly
2025-07-14 18:54:31 +01:00
parent 4441f987d2
commit 88c096544c
4 changed files with 61 additions and 30 deletions

View File

@@ -43,7 +43,9 @@ const Navbar: React.FC<NavbarProps> = ({
};
const handleLanguageChange = (event: any) => {
i18n.changeLanguage(event.target.value);
const newLanguage = event.target.value;
i18n.changeLanguage(newLanguage);
localStorage.setItem('lang', newLanguage);
};
const navItems: { label: string; path: string }[] = [

View File

@@ -42,7 +42,7 @@ export type FullI18nKey = {
}[I18nNamespaces];
i18n.use(initReactI18next).init({
lng: 'en',
lng: localStorage.getItem('lang') || 'en',
fallbackLng: 'en',
debug: false,
backend: useLocize