Skip to content

Commit

Permalink
new build
Browse files Browse the repository at this point in the history
  • Loading branch information
tikiatua committed Jan 2, 2019
1 parent 5933469 commit 898653d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
14 changes: 13 additions & 1 deletion dist/vuex-i18n.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,14 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
identifiers: ['{', '}'],
preserveState: false,
translateFilterName: 'translate',
translateInFilterName: 'translateIn',
onTranslationNotFound: function onTranslationNotFound() {}
}, config); // define module name and identifiers as constants to prevent any changes

var moduleName = config.moduleName;
var identifiers = config.identifiers;
var translateFilterName = config.translateFilterName; // initialize the onTranslationNotFound function and make sure it is actually
var translateFilterName = config.translateFilterName;
var translateInFilterName = config.translateInFilterName; // initialize the onTranslationNotFound function and make sure it is actually
// a function

var onTranslationNotFound = config.onTranslationNotFound;
Expand Down Expand Up @@ -553,6 +555,15 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
}

return render(locale, translations[fallback][key], options, pluralization);
}; // add a filter function to translate in a given locale (i.e. {{ 'something' | translateIn('en') }})


var translateInLanguageFilter = function translateInLanguageFilter(key, locale) {
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}

return translateInLanguage.apply(void 0, [locale, key].concat(args));
}; // check if the given key exists in the current locale


Expand Down Expand Up @@ -692,6 +703,7 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
Vue.prototype.$tlang = translateInLanguage; // register a filter function for translations

Vue.filter(translateFilterName, translate);
Vue.filter(translateInFilterName, translateInLanguageFilter);
}; // renderFn will initialize a function to render the variable substitutions in
// the translation string. identifiers specify the tags will be used to find
// variable substitutions, i.e. {test} or {{test}}, note that we are using a
Expand Down
14 changes: 13 additions & 1 deletion dist/vuex-i18n.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,14 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
identifiers: ['{', '}'],
preserveState: false,
translateFilterName: 'translate',
translateInFilterName: 'translateIn',
onTranslationNotFound: function onTranslationNotFound() {}
}, config); // define module name and identifiers as constants to prevent any changes

var moduleName = config.moduleName;
var identifiers = config.identifiers;
var translateFilterName = config.translateFilterName; // initialize the onTranslationNotFound function and make sure it is actually
var translateFilterName = config.translateFilterName;
var translateInFilterName = config.translateInFilterName; // initialize the onTranslationNotFound function and make sure it is actually
// a function

var onTranslationNotFound = config.onTranslationNotFound;
Expand Down Expand Up @@ -551,6 +553,15 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
}

return render(locale, translations[fallback][key], options, pluralization);
}; // add a filter function to translate in a given locale (i.e. {{ 'something' | translateIn('en') }})


var translateInLanguageFilter = function translateInLanguageFilter(key, locale) {
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}

return translateInLanguage.apply(void 0, [locale, key].concat(args));
}; // check if the given key exists in the current locale


Expand Down Expand Up @@ -690,6 +701,7 @@ VuexI18nPlugin.install = function install(Vue, store, config) {
Vue.prototype.$tlang = translateInLanguage; // register a filter function for translations

Vue.filter(translateFilterName, translate);
Vue.filter(translateInFilterName, translateInLanguageFilter);
}; // renderFn will initialize a function to render the variable substitutions in
// the translation string. identifiers specify the tags will be used to find
// variable substitutions, i.e. {test} or {{test}}, note that we are using a
Expand Down
Loading

0 comments on commit 898653d

Please sign in to comment.