Skip to content

Commit

Permalink
v1.3.0 build
Browse files Browse the repository at this point in the history
  • Loading branch information
javisperez committed Jun 2, 2019
1 parent 6080af1 commit ceb4021
Show file tree
Hide file tree
Showing 6 changed files with 1,885 additions and 4 deletions.
25 changes: 25 additions & 0 deletions dist/vue-translate.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,23 @@ var VueTranslate = {
}

return this.locale[t];
},
textWithParams: function (t) {
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

if (!this.locale || !this.locale[t]) {
return t;
}

if (!this.params || this.params === null || typeof this.params === 'undefined') {
return t;
}

Object.keys(params).forEach(function (key) {
t = t.replace('%' + key + '%', params[key]);
});

return t;
}
}
});
Expand All @@ -100,6 +117,9 @@ var VueTranslate = {
// An alias for the .$translate.text method
t: function (t) {
return this.$translate.text(t);
},
tWithParams: function (t, params) {
return this.$translate.text(t, params);
}
}, _Vue$mixin.directives = {
translate: function (el) {
Expand All @@ -115,6 +135,11 @@ var VueTranslate = {
Vue.locales = function (locales) {
vm.$translate.setLocales(locales);
};

// Global method for setting languages
Vue.lang = function (lang) {
vm.$translate.setLang(lang);
};
}
};

Expand Down
25 changes: 25 additions & 0 deletions dist/vue-translate.es2015.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@ var VueTranslate = {
}

return this.locale[t];
},
textWithParams: function (t) {
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

if (!this.locale || !this.locale[t]) {
return t;
}

if (!this.params || this.params === null || typeof this.params === 'undefined') {
return t;
}

Object.keys(params).forEach(function (key) {
t = t.replace('%' + key + '%', params[key]);
});

return t;
}
}
});
Expand All @@ -98,6 +115,9 @@ var VueTranslate = {
// An alias for the .$translate.text method
t: function (t) {
return this.$translate.text(t);
},
tWithParams: function (t, params) {
return this.$translate.text(t, params);
}
}, _Vue$mixin.directives = {
translate: function (el) {
Expand All @@ -113,6 +133,11 @@ var VueTranslate = {
Vue.locales = function (locales) {
vm.$translate.setLocales(locales);
};

// Global method for setting languages
Vue.lang = function (lang) {
vm.$translate.setLang(lang);
};
}
};

Expand Down
25 changes: 25 additions & 0 deletions dist/vue-translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,23 @@ var VueTranslate = {
}

return this.locale[t];
},
textWithParams: function (t) {
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

if (!this.locale || !this.locale[t]) {
return t;
}

if (!this.params || this.params === null || typeof this.params === 'undefined') {
return t;
}

Object.keys(params).forEach(function (key) {
t = t.replace('%' + key + '%', params[key]);
});

return t;
}
}
});
Expand All @@ -104,6 +121,9 @@ var VueTranslate = {
// An alias for the .$translate.text method
t: function (t) {
return this.$translate.text(t);
},
tWithParams: function (t, params) {
return this.$translate.text(t, params);
}
}, _Vue$mixin.directives = {
translate: function (el) {
Expand All @@ -119,6 +139,11 @@ var VueTranslate = {
Vue.locales = function (locales) {
vm.$translate.setLocales(locales);
};

// Global method for setting languages
Vue.lang = function (lang) {
vm.$translate.setLang(lang);
};
}
};

Expand Down
2 changes: 1 addition & 1 deletion dist/vue-translate.min.js

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

Loading

0 comments on commit ceb4021

Please sign in to comment.