Created
July 29, 2018 11:39
-
-
Save dlhck/d3a197554018feff23c86d483d0b494a to your computer and use it in GitHub Desktop.
Load the Pimcore translations into the Vuei18n Plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import vue and vue i18n | |
import Vue from 'vue'; | |
import VueI18n from 'vue-i18n'; | |
// --- Add your vue components here --- | |
// Vue.component('example-components', ExampleComponent); | |
// ------------------------------------ | |
// use the vue i18n plugin | |
Vue.use(VueI18n); | |
// load the translations from the global window object into the plugin | |
const messages = window.app_translations; | |
const i18n = new VueI18n({ | |
locale: window.app_locale, | |
messages | |
}); | |
// now initialize your vue application and mount it do you app wrapper in the DOM | |
new Vue({i18n}).$mount('#app-wrapper'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment