chore(i18n): update zu-ZA translations

This commit is contained in:
Amruth Pillai
2023-11-10 11:22:19 +01:00
parent 1057d390da
commit f3ad994753
19 changed files with 1666 additions and 135 deletions

View File

@ -1,27 +1,34 @@
import "@/client/libs/dayjs";
import { i18n } from "@lingui/core";
import { detect, fromNavigator, fromStorage, fromUrl } from "@lingui/detect-locale";
import { detect, fromNavigator, fromUrl } from "@lingui/detect-locale";
import { I18nProvider } from "@lingui/react";
import get from "lodash.get";
import { useEffect } from "react";
import { defaultLocale, dynamicActivate } from "../libs/lingui";
import { useAuthStore } from "../stores/auth";
import { useResumeStore } from "../stores/resume";
type Props = {
children: React.ReactNode;
};
export const LocaleProvider = ({ children }: Props) => {
const userLocale = useAuthStore((state) => get(state.user, "locale", null));
const resumeLocale = useResumeStore((state) => get(state.resume, "data.metadata.locale", null));
useEffect(() => {
const detectedLocale = detect(
resumeLocale,
userLocale,
fromUrl("lang"),
fromStorage("lang"),
fromNavigator(),
defaultLocale,
)!;
dynamicActivate(detectedLocale);
}, []);
}, [userLocale, resumeLocale]);
return <I18nProvider i18n={i18n}>{children}</I18nProvider>;
};