import Cookies from 'js-cookie'
import {createI18n} from 'vue-i18n';
import enLocale from './en'
import zhLocale from './zhCn'


const messages = {
    en: {
        ...enLocale,
    },
    zhCn: {
        ...zhLocale,
    }
}

const i18n = createI18n({
    legacy: false,
    globalInjection: true,
    locale: Cookies.get('language') || 'zhCn',
    messages
});

export default i18n