diff --git a/app/assets/javascripts/discourse/models/topic_details.js b/app/assets/javascripts/discourse/models/topic_details.js index 6a5a846146..280a1bb980 100644 --- a/app/assets/javascripts/discourse/models/topic_details.js +++ b/app/assets/javascripts/discourse/models/topic_details.js @@ -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'),