1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 14:10:37 +02:00

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(); e.preventDefault();
app.modal.show(PostLikesModal, {post}); 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> </a>
); );
} }
@@ -48,7 +48,7 @@ export default function() {
items.add('liked', ( items.add('liked', (
<div className="Post-likedBy"> <div className="Post-likedBy">
{icon('far fa-thumbs-up')} {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, count: names.length,
users: punctuateSeries(names) users: punctuateSeries(names)
})} })}

View File

@@ -14,7 +14,7 @@ export default class PostLikedNotification extends Notification {
const notification = this.attrs.notification; const notification = this.attrs.notification;
const user = notification.fromUser(); 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() { excerpt() {

View File

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