mirror of
https://github.com/zadam/trilium.git
synced 2025-12-12 18:34:24 +01:00
20 lines
530 B
TypeScript
20 lines
530 B
TypeScript
import library_loader from "./library_loader.js";
|
|
import options from "./options.js";
|
|
|
|
await library_loader.requireLibrary(library_loader.I18NEXT);
|
|
|
|
export async function initLocale() {
|
|
const locale = (options.get("locale") as string) || "en";
|
|
|
|
await i18next.use(i18nextHttpBackend).init({
|
|
lng: locale,
|
|
fallbackLng: "en",
|
|
backend: {
|
|
loadPath: `${window.glob.assetPath}/translations/{{lng}}/{{ns}}.json`
|
|
},
|
|
returnEmptyString: false
|
|
});
|
|
}
|
|
|
|
export const t = i18next.t;
|