Closed SkyRideRq closed 4 years ago
Hi @SkyRideRq, you're right, it's exactly because of that. I don't consider it an issue, in fact, I prefer not to have default translations loaded, as it adds more kB to users who use different language.
Right now there's no other way to pass in the translations, you have to use the async load function. However, I understand that someone might like to load translations upfront, so I'll take a look at it and try to add some option for it.
Solved in https://github.com/adbrosaci/vue-lang-router/commit/4b825aed1bf63d40124adc12702b051eed109470. Run npm update vue-lang-router
and you should get the changes.
You can now specify messages
object instead of load
function whenever you wish to pass in messages upfront. It's going to look something like this:
import enMessages from './en.json';
export default {
en: {
name: 'English',
messages: enMessages,
// load: () => { return import('./en.json'); }, // Not needed anymore
},
};
o thx 👍 :)
hi, I'm getting [vue-i18n] Cannot translate the value of keypath 'global.logOut'. Use the value of keypath as default. i think it's because language file is loaded async and its creating warn above and translation lag (first app is dislaying variables and after short time translated values) is there another way to load default loanguage file without async load function?