Merge pull request #1 from dcsjapan/extract-translations

Extract translations
This commit is contained in:
Toby Zerner 2015-11-29 15:17:47 +10:30
commit a4669d7c70
2 changed files with 5 additions and 5 deletions

View File

@ -6,7 +6,7 @@ app.initializers.add('approval', () => {
extend(PermissionGrid.prototype, 'replyItems', items => { extend(PermissionGrid.prototype, 'replyItems', items => {
items.add('replyWithoutApproval', { items.add('replyWithoutApproval', {
icon: 'check', icon: 'check',
label: 'Reply without approval', label: app.translator.trans('flarum-approval.admin.permissions.reply_without_approval_label'),
permission: 'discussion.replyWithoutApproval' permission: 'discussion.replyWithoutApproval'
}, 95); }, 95);
}); });
@ -14,7 +14,7 @@ app.initializers.add('approval', () => {
extend(PermissionGrid.prototype, 'moderateItems', items => { extend(PermissionGrid.prototype, 'moderateItems', items => {
items.add('approvePosts', { items.add('approvePosts', {
icon: 'check', icon: 'check',
label: 'Approve posts', label: app.translator.trans('flarum-approval.admin.permissions.approve_posts_label'),
permission: 'discussion.approvePosts' permission: 'discussion.approvePosts'
}, 65); }, 65);
}); });

View File

@ -27,13 +27,13 @@ app.initializers.add('flarum-approval', () => {
extend(CommentPost.prototype, 'headerItems', function(items) { extend(CommentPost.prototype, 'headerItems', function(items) {
if (!this.props.post.isApproved() && !this.props.post.isHidden()) { if (!this.props.post.isApproved() && !this.props.post.isHidden()) {
items.add('unapproved', 'Awaiting Approval'); items.add('unapproved', app.translator.trans('flarum-approval.forum.post.awaiting_approval_text'));
} }
}); });
override(CommentPost.prototype, 'flagReason', function(original, flag) { override(CommentPost.prototype, 'flagReason', function(original, flag) {
if (flag.type() === 'approval') { if (flag.type() === 'approval') {
return 'Awaiting approval'; return app.translator.trans('flarum-approval.forum.post.awaiting_approval_text');
} }
return original(flag); return original(flag);
@ -43,7 +43,7 @@ app.initializers.add('flarum-approval', () => {
if (!post.isApproved() && post.canApprove()) { if (!post.isApproved() && post.canApprove()) {
items.add('approve', items.add('approve',
<Button icon="check" onclick={PostControls.approveAction.bind(post)}> <Button icon="check" onclick={PostControls.approveAction.bind(post)}>
Approve {app.translator.trans('flarum-approval.forum.post_controls.approve_button')}
</Button>, </Button>,
10 10
); );