javascript - vue-i18n dynamic locale with promise doesn't update -
i testing vue-i18n
in order implement future projects. have separate system handle translations, got remote json files. vue-i18n
have system fetch locale using promise, explainations here.
i cannot use fetch method because files outside got cross-origin troubles. instead vue-resource
, don't know why, when set new set of locale, doesn't update automatically. bescause default lang en
, when load en
locale file, nothing. have change 2 times config.lang
force update.
several things:
a jsfiddle test > http://jsfiddle.net/t4kdoqj7/3/ uncomment line 19 reproduce fix
maybe it's due bad using of
vue-resource
i couldn't create
vue-i18n
tag...
thank !
ok, found hack :
set vue.config.lang = ''
before loading anything
here fiddle (l9) > http://jsfiddle.net/t4kdoqj7/4/
Comments
Post a Comment