FEATURE: verbose localization option

This commit is contained in:
Sam 2014-08-27 14:12:11 +10:00
parent 66f9f5773d
commit 16c34c206d
3 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,25 @@
export default {
name: 'verbose-localization',
initialize: function() {
if(Discourse.SiteSettings.verbose_localization){
var counter = 0;
var keys = {};
var t = I18n.t;
I18n.t = I18n.translate = function(scope, value){
var current = keys[scope];
if(!current) {
current = keys[scope] = ++counter;
var message = "Translation #" + current + ": " + scope;
if (!_.isEmpty(value)) {
message += ", parameters: " + JSON.stringify(value);
}
window.console.log(message);
}
return t.apply(I18n, [scope, value]) + " (t" + current + ")";
};
}
}
};

View File

@ -799,6 +799,7 @@ en:
s3_backup_bucket: "The remote bucket to hold backups. WARNING: Make sure it is a private bucket."
active_user_rate_limit_secs: "How frequently we update the 'last_seen_at' field, in seconds"
verbose_localization: "Show extended localization tips in the UI"
previous_visit_timeout_hours: "How long a visit lasts before we consider it the 'previous' visit, in hours"
rate_limit_create_topic: "After creating a topic, users must wait (n) seconds before creating another topic."

View File

@ -594,6 +594,9 @@ developer:
client: true
default: 5
active_user_rate_limit_secs: 60
verbose_localization:
default: false
client: true
embedding:
embeddable_host: ''