Added vue-gettext.

This commit is contained in:
Antoine Nguyen
2020-10-31 11:06:58 +01:00
parent b9f233c126
commit 6c8a8d58c7
12 changed files with 796 additions and 22 deletions
+15
View File
@@ -0,0 +1,15 @@
import Vue from 'vue'
import GetTextPlugin from 'vue-gettext'
import translations from '@/translations.json'
Vue.use(GetTextPlugin, {
availableLanguages: {
en: 'English',
fr: 'Français'
},
translations: translations
})
Vue.filter('translate', value => {
return !value ? '' : Vue.prototype.$gettext(value.toString())
})