Reorganize key names

See [flarum/core #265](https://github.com/flarum/core/issues/265).

- Adjusts key names to three-tier namespacing.
- Extracts previously unextracted strings.
This commit is contained in:
dcsjapan 2015-10-22 09:21:00 +09:00
parent 45e3e0fbff
commit 160f092810
5 changed files with 6 additions and 6 deletions

View File

@ -6,7 +6,7 @@ app.initializers.add('flarum-sticky', () => {
extend(PermissionGrid.prototype, 'moderateItems', items => {
items.add('sticky', {
icon: 'thumb-tack',
label: 'Sticky discussions',
label: app.translator.trans('flarum-sticky.admin.permissions.sticky_discussions_label'),
permission: 'discussion.sticky'
}, 95);
});

View File

@ -7,7 +7,7 @@ export default function addStickyBadge() {
if (this.isSticky()) {
badges.add('sticky', Badge.component({
type: 'sticky',
label: app.translator.trans('flarum-sticky.forum.stickied'),
label: app.translator.trans('flarum-sticky.forum.badge.sticky_tooltip'),
icon: 'thumb-tack'
}), 10);
}

View File

@ -7,7 +7,7 @@ export default function addStickyControl() {
extend(DiscussionControls, 'moderationControls', function(items, discussion) {
if (discussion.canSticky()) {
items.add('sticky', Button.component({
children: app.translator.trans(discussion.isSticky() ? 'flarum-sticky.forum.unsticky' : 'flarum-sticky.forum.sticky'),
children: app.translator.trans(discussion.isSticky() ? 'flarum-sticky.forum.discussion_controls.unsticky_button' : 'flarum-sticky.forum.discussion_controls.sticky_button'),
icon: 'thumb-tack',
onclick: this.stickyAction.bind(discussion)
}));

View File

@ -12,6 +12,6 @@ export default class DiscussionStickiedNotification extends Notification {
}
content() {
return app.translator.trans('flarum-sticky.forum.discussion_stickied_notification', {user: this.props.notification.sender()});
return '{username} stickied';
}
}

View File

@ -7,7 +7,7 @@ export default class DiscussionStickiedPost extends EventPost {
descriptionKey() {
return this.props.post.content().sticky
? 'flarum-sticky.forum.discussion_stickied_post'
: 'flarum-sticky.forum.discussion_unstickied_post';
? 'flarum-sticky.forum.post_stream.discussion_stickied_text'
: 'flarum-sticky.forum.post_stream.discussion_unstickied_text';
}
}