mirror of
https://github.com/flarum/framework.git
synced 2025-03-15 00:05:12 +08:00
Change app.trans
calls to app.translator.trans
calls
This commit is contained in:
parent
fed89e0de1
commit
3380495222
@ -13,7 +13,7 @@ export default function() {
|
||||
|
||||
items.add('like',
|
||||
Button.component({
|
||||
children: app.trans(isLiked ? 'flarum-likes.forum.unlike_action' : 'flarum-likes.forum.like_action'),
|
||||
children: app.translator.trans(isLiked ? 'flarum-likes.forum.unlike_action' : 'flarum-likes.forum.like_action'),
|
||||
className: 'Button Button--link',
|
||||
onclick: () => {
|
||||
isLiked = !isLiked;
|
||||
|
@ -22,7 +22,7 @@ export default function() {
|
||||
.map(user => {
|
||||
return (
|
||||
<a href={app.route.user(user)} config={m.route}>
|
||||
{user === app.session.user ? app.trans('flarum-likes.forum.you') : username(user)}
|
||||
{user === app.session.user ? app.translator.trans('flarum-likes.forum.you') : username(user)}
|
||||
</a>
|
||||
);
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Notification from 'flarum/components/Notification';
|
||||
import username from 'flarum/helpers/username';
|
||||
import punctuate from 'flarum/helpers/punctuate';
|
||||
import punctuateSeries from 'flarum/helpers/punctuateSeries';
|
||||
|
||||
export default class PostLikedNotification extends Notification {
|
||||
icon() {
|
||||
@ -16,11 +16,11 @@ export default class PostLikedNotification extends Notification {
|
||||
const user = notification.sender();
|
||||
const auc = notification.additionalUnreadCount();
|
||||
|
||||
return app.trans('flarum-likes.forum.post_liked_notification', {
|
||||
return app.translator.trans('flarum-likes.forum.post_liked_notification', {
|
||||
user,
|
||||
username: auc ? punctuate([
|
||||
username: auc ? punctuateSeries([
|
||||
username(user),
|
||||
app.trans('flarum-likes.forum.others', {count: auc})
|
||||
app.translator.trans('flarum-likes.forum.others', {count: auc})
|
||||
]) : undefined
|
||||
});
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ export default class PostLikesModal extends Modal {
|
||||
}
|
||||
|
||||
title() {
|
||||
return app.trans('flarum-likes.forum.post_likes_modal_title');
|
||||
return app.translator.trans('flarum-likes.forum.post_likes_modal_title');
|
||||
}
|
||||
|
||||
content() {
|
||||
|
@ -21,7 +21,7 @@ app.initializers.add('flarum-likes', () => {
|
||||
items.add('postLiked', {
|
||||
name: 'postLiked',
|
||||
icon: 'thumbs-o-up',
|
||||
label: app.trans('flarum-likes.forum.notify_post_liked')
|
||||
label: app.translator.trans('flarum-likes.forum.notify_post_liked')
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user