Skip to content

Commit

Permalink
added use of local locale to __ and __n
Browse files Browse the repository at this point in the history
  • Loading branch information
mashpie committed Jan 28, 2013
1 parent cb79a25 commit c6e720f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions i18n.js
Expand Up @@ -83,6 +83,9 @@ i18n.__ = function (phrase) {
if (this && this.scope) {
locale = this.scope.locale;
}
if (this && this.locale) {
locale = this.locale;
}
msg = translate(locale, phrase);
if (arguments.length > 1) {
msg = vsprintf(msg, Array.prototype.slice.call(arguments, 1));
Expand All @@ -95,6 +98,9 @@ i18n.__n = function (singular, plural, count) {
if (this && this.scope) {
locale = this.scope.locale;
}
if (this && this.locale) {
locale = this.locale;
}
msg = translate(locale, singular, plural);

if (parseInt(count, 10) > 1) {
Expand Down

0 comments on commit c6e720f

Please sign in to comment.