Update for ICU MessageFormat

This commit is contained in:
Alexander Skvortsov 2021-05-12 19:24:06 -04:00
parent 93d373f066
commit 6c27c08672
3 changed files with 4 additions and 4 deletions

View File

@ -40,7 +40,7 @@ export default function() {
e.preventDefault();
app.modal.show(PostLikesModal, {post});
}}>
{app.translator.transChoice('flarum-likes.forum.post.others_link', count, {count})}
{app.translator.trans('flarum-likes.forum.post.others_link', {count})}
</a>
);
}
@ -48,7 +48,7 @@ export default function() {
items.add('liked', (
<div className="Post-likedBy">
{icon('far fa-thumbs-up')}
{app.translator.transChoice('flarum-likes.forum.post.liked_by' + (likes[0] === app.session.user ? '_self' : '') + '_text', names.length, {
{app.translator.trans('flarum-likes.forum.post.liked_by' + (likes[0] === app.session.user ? '_self' : '') + '_text', {
count: names.length,
users: punctuateSeries(names)
})}

View File

@ -14,7 +14,7 @@ export default class PostLikedNotification extends Notification {
const notification = this.attrs.notification;
const user = notification.fromUser();
return app.translator.transChoice('flarum-likes.forum.notifications.post_liked_text', 1, {user});
return app.translator.trans('flarum-likes.forum.notifications.post_liked_text', {user, count: 1});
}
excerpt() {

View File

@ -23,7 +23,7 @@ flarum-likes:
post:
like_link: Like
liked_by_self_text: "{users} like this." # Can be pluralized to agree with the number of users!
liked_by_text: "{users} likes this.|{users} like this."
liked_by_text: "{count, plural, one {{users} likes this} other {{users} like this}}"
others_link: => core.ref.some_others
unlike_link: Unlike
you_text: => core.ref.you