mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove buffered rendering from i18n count
This is another refactoring in the multi-step process to remove all uses
of our custom Render Buffer.
Previous commit: 80f4b9e227 in this
series.
This commit affects the display of translated counts that is used in
multiple places like showing how many posts are selected using the
select posts feature on a topic. It is just a refactor and does not
change any functionality.
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
import Component from "@ember/component";
|
||||
import { bufferedRender } from "discourse-common/lib/buffered-render";
|
||||
|
||||
export default Component.extend(
|
||||
bufferedRender({
|
||||
tagName: "span",
|
||||
rerenderTriggers: ["count", "suffix"],
|
||||
export default Component.extend({
|
||||
tagName: "span",
|
||||
rerenderTriggers: ["count", "suffix"],
|
||||
i18nCount: null,
|
||||
|
||||
buildBuffer(buffer) {
|
||||
buffer.push(
|
||||
I18n.t(this.key + (this.suffix || ""), {
|
||||
count: this.count
|
||||
})
|
||||
);
|
||||
}
|
||||
})
|
||||
);
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
this.set(
|
||||
"i18nCount",
|
||||
I18n.t(this.key + (this.suffix || ""), { count: this.count }).htmlSafe()
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{{i18nCount}}
|
||||
Reference in New Issue
Block a user