Skip to content

Commit 0a91334

Browse files
committed
allow all kinds of return values (object, strings, promises)
1 parent 59f784d commit 0a91334

File tree

6 files changed

+6
-11
lines changed

6 files changed

+6
-11
lines changed

dist/vuex-i18n.cjs.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,7 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
502502
var asyncTranslation = onTranslationNotFound(locale, key);
503503

504504
// resolve async translations by updating the store
505-
if (asyncTranslation && (typeof asyncTranslation == 'string' || typeof asyncTranslation.then == 'function')) {
506-
505+
if (asyncTranslation) {
507506
Promise.resolve(asyncTranslation).then(function (value) {
508507
var additionalTranslations = {};
509508
additionalTranslations[key] = value;

dist/vuex-i18n.es.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,7 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
500500
var asyncTranslation = onTranslationNotFound(locale, key);
501501

502502
// resolve async translations by updating the store
503-
if (asyncTranslation && (typeof asyncTranslation == 'string' || typeof asyncTranslation.then == 'function')) {
504-
503+
if (asyncTranslation) {
505504
Promise.resolve(asyncTranslation).then(function (value) {
506505
var additionalTranslations = {};
507506
additionalTranslations[key] = value;

dist/vuex-i18n.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vuex-i18n.umd.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,7 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
506506
var asyncTranslation = onTranslationNotFound(locale, key);
507507

508508
// resolve async translations by updating the store
509-
if (asyncTranslation && (typeof asyncTranslation == 'string' || typeof asyncTranslation.then == 'function')) {
510-
509+
if (asyncTranslation) {
511510
Promise.resolve(asyncTranslation).then(function (value) {
512511
var additionalTranslations = {};
513512
additionalTranslations[key] = value;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuex-i18n",
3-
"version": "1.10.0",
3+
"version": "1.10.1",
44
"description": "Easy localization for vue-components using vuex as data store",
55
"directories": {
66
"test": "test"

src/vuex-i18n-plugin.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,12 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
170170
let asyncTranslation = onTranslationNotFound(locale, key);
171171

172172
// resolve async translations by updating the store
173-
if (asyncTranslation && (typeof asyncTranslation == 'string' || typeof asyncTranslation.then == 'function')) {
174-
173+
if (asyncTranslation) {
175174
Promise.resolve(asyncTranslation).then((value) => {
176175
let additionalTranslations = {};
177176
additionalTranslations[key] = value;
178177
addLocale(locale, additionalTranslations);
179178
});
180-
181179
}
182180

183181
// check if a vaild fallback exists in the store.

0 commit comments

Comments
 (0)