Skip to content

Commit 7dad31b

Browse files
committed
new build
1 parent 304bc63 commit 7dad31b

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

dist/vuex-i18n.cjs.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
361361
var mergedConfig = Object.assign({
362362
moduleName: 'i18n',
363363
identifiers: ['{', '}'],
364+
preserveState: false,
364365
onTranslationNotFound: function onTranslationNotFound() {}
365366
}, config);
366367

@@ -377,7 +378,8 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
377378
}
378379

379380
// register the i18n module in the vuex store
380-
store.registerModule(moduleName, i18nVuexModule, { preserveState: true });
381+
// preserveState can be used via configuration if server side rendering is used
382+
store.registerModule(moduleName, i18nVuexModule, { preserveState: mergedConfig.preserveState });
381383

382384
// check if the plugin was correctly initialized
383385
if (store.state.hasOwnProperty(moduleName) === false) {
@@ -771,7 +773,7 @@ var renderFn = function renderFn(identifiers) {
771773
console.warn('i18n: pluralization not provided in locale', translation, locale, index);
772774

773775
// return the first element of the pluralization by default
774-
return resolvedTranslation;
776+
return pluralizations[0].trim();
775777
}
776778

777779
// return the requested item from the pluralizations

dist/vuex-i18n.es.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
359359
var mergedConfig = Object.assign({
360360
moduleName: 'i18n',
361361
identifiers: ['{', '}'],
362+
preserveState: false,
362363
onTranslationNotFound: function onTranslationNotFound() {}
363364
}, config);
364365

@@ -375,7 +376,8 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
375376
}
376377

377378
// register the i18n module in the vuex store
378-
store.registerModule(moduleName, i18nVuexModule, { preserveState: true });
379+
// preserveState can be used via configuration if server side rendering is used
380+
store.registerModule(moduleName, i18nVuexModule, { preserveState: mergedConfig.preserveState });
379381

380382
// check if the plugin was correctly initialized
381383
if (store.state.hasOwnProperty(moduleName) === false) {
@@ -769,7 +771,7 @@ var renderFn = function renderFn(identifiers) {
769771
console.warn('i18n: pluralization not provided in locale', translation, locale, index);
770772

771773
// return the first element of the pluralization by default
772-
return resolvedTranslation;
774+
return pluralizations[0].trim();
773775
}
774776

775777
// return the requested item from the pluralizations

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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
365365
var mergedConfig = Object.assign({
366366
moduleName: 'i18n',
367367
identifiers: ['{', '}'],
368+
preserveState: false,
368369
onTranslationNotFound: function onTranslationNotFound() {}
369370
}, config);
370371

@@ -381,7 +382,8 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
381382
}
382383

383384
// register the i18n module in the vuex store
384-
store.registerModule(moduleName, i18nVuexModule, { preserveState: true });
385+
// preserveState can be used via configuration if server side rendering is used
386+
store.registerModule(moduleName, i18nVuexModule, { preserveState: mergedConfig.preserveState });
385387

386388
// check if the plugin was correctly initialized
387389
if (store.state.hasOwnProperty(moduleName) === false) {
@@ -775,7 +777,7 @@ var renderFn = function renderFn(identifiers) {
775777
console.warn('i18n: pluralization not provided in locale', translation, locale, index);
776778

777779
// return the first element of the pluralization by default
778-
return resolvedTranslation;
780+
return pluralizations[0].trim();
779781
}
780782

781783
// return the requested item from the pluralizations

0 commit comments

Comments
 (0)