@@ -3,6 +3,7 @@ import Component from '../../common/Component';
3
3
import icon from '../../common/helpers/icon' ;
4
4
import formatNumber from '../../common/utils/formatNumber' ;
5
5
import ScrollListener from '../../common/utils/ScrollListener' ;
6
+ import { NestedStringArray } from '@askvortsov/rich-icu-message-formatter' ;
6
7
7
8
/**
8
9
* The `PostStreamScrubber` component displays a scrubber which can be used to
@@ -64,7 +65,7 @@ export default class PostStreamScrubber extends Component {
64
65
< div className = "Dropdown-menu dropdown-menu" >
65
66
< div className = "Scrubber" >
66
67
< a className = "Scrubber-first" onclick = { this . goToFirst . bind ( this ) } >
67
- { icon ( 'fas fa-angle-double-up' ) } { app . translator . trans ( 'core.forum.post_scrubber.original_post_link' ) }
68
+ { icon ( 'fas fa-angle-double-up' ) } { this . firstPostLabel ( ) }
68
69
</ a >
69
70
70
71
< div className = "Scrubber-scrollbar" >
@@ -79,19 +80,41 @@ export default class PostStreamScrubber extends Component {
79
80
< div className = "Scrubber-after" />
80
81
81
82
< div className = "Scrubber-unread" oncreate = { styleUnread } onupdate = { styleUnread } >
82
- { app . translator . trans ( 'core.forum.post_scrubber.unread_text' , { count : unreadCount } ) }
83
+ { this . unreadLabel ( unreadCount ) }
83
84
</ div >
84
85
</ div >
85
86
86
87
< a className = "Scrubber-last" onclick = { this . goToLast . bind ( this ) } >
87
- { icon ( 'fas fa-angle-double-down' ) } { app . translator . trans ( 'core.forum.post_scrubber.now_link' ) }
88
+ { icon ( 'fas fa-angle-double-down' ) } { this . lastPostLabel ( ) }
88
89
</ a >
89
90
</ div >
90
91
</ div >
91
92
</ div >
92
93
) ;
93
94
}
94
95
96
+ /**
97
+ * @returns {NestedStringArray }
98
+ */
99
+ firstPostLabel ( ) {
100
+ return app . translator . trans ( 'core.forum.post_scrubber.original_post_link' ) ;
101
+ }
102
+
103
+ /**
104
+ * @param {number } unreadCount
105
+ * @returns {NestedStringArray }
106
+ */
107
+ unreadLabel ( unreadCount ) {
108
+ return app . translator . trans ( 'core.forum.post_scrubber.unread_text' , { count : unreadCount } ) ;
109
+ }
110
+
111
+ /**
112
+ * @returns {NestedStringArray }
113
+ */
114
+ lastPostLabel ( ) {
115
+ return app . translator . trans ( 'core.forum.post_scrubber.now_link' ) ;
116
+ }
117
+
95
118
onupdate ( vnode ) {
96
119
super . onupdate ( vnode ) ;
97
120
0 commit comments