webcompile/src/lib/translations.js

34 lines
653 B
JavaScript
Raw Normal View History

2022-06-22 12:27:47 +05:30
import i18n from "sveltekit-i18n";
/** @type {import('sveltekit-i18n').Config} */
2022-06-22 12:27:47 +05:30
const config = {
loaders: [
{
locale: "en",
key: "common",
loader: async () => (await import("../i18n/common.json")).default
},
{
locale: "nb",
key: "common",
loader: async () => (await import("../i18n/nb.json")).default
2022-06-22 12:30:48 +05:30
},
{
locale: "fr",
key: "common",
loader: async () => (await import("../i18n/fr.json")).default
}
/*
2022-06-22 12:30:48 +05:30
{
locale: "el",
key: "common",
loader: async () => (await import("../i18n/el.json")).default
2022-06-22 12:27:47 +05:30
}
*/
2022-06-22 12:27:47 +05:30
]
};
2022-06-22 12:27:47 +05:30
export const { t, locale, locales, loading, loadTranslations } = new i18n(
config
);