mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 20:30:54 -05:00
17 lines
560 B
TypeScript
17 lines
560 B
TypeScript
import { i18n } from "@lingui/core";
|
|
import { en } from "make-plural/plurals";
|
|
|
|
i18n.loadLocaleData("en", { plurals: en });
|
|
//i18n.loadLocaleData("cs", { plurals: cs });
|
|
|
|
/**
|
|
* Load messages for requested locale and activate it.
|
|
* This function isn't part of the LinguiJS library because there're
|
|
* many ways how to load messages — from REST API, from file, from cache, etc.
|
|
*/
|
|
export async function activate(locale: string) {
|
|
const { messages } = await import(`locale/${locale}/messages.js`);
|
|
i18n.load(locale, messages);
|
|
i18n.activate(locale);
|
|
}
|