import {createI18n} from "vue-i18n";

import translationsCs from "../../translations/messages.cs.json";
import translationsEn from "../../translations/messages.en.json";

const defaultLocale = 'cs';
const locale = typeof document !== 'undefined' ? (document.documentElement.lang || defaultLocale) : defaultLocale;

export const i18n = createI18n({
    legacy: false,
    globalInjection: true,
    locale: locale,
    fallbackLocale: defaultLocale,
    messages: {
        cs: {
            ...translationsCs,
        },
        en: {
            ...translationsEn,
        },
    }
});