0

I'm using vue-i18n and I was wondering if there is a way to dynamically change the source file of <i18n> to match the locale language.

For each vue component I have a folder with my different translations :

├── myComponent | └── lang | ├── en.json | ├── fr.json | └── index.vue

In my index.vue I'd like to do something like :

<i18n src='./lang/' + $i18n.locale + '.json'></i18n>

Is it possible ?

UPDATE: So apparently it is not possible for now.

naomi
  • 33
  • 9
  • You can dynamically change the locale : http://kazupon.github.io/vue-i18n/guide/locale.html – Thoomas Jul 09 '18 at 13:34
  • Yes but thent I'd like to use this locale to use the corresponding file but when I run I get the message `Cannot translate the value of keypath 'message.title'. Use the value of keypath as default.` – naomi Jul 09 '18 at 13:53

0 Answers0