mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 16:41:18 +08:00
BUGFIX: some protection for missing "notification" translations
This commit is contained in:
parent
ddc3c992b7
commit
7cba724fdb
|
@ -49,7 +49,11 @@ Discourse.TopicDetails = Discourse.Model.extend({
|
|||
|
||||
var localeString = "topic.notifications.reasons." + level;
|
||||
if (typeof this.get('notifications_reason_id') === 'number') {
|
||||
localeString += "_" + this.get('notifications_reason_id');
|
||||
var tmp = localeString + "_" + this.get('notifications_reason_id');
|
||||
// some sane protection for missing translations of edge cases
|
||||
if(I18n.lookup(tmp)){
|
||||
localeString = tmp;
|
||||
}
|
||||
}
|
||||
return I18n.t(localeString, { username: Discourse.User.currentProp('username_lower') });
|
||||
}.property('notification_level', 'notifications_reason_id'),
|
||||
|
|
Loading…
Reference in New Issue
Block a user