1
0
mirror of https://github.com/flarum/core.git synced 2025-10-22 04:06:37 +02:00

Switch to ICU MessageFormat (#2759)

This commit is contained in:
Alexander Skvortsov
2021-04-30 12:44:39 -04:00
committed by GitHub
parent edaf45d133
commit b45519974a
24 changed files with 19152 additions and 3351 deletions

View File

@@ -57,7 +57,7 @@ export default class EventPost extends Post {
* @return {String|Object} The description to render in the DOM
*/
description(data) {
return app.translator.transChoice(this.descriptionKey(), data.count, data);
return app.translator.trans(this.descriptionKey(), data);
}
/**

View File

@@ -26,9 +26,10 @@ export default class PostStreamScrubber extends Component {
const count = this.stream.count();
// Index is left blank for performance reasons, it is filled in in updateScubberValues
const viewing = app.translator.transChoice('core.forum.post_scrubber.viewing_text', count, {
const viewing = app.translator.trans('core.forum.post_scrubber.viewing_text', {
count,
index: <span className="Scrubber-index"></span>,
count: <span className="Scrubber-count">{formatNumber(count)}</span>,
formattedCount: <span className="Scrubber-count">{formatNumber(count)}</span>,
});
const unreadCount = this.stream.discussion.unreadCount();