discourse/app/assets/javascripts/discourse/models/badge-grouping.js.es6
Gerhard Schlager 8517674a32 UX: Show translated badge names and badge groupings
FIX: Disallow renaming of system badges
FIX: Disallow renaming/deleting of system badge groupings
UX: Use "modern" button style in badge groupings dialog
2015-12-30 23:35:16 +01:00

17 lines
438 B
JavaScript

import computed from 'ember-addons/ember-computed-decorators';
import RestModel from 'discourse/models/rest';
export default RestModel.extend({
@computed('name')
i18nNameKey() {
return this.get('name').toLowerCase().replace(/\s/g, '_');
},
@computed('name')
displayName() {
const i18nKey = `badges.badge_grouping.${this.get('i18nNameKey')}.name`;
return I18n.t(i18nKey, {defaultValue: this.get('name')});
}
});