main.ts 934 Bytes
Newer Older
RWTH App's avatar
RWTH App committed
1
import Vue from 'vue';
2
import LoginApp from './LoginApp.vue';
3
import jQuery from 'jquery';
4
import BootstrapVue from 'bootstrap-vue';
5
6
import '@itcenter-layout/bootstrap/dist/css/rwth-theme.css';
import '@itcenter-layout/bootstrap/dist/css/material-icons.css';
7
import '@itcenter-layout/masterpage/dist/css/itcenter-masterdesign-masterpage.css';
8
9
import locales from './locale/locales';
import VueI18n from 'vue-i18n';
RWTH App's avatar
RWTH App committed
10
11
12

Vue.config.productionTip = false;

13
Vue.use(BootstrapVue);
14
15
Vue.use(VueI18n);

16
17
18
19
20
21
22
let localeValue = ((navigator as any).language || (navigator as any).userLanguage) as string;
if (localeValue.indexOf('de') !== -1) {
  localeValue = 'de';
} else {
  localeValue = 'en';
}

23
24
jQuery(() => {
  const i18n = new VueI18n({
25
    locale: localeValue, // set locale
26
27
28
29
30
    messages: locales, // set locale messages
    silentFallbackWarn: true,
  });

  new Vue({
31
    render: (h) => h(LoginApp),
32
33
34
    i18n,
  }).$mount('#loginpage');
});