mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 08:42:08 +10:00
- implement disable_email_auth env var
- add sync crowdin translations github action
This commit is contained in:
@ -1,8 +1,22 @@
|
||||
import { i18n } from "@lingui/core";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
import { dayjsLocales } from "./dayjs";
|
||||
|
||||
export const defaultLocale = "en-US";
|
||||
|
||||
export async function dynamicActivate(locale: string) {
|
||||
const { messages } = await import(`../locales/${locale}/messages.po`);
|
||||
i18n.loadAndActivate({ locale, messages });
|
||||
try {
|
||||
const { messages } = await import(`../locales/${locale}/messages.po`);
|
||||
|
||||
if (messages) {
|
||||
i18n.loadAndActivate({ locale, messages });
|
||||
}
|
||||
|
||||
if (dayjsLocales[locale]) {
|
||||
dayjs.locale(await dayjsLocales[locale]());
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user