mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
22 lines
552 B
JavaScript
22 lines
552 B
JavaScript
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") || "en";
|
|
|
|
await i18next
|
|
.use(i18nextHttpBackend)
|
|
.init({
|
|
lng: locale,
|
|
fallbackLng: "en",
|
|
debug: true,
|
|
backend: {
|
|
loadPath: `/${window.glob.assetPath}/translations/{{lng}}/{{ns}}.json`
|
|
}
|
|
});
|
|
}
|
|
|
|
export const t = i18next.t;
|