From f53c46f85ccd7d1d3d8e5fcfebabca1020f4f8df Mon Sep 17 00:00:00 2001 From: dcsjapan Date: Tue, 6 Oct 2015 05:52:03 +0900 Subject: [PATCH 1/2] Extract leftover core strings Adds app.trans calls for a couple strings in core: - The "there are no discussions" message in DiscussionList.js - The user deletion confirmation message in UserControls.js - Also adds new HTML-style tags to LogInModal.js and SignUpModal.js --- framework/core/js/forum/src/components/DiscussionList.js | 2 +- framework/core/js/forum/src/components/LogInModal.js | 3 +-- framework/core/js/forum/src/components/SignUpModal.js | 3 +-- framework/core/js/forum/src/utils/UserControls.js | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/framework/core/js/forum/src/components/DiscussionList.js b/framework/core/js/forum/src/components/DiscussionList.js index fdce20c09..7d7ed827d 100644 --- a/framework/core/js/forum/src/components/DiscussionList.js +++ b/framework/core/js/forum/src/components/DiscussionList.js @@ -55,7 +55,7 @@ export default class DiscussionList extends Component { } if (this.discussions.length === 0 && !this.loading) { - const text = 'Looks like there are no discussions here. Why don\'t you create a new one?'; + const text = app.trans('core.admin.discussion_list_empty_text'); return (
{Placeholder.component({text})} diff --git a/framework/core/js/forum/src/components/LogInModal.js b/framework/core/js/forum/src/components/LogInModal.js index a1bac124c..a2fb926bb 100644 --- a/framework/core/js/forum/src/components/LogInModal.js +++ b/framework/core/js/forum/src/components/LogInModal.js @@ -78,8 +78,7 @@ export default class LogInModal extends Modal { {app.forum.attribute('allowSignUp') ? (

- {app.trans('core.forum.log_in_no_account_text')} - {app.trans('core.forum.log_in_sign_up_link')} + {app.trans('core.forum.log_in_sign_up_text', {a: })}

) : ''}
diff --git a/framework/core/js/forum/src/components/SignUpModal.js b/framework/core/js/forum/src/components/SignUpModal.js index c81f2eb6d..b56821ece 100644 --- a/framework/core/js/forum/src/components/SignUpModal.js +++ b/framework/core/js/forum/src/components/SignUpModal.js @@ -140,8 +140,7 @@ export default class SignUpModal extends Modal { footer() { return [

- {app.trans('core.forum.sign_up_already_have_account_text')} - {app.trans('core.forum.sign_up_log_in_link')} + {app.trans('core.forum.sign_up_log_in_text', {a: })}

]; } diff --git a/framework/core/js/forum/src/utils/UserControls.js b/framework/core/js/forum/src/utils/UserControls.js index ea5f855ad..835494708 100644 --- a/framework/core/js/forum/src/utils/UserControls.js +++ b/framework/core/js/forum/src/utils/UserControls.js @@ -95,7 +95,7 @@ export default { * Delete the user. */ deleteAction() { - if (confirm('Are you sure you want to delete this user? All of the user\'s posts will be deleted.')) { + if (confirm(app.trans('core.admin.user_controls_delete_confirmation'))) { this.delete().then(() => { if (app.current instanceof UserPage && app.current.user === this) { app.history.back(); From ed2ee7de4c7fb5d0da359cc9376272f120bbd8b4 Mon Sep 17 00:00:00 2001 From: dcsjapan Date: Tue, 6 Oct 2015 09:56:12 +0900 Subject: [PATCH 2/2] Fixes namespace errors in keys for the two extracted strings. --- framework/core/js/forum/src/components/DiscussionList.js | 2 +- framework/core/js/forum/src/utils/UserControls.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/core/js/forum/src/components/DiscussionList.js b/framework/core/js/forum/src/components/DiscussionList.js index 7d7ed827d..91d743ee9 100644 --- a/framework/core/js/forum/src/components/DiscussionList.js +++ b/framework/core/js/forum/src/components/DiscussionList.js @@ -55,7 +55,7 @@ export default class DiscussionList extends Component { } if (this.discussions.length === 0 && !this.loading) { - const text = app.trans('core.admin.discussion_list_empty_text'); + const text = app.trans('core.forum.discussion_list_empty_text'); return (
{Placeholder.component({text})} diff --git a/framework/core/js/forum/src/utils/UserControls.js b/framework/core/js/forum/src/utils/UserControls.js index 835494708..a420eaa9a 100644 --- a/framework/core/js/forum/src/utils/UserControls.js +++ b/framework/core/js/forum/src/utils/UserControls.js @@ -95,7 +95,7 @@ export default { * Delete the user. */ deleteAction() { - if (confirm(app.trans('core.admin.user_controls_delete_confirmation'))) { + if (confirm(app.trans('core.forum.user_controls_delete_confirmation'))) { this.delete().then(() => { if (app.current instanceof UserPage && app.current.user === this) { app.history.back();