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


const messages = {
    en: {
        ...enLocale,
    },
    'zh-cn': {
        ...zhLocale,
    }
}

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

export default i18n