mobilizon/js/src/utils/i18n.ts
Thomas Citharel 33e51a05ec
Handle errors better
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-10-13 13:56:24 +02:00

14 lines
347 B
TypeScript

import Vue from 'vue';
import VueI18n from 'vue-i18n';
import messages from '@/i18n/index';
const language = (window.navigator as any).userLanguage || window.navigator.language;
Vue.use(VueI18n);
export const i18n = new VueI18n({
locale: language.split('-')[0], // set locale
messages, // set locale messages
fallbackLocale: 'en_US',
});