This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/models/badge-grouping.js.es6
2019-11-07 15:38:28 -06:00

16 lines
440 B
JavaScript

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