I use nuxtjs and i18n to build a static website with multiple languages. At the moment I have one json file per language. For better structure i want to split the file in multiple files per language. How can i do that? Is there a way where i can tell i18n explicit which json file it should use for a page? Or do I have to concatenatet the jsons files to one?
I used this exmaple to build my translations https://nuxtjs.org/examples/i18n/
// i18n.js plugin
import Vue from 'vue'
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)
export default ({ app, store }) => {
app.i18n = new VueI18n({
locale: store.state.locale,
fallbackLocale: 'en-US',
messages: {
en: Object.assign({}, require('~/locales/en.json'), require('~/locales/en.settings.json')),
tr: Object.assign({}, require('~/locales/tr.json'), require('~/locales/tr.settings.json')),
},
silentTranslationWarn: true,
})
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With