1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 16:36:47 +02:00

[1.x] [extensibility] refactor(core): allow labels of PostStreamScrubber to be customized (#4049)

* refactor(core): allow labels to be customized

* chore: change type annotation

* chore: remove type annotations

Importing `NestedStringArray` did cause issues in the CI
This commit is contained in:
Davide Iadeluca
2024-10-02 12:19:26 +02:00
committed by GitHub
parent 359681f3c6
commit 12d21cdbfc

View File

@@ -64,7 +64,7 @@ export default class PostStreamScrubber extends Component {
<div className="Dropdown-menu dropdown-menu">
<div className="Scrubber">
<a className="Scrubber-first" onclick={this.goToFirst.bind(this)}>
{icon('fas fa-angle-double-up')} {app.translator.trans('core.forum.post_scrubber.original_post_link')}
{icon('fas fa-angle-double-up')} {this.firstPostLabel()}
</a>
<div className="Scrubber-scrollbar">
@@ -79,12 +79,12 @@ export default class PostStreamScrubber extends Component {
<div className="Scrubber-after" />
<div className="Scrubber-unread" oncreate={styleUnread} onupdate={styleUnread}>
{app.translator.trans('core.forum.post_scrubber.unread_text', { count: unreadCount })}
{this.unreadLabel(unreadCount)}
</div>
</div>
<a className="Scrubber-last" onclick={this.goToLast.bind(this)}>
{icon('fas fa-angle-double-down')} {app.translator.trans('core.forum.post_scrubber.now_link')}
{icon('fas fa-angle-double-down')} {this.lastPostLabel()}
</a>
</div>
</div>
@@ -92,6 +92,18 @@ export default class PostStreamScrubber extends Component {
);
}
firstPostLabel() {
return app.translator.trans('core.forum.post_scrubber.original_post_link');
}
unreadLabel(unreadCount) {
return app.translator.trans('core.forum.post_scrubber.unread_text', { count: unreadCount });
}
lastPostLabel() {
return app.translator.trans('core.forum.post_scrubber.now_link');
}
onupdate(vnode) {
super.onupdate(vnode);