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

Change app.trans calls to app.translator.trans calls

This commit is contained in:
Toby Zerner
2015-10-21 10:29:17 +10:30
parent 49ed9c7dde
commit 3dd2260b0f
6 changed files with 9 additions and 9 deletions

View File

@@ -108,7 +108,7 @@ export default function addComposerAutocomplete() {
const user = post.user(); const user = post.user();
suggestions.push( suggestions.push(
makeSuggestion(user, '@' + user.username() + '#' + post.id(), [ makeSuggestion(user, '@' + user.username() + '#' + post.id(), [
app.trans('flarum-mentions.forum.reply_to_post', {number: post.number()}), ' — ', app.translator.trans('flarum-mentions.forum.reply_to_post', {number: post.number()}), ' — ',
truncate(post.contentPlain(), 200) truncate(post.contentPlain(), 200)
], 'MentionsDropdown-post') ], 'MentionsDropdown-post')
); );

View File

@@ -91,7 +91,7 @@ export default function addMentionedByList() {
config={m.route} config={m.route}
onclick={hidePreview} onclick={hidePreview}
data-number={reply.number()}> data-number={reply.number()}>
{app.session.user === user ? app.trans('flarum-mentions.forum.you') : username(user)} {app.session.user === user ? app.translator.trans('flarum-mentions.forum.you') : username(user)}
</a> </a>
); );
}); });
@@ -100,7 +100,7 @@ export default function addMentionedByList() {
<div className="Post-mentionedBy" config={config}> <div className="Post-mentionedBy" config={config}>
<span className="Post-mentionedBy-summary"> <span className="Post-mentionedBy-summary">
{icon('reply')} {icon('reply')}
{app.trans('flarum-mentions.forum.post_mentioned_by', { {app.translator.trans('flarum-mentions.forum.post_mentioned_by', {
count: names.length, count: names.length,
users: punctuateSeries(names) users: punctuateSeries(names)
})} })}

View File

@@ -31,7 +31,7 @@ export default function() {
items.add('reply', items.add('reply',
Button.component({ Button.component({
className: 'Button Button--link', className: 'Button Button--link',
children: app.trans('flarum-mentions.forum.reply_link'), children: app.translator.trans('flarum-mentions.forum.reply_link'),
onclick: () => { onclick: () => {
const quote = window.getSelection().toString(); const quote = window.getSelection().toString();

View File

@@ -21,11 +21,11 @@ export default class PostMentionedNotification extends Notification {
const auc = notification.additionalUnreadCount(); const auc = notification.additionalUnreadCount();
const user = notification.sender(); const user = notification.sender();
return app.trans('flarum-mentions.forum.post_mentioned_notification', { return app.translator.trans('flarum-mentions.forum.post_mentioned_notification', {
user, user,
username: auc ? punctuate([ username: auc ? punctuate([
username(user), username(user),
app.trans('flarum-mentions.forum.others', {count: auc}) app.translator.trans('flarum-mentions.forum.others', {count: auc})
]) : undefined ]) : undefined
}); });
} }

View File

@@ -14,7 +14,7 @@ export default class UserMentionedNotification extends Notification {
content() { content() {
const user = this.props.notification.sender(); const user = this.props.notification.sender();
return app.trans('flarum-mentions.forum.user_mentioned_notification', {user}); return app.translator.trans('flarum-mentions.forum.user_mentioned_notification', {user});
} }
excerpt() { excerpt() {

View File

@@ -35,13 +35,13 @@ app.initializers.add('flarum-mentions', function() {
items.add('postMentioned', { items.add('postMentioned', {
name: 'postMentioned', name: 'postMentioned',
icon: 'reply', icon: 'reply',
label: app.trans('flarum-mentions.forum.notify_post_mentioned') label: app.translator.trans('flarum-mentions.forum.notify_post_mentioned')
}); });
items.add('userMentioned', { items.add('userMentioned', {
name: 'userMentioned', name: 'userMentioned',
icon: 'at', icon: 'at',
label: app.trans('flarum-mentions.forum.notify_user_mentioned') label: app.translator.trans('flarum-mentions.forum.notify_user_mentioned')
}); });
}); });