Skip to content

refactor(core): allow labels of PostStreamScrubber to be customized #4181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions framework/core/js/src/forum/components/PostStreamScrubber.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class PostStreamScrubber extends Component {
<div className="Dropdown-menu dropdown-menu">
<div className="Scrubber">
<Button className="Scrubber-first Button Button--link" onclick={this.goToFirst.bind(this)} icon="fas fa-angle-double-up">
{app.translator.trans('core.forum.post_scrubber.original_post_link')}
{this.firstPostLabel()}
</Button>

<div className="Scrubber-scrollbar">
Expand All @@ -80,19 +80,31 @@ 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>

<Button className="Scrubber-last Button Button--link" onclick={this.goToLast.bind(this)} icon="fas fa-angle-double-down">
{app.translator.trans('core.forum.post_scrubber.now_link')}
{this.lastPostLabel()}
</Button>
</div>
</div>
</div>
);
}

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);

Expand Down
Loading