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/components/count-i18n.js
2020-03-12 13:29:55 -04:00

16 lines
337 B
JavaScript

import Component from "@ember/component";
export default Component.extend({
tagName: "span",
rerenderTriggers: ["count", "suffix"],
i18nCount: null,
didReceiveAttrs() {
this._super(...arguments);
this.set(
"i18nCount",
I18n.t(this.key + (this.suffix || ""), { count: this.count }).htmlSafe()
);
}
});