- implement disable_email_auth env var

- add sync crowdin translations github action
This commit is contained in:
Amruth Pillai
2023-11-21 09:44:37 +01:00
parent 635f743e56
commit 1825fc3283
84 changed files with 2693 additions and 2341 deletions

View File

@ -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);
}
}