Skip to content

Instantly share code, notes, and snippets.

@davidhoeck
Created July 29, 2018 11:39
Show Gist options
  • Save davidhoeck/d3a197554018feff23c86d483d0b494a to your computer and use it in GitHub Desktop.
Save davidhoeck/d3a197554018feff23c86d483d0b494a to your computer and use it in GitHub Desktop.
Load the Pimcore translations into the Vuei18n Plugin
// 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