mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2026-01-16 11:32:26 +01:00
31 lines
630 B
TypeScript
31 lines
630 B
TypeScript
import { createI18n } from "vue-i18n";
|
|
import en from "./translations/en.json";
|
|
import de from "./translations/de.json";
|
|
import localeStore from "../store/localeStore.ts";
|
|
|
|
// Private instance of VueI18n object
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
let _i18n: any;
|
|
// Initializer
|
|
function setup() {
|
|
_i18n = createI18n({
|
|
legacy: false,
|
|
locale: localeStore().locale,
|
|
fallbackLocale: "en",
|
|
messages: {
|
|
en,
|
|
de,
|
|
},
|
|
});
|
|
return _i18n;
|
|
}
|
|
|
|
// Public interface
|
|
export default {
|
|
// Expose the VueI18n instance via a getter
|
|
get vueI18n() {
|
|
return _i18n;
|
|
},
|
|
setup,
|
|
};
|