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

Add third tier to key namespacing

- Changes all `app.trans` calls to `app.translator.trans` calls.
- Changes existing keys to [three-tier namespace structure](https://github.com/flarum/english/pull/12).
- Extracts additional strings for `lib:` namespace.
- Extracts two previously missed strings for EditGroupModal.js.
This commit is contained in:
dcsjapan
2015-10-20 13:04:43 +09:00
parent a9eb62880e
commit 49d59089e4
54 changed files with 216 additions and 216 deletions

View File

@@ -55,14 +55,14 @@ export default {
!app.session.user || discussion.canReply()
? Button.component({
icon: 'reply',
children: app.trans(app.session.user ? 'core.forum.discussion_controls_reply_button' : 'core.forum.discussion_controls_log_in_to_reply_button'),
children: app.translator.translator.trans(app.session.user ? 'core.forum.discussion_controls.reply_button' : 'core.forum.discussion_controls.log_in_to_reply_button'),
onclick: this.replyAction.bind(discussion, true, false)
})
: Button.component({
icon: 'reply',
children: app.trans('core.forum.discussion_controls_cannot_reply_button'),
children: app.translator.trans('core.forum.discussion_controls.cannot_reply_button'),
className: 'disabled',
title: app.trans('core.forum.discussion_controls_cannot_reply_text')
title: app.translator.trans('core.forum.discussion_controls.cannot_reply_text')
})
);
}
@@ -85,7 +85,7 @@ export default {
if (discussion.canRename()) {
items.add('rename', Button.component({
icon: 'pencil',
children: app.trans('core.forum.discussion_controls_rename_button'),
children: app.translator.trans('core.forum.discussion_controls.rename_button'),
onclick: this.renameAction.bind(discussion)
}));
}
@@ -109,21 +109,21 @@ export default {
if (discussion.canHide()) {
items.add('hide', Button.component({
icon: 'trash-o',
children: app.trans('core.forum.discussion_controls_delete_button'),
children: app.translator.trans('core.forum.discussion_controls.delete_button'),
onclick: this.hideAction.bind(discussion)
}));
}
} else if (discussion.canDelete()) {
items.add('restore', Button.component({
icon: 'reply',
children: app.trans('core.forum.discussion_controls_restore_button'),
children: app.translator.trans('core.forum.discussion_controls.restore_button'),
onclick: this.restoreAction.bind(discussion),
disabled: discussion.commentsCount() === 0
}));
items.add('delete', Button.component({
icon: 'times',
children: app.trans('core.forum.discussion_controls_delete_forever_button'),
children: app.translator.trans('core.forum.discussion_controls.delete_forever_button'),
onclick: this.deleteAction.bind(discussion)
}));
}
@@ -216,7 +216,7 @@ export default {
* @return {Promise}
*/
deleteAction() {
if (confirm(extractText(app.trans('core.forum.discussion_controls_delete_confirmation')))) {
if (confirm(extractText(app.translator.trans('core.forum.discussion_controls.delete_confirmation')))) {
// If there is a discussion list in the cache, remove this discussion.
if (app.cache.discussionList) {
app.cache.discussionList.removeDiscussion(this);
@@ -239,7 +239,7 @@ export default {
*/
renameAction() {
const currentTitle = this.title();
const title = prompt(extractText(app.trans('core.forum.discussion_controls_rename_text')), currentTitle);
const title = prompt(extractText(app.translator.trans('core.forum.discussion_controls.rename_text')), currentTitle);
// If the title is different to what it was before, then save it. After the
// save has completed, update the post stream as there will be a new post

View File

@@ -60,7 +60,7 @@ export default {
if (!post.isHidden()) {
items.add('edit', Button.component({
icon: 'pencil',
children: app.trans('core.forum.post_controls_edit_button'),
children: app.translator.trans('core.forum.post_controls.edit_button'),
onclick: this.editAction.bind(post)
}));
}
@@ -85,7 +85,7 @@ export default {
if (post.canEdit()) {
items.add('hide', Button.component({
icon: 'trash-o',
children: app.trans('core.forum.post_controls_delete_button'),
children: app.translator.trans('core.forum.post_controls.delete_button'),
onclick: this.hideAction.bind(post)
}));
}
@@ -93,14 +93,14 @@ export default {
if (post.contentType() === 'comment' && post.canEdit()) {
items.add('restore', Button.component({
icon: 'reply',
children: app.trans('core.forum.post_controls_restore_button'),
children: app.translator.trans('core.forum.post_controls.restore_button'),
onclick: this.restoreAction.bind(post)
}));
}
if (post.canDelete() && post.number() !== 1) {
items.add('delete', Button.component({
icon: 'times',
children: app.trans('core.forum.post_controls_delete_forever_button'),
children: app.translator.trans('core.forum.post_controls.delete_forever_button'),
onclick: this.deleteAction.bind(post)
}));
}

View File

@@ -60,7 +60,7 @@ export default {
if (user.canEdit()) {
items.add('edit', Button.component({
icon: 'pencil',
children: app.trans('core.forum.user_controls_edit_button'),
children: app.translator.trans('core.forum.user_controls.edit_button'),
onclick: this.editAction.bind(user)
}));
}
@@ -83,7 +83,7 @@ export default {
if (user.id() !== '1' && user.canDelete()) {
items.add('delete', Button.component({
icon: 'times',
children: app.trans('core.forum.user_controls_delete_button'),
children: app.translator.trans('core.forum.user_controls.delete_button'),
onclick: this.deleteAction.bind(user)
}));
}
@@ -95,7 +95,7 @@ export default {
* Delete the user.
*/
deleteAction() {
if (confirm(app.trans('core.forum.user_controls_delete_confirmation'))) {
if (confirm(app.translator.trans('core.forum.user_controls.delete_confirmation'))) {
this.delete().then(() => {
if (app.current instanceof UserPage && app.current.user === this) {
app.history.back();