Skip to content

Commit

Permalink
new build
Browse files Browse the repository at this point in the history
  • Loading branch information
tikiatua committed Jan 10, 2018
1 parent 304bc63 commit 7dad31b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
6 changes: 4 additions & 2 deletions dist/vuex-i18n.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
var mergedConfig = Object.assign({
moduleName: 'i18n',
identifiers: ['{', '}'],
preserveState: false,
onTranslationNotFound: function onTranslationNotFound() {}
}, config);

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

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

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

// return the first element of the pluralization by default
return resolvedTranslation;
return pluralizations[0].trim();
}

// return the requested item from the pluralizations
Expand Down
6 changes: 4 additions & 2 deletions dist/vuex-i18n.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
var mergedConfig = Object.assign({
moduleName: 'i18n',
identifiers: ['{', '}'],
preserveState: false,
onTranslationNotFound: function onTranslationNotFound() {}
}, config);

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

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

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

// return the first element of the pluralization by default
return resolvedTranslation;
return pluralizations[0].trim();
}

// return the requested item from the pluralizations
Expand Down
2 changes: 1 addition & 1 deletion dist/vuex-i18n.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions dist/vuex-i18n.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
var mergedConfig = Object.assign({
moduleName: 'i18n',
identifiers: ['{', '}'],
preserveState: false,
onTranslationNotFound: function onTranslationNotFound() {}
}, config);

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

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

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

// return the first element of the pluralization by default
return resolvedTranslation;
return pluralizations[0].trim();
}

// return the requested item from the pluralizations
Expand Down

0 comments on commit 7dad31b

Please sign in to comment.