mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 17:29:17 +02:00
See #161: initial setup to collect/compile messages with vue-gettext
This commit is contained in:
parent
a1b8555c17
commit
a0a75c9919
7 changed files with 381 additions and 10 deletions
|
@ -15,7 +15,11 @@ import i18next from 'i18next'
|
|||
import i18nextFetch from 'i18next-fetch-backend'
|
||||
import VueI18Next from '@panter/vue-i18next'
|
||||
import store from './store'
|
||||
import GetTextPlugin from 'vue-gettext'
|
||||
import { sync } from 'vuex-router-sync'
|
||||
import translations from './translations.json'
|
||||
import locales from '@/locales'
|
||||
|
||||
import filters from '@/filters' // eslint-disable-line
|
||||
import globals from '@/components/globals' // eslint-disable-line
|
||||
|
||||
|
@ -29,6 +33,26 @@ window.$ = window.jQuery = require('jquery')
|
|||
require('semantic-ui-css/semantic.js')
|
||||
require('masonry-layout')
|
||||
|
||||
Vue.use(GetTextPlugin, {
|
||||
availableLanguages: (function () {
|
||||
let l = {}
|
||||
locales.locales.forEach(c => {
|
||||
l[c.code] = c.label
|
||||
})
|
||||
return l
|
||||
})(),
|
||||
defaultLanguage: 'en_US',
|
||||
languageVmMixin: {
|
||||
computed: {
|
||||
currentKebabCase: function () {
|
||||
return this.current.toLowerCase().replace('_', '-')
|
||||
}
|
||||
}
|
||||
},
|
||||
translations: translations,
|
||||
silent: true
|
||||
})
|
||||
|
||||
Vue.use(VueI18Next)
|
||||
Vue.use(VueMasonryPlugin)
|
||||
Vue.use(VueLazyload)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue