Add timeago locales.
This commit is contained in:
parent
26a8923a87
commit
ceb13a6405
9 changed files with 81 additions and 4 deletions
15
src/main.js
15
src/main.js
|
@ -25,12 +25,21 @@ import createPersistedState from './lib/persisted_state.js'
|
|||
|
||||
import messages from './i18n/messages.js'
|
||||
|
||||
const currentLocale = (window.navigator.language || 'en').split('-')[0]
|
||||
|
||||
Vue.use(Vuex)
|
||||
Vue.use(VueRouter)
|
||||
Vue.use(VueTimeago, {
|
||||
locale: 'en-US',
|
||||
locale: currentLocale,
|
||||
locales: {
|
||||
'en-US': require('../static/timeago.json')
|
||||
'en': require('../static/timeago-en.json'),
|
||||
'fi': require('../static/timeago-fi.json'),
|
||||
'de': require('../static/timeago-de.json'),
|
||||
'et': require('../static/timeago-et.json'),
|
||||
'hu': require('../static/timeago-hu.json'),
|
||||
'it': require('../static/timeago-it.json'),
|
||||
'fr': require('../static/timeago-fr.json'),
|
||||
'ja': require('../static/timeago-ja.json')
|
||||
}
|
||||
})
|
||||
Vue.use(VueI18n)
|
||||
|
@ -83,8 +92,6 @@ const router = new VueRouter({
|
|||
}
|
||||
})
|
||||
|
||||
const currentLocale = (window.navigator.language || 'en').split('-')[0]
|
||||
|
||||
const i18n = new VueI18n({
|
||||
locale: currentLocale,
|
||||
fallbackLocale: 'en',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue