Skip to content

Commit

Permalink
added debug mode to log untranslated strings to the console
Browse files Browse the repository at this point in the history
  • Loading branch information
Adar Porat committed Jun 4, 2013
1 parent d18499b commit 02fe969
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion jed.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ in order to offer easy upgrades -- jsgettext.berlios.de
}
},
// The default domain if one is missing
"domain" : "messages"
"domain" : "messages",
// enable debug mode to log untranslated strings to the console
"debug" : false
};

// Mix in the sent options with the default options
Expand Down Expand Up @@ -288,6 +290,11 @@ in order to offer easy upgrades -- jsgettext.berlios.de
this.options.missing_key_callback(key);
}
res = [ null, singular_key, plural_key ];

// collect untranslated strings
if (this.options.debug===true) {
console.log(res[ getPluralFormFunc(pluralForms)( val ) + 1 ]);
}
return res[ getPluralFormFunc(pluralForms)( val ) + 1 ];
}

Expand Down

0 comments on commit 02fe969

Please sign in to comment.