From 5e687f5ef428b88f4ac109b1372f10f1f49266b5 Mon Sep 17 00:00:00 2001 From: McMatts Date: Tue, 8 Mar 2022 13:05:30 -0500 Subject: [PATCH] i18n space strings --- gui/app/components/folder/settings-blocks.js | 3 +- .../components/folder/settings-category.js | 3 +- .../components/customize/user-list.hbs | 2 +- .../document/section-attachment.hbs | 2 +- .../components/folder/settings-blocks.hbs | 12 +++---- .../components/folder/settings-category.hbs | 35 +++++++++---------- gui/public/i18n/en-US.json | 11 ++++++ 7 files changed, 40 insertions(+), 28 deletions(-) diff --git a/gui/app/components/folder/settings-blocks.js b/gui/app/components/folder/settings-blocks.js index d2b28a15..7d10a6b1 100644 --- a/gui/app/components/folder/settings-blocks.js +++ b/gui/app/components/folder/settings-blocks.js @@ -19,6 +19,7 @@ export default Component.extend(AuthMixin, Notifier, { router: service(), spaceSvc: service('folder'), sectionSvc: service('section'), + i18n: service(), showDeleteDialog: false, deleteBlockId: '', @@ -54,7 +55,7 @@ export default Component.extend(AuthMixin, Notifier, { this.get('sectionSvc').deleteBlock(id).then(() => { this.set('deleteBlockId', ''); - this.notifySuccess('Deleted'); + this.notifySuccess(this.i18n.localize('deleted')); this.get('sectionSvc').getSpaceBlocks(this.get('space.id')).then((blocks) => { this.set('blocks', blocks); diff --git a/gui/app/components/folder/settings-category.js b/gui/app/components/folder/settings-category.js index c540c775..d705296c 100644 --- a/gui/app/components/folder/settings-category.js +++ b/gui/app/components/folder/settings-category.js @@ -22,6 +22,7 @@ export default Component.extend(ModalMixin, Notifer, { categorySvc: service('category'), appMeta: service(), store: service(), + i18n: service(), editId: '', editName: '', editDefault: false, @@ -120,7 +121,7 @@ export default Component.extend(ModalMixin, Notifer, { this.get('categorySvc').add(c).then(() => { this.load(); - this.notifySuccess('Category added'); + this.notifySuccess(this.i18n.localize('added')); }); }, diff --git a/gui/app/templates/components/customize/user-list.hbs b/gui/app/templates/components/customize/user-list.hbs index 38db8acc..4e593a54 100644 --- a/gui/app/templates/components/customize/user-list.hbs +++ b/gui/app/templates/components/customize/user-list.hbs @@ -165,7 +165,7 @@ -{{#ui/ui-dialog title="Delete User" confirmCaption="Delete" buttonColor=constants.Color.Red show=showDeleteDialog onAction=(action "onDelete")}} +{{#ui/ui-dialog title="Delete User" confirmCaption=(localize 'delete') buttonColor=constants.Color.Red show=showDeleteDialog onAction=(action "onDelete")}}

{{localize 'user_delete_confirm' deleteUser.fullname}}

{{/ui/ui-dialog}} diff --git a/gui/app/templates/components/document/section-attachment.hbs b/gui/app/templates/components/document/section-attachment.hbs index e6a45e2e..a99120c1 100644 --- a/gui/app/templates/components/document/section-attachment.hbs +++ b/gui/app/templates/components/document/section-attachment.hbs @@ -34,6 +34,6 @@ {{/each}} -{{#ui/ui-dialog title="Delete Attachment" confirmCaption="Delete" buttonColor=constants.Color.Red show=showDialog onAction=(action "onDelete")}} +{{#ui/ui-dialog title="Delete Attachment" confirmCaption=(localize 'delete') buttonColor=constants.Color.Red show=showDialog onAction=(action "onDelete")}}

Are you sure you want to delete this attachment?

{{/ui/ui-dialog}} diff --git a/gui/app/templates/components/folder/settings-blocks.hbs b/gui/app/templates/components/folder/settings-blocks.hbs index 580c297e..17c89c5f 100644 --- a/gui/app/templates/components/folder/settings-blocks.hbs +++ b/gui/app/templates/components/folder/settings-blocks.hbs @@ -1,6 +1,6 @@ {{layout/logo-heading - title="Content Blocks" - desc="Content blocks provide re-usable content that can be inserted into any document" + title=(localize 'blocks') + desc=(localize 'blocks_explain') icon=constants.Icon.Blocks}}
@@ -10,8 +10,8 @@
{{block.title}}
{{block.excerpt}}
{{#ui/ui-toolbar dark=false light=true raised=true large=false bordered=true}} - {{ui/ui-toolbar-icon icon=constants.Icon.Edit color=constants.Color.Gray tooltip="Edit block" onClick=(action "onEdit" block.id)}} - {{ui/ui-toolbar-icon icon=constants.Icon.Delete color=constants.Color.Red tooltip="Delete block" onClick=(action "onShowDeleteDialog" block.id)}} + {{ui/ui-toolbar-icon icon=constants.Icon.Edit color=constants.Color.Gray tooltip=(localize 'edit') onClick=(action "onEdit" block.id)}} + {{ui/ui-toolbar-icon icon=constants.Icon.Delete color=constants.Color.Red tooltip=(localize 'delete') onClick=(action "onShowDeleteDialog" block.id)}} {{/ui/ui-toolbar}}
{{/each}} @@ -19,7 +19,7 @@ {{#if isSpaceAdmin}} - {{#ui/ui-dialog title="Delete Content Block" confirmCaption="Delete" buttonColor=constants.Color.Red show=showDeleteDialog onAction=(action "onDeleteBlock")}} -

Are you sure you want to delete this re-usable content block?

+ {{#ui/ui-dialog title="Delete Content Block" confirmCaption=(localize 'delete') buttonColor=constants.Color.Red show=showDeleteDialog onAction=(action "onDeleteBlock")}} +

{{localize 'block_delete_confirm'}}

{{/ui/ui-dialog}} {{/if}} diff --git a/gui/app/templates/components/folder/settings-category.hbs b/gui/app/templates/components/folder/settings-category.hbs index c31562a6..7dabfd8b 100644 --- a/gui/app/templates/components/folder/settings-category.hbs +++ b/gui/app/templates/components/folder/settings-category.hbs @@ -1,13 +1,13 @@ {{layout/logo-heading - title="Categories" - desc="Assign categories to documents and decide who can view them" + title=(localize 'categories') + desc=(localize 'category_explain') icon=constants.Icon.Category}}
- {{focus-input id="new-category-name" type="text" class="form-control mousetrap" placeholder="Category name" value=newCategory}} + {{focus-input id="new-category-name" type="text" class="form-control mousetrap" placeholder=(localize 'category') value=newCategory}}
{{ui/ui-button color=constants.Color.Green light=true label=(localize 'add') icon=constants.Icon.Category @@ -25,24 +25,23 @@
{{cat.category}}
- Assigned to {{cat.documents}} {{if (eq cat.documents 1) "document" "documents" }} - and viewable by {{cat.users}} users/groups + {{localize 'category_assignment_summary' cat.documents cat.users}}
{{#unless cat.access}} -

You have no view permission for this category

+

{{localize 'category_no_access'}}

{{/unless}} {{#if cat.isDefault}} -

Default category for new content

+

{{localize 'category_default'}}

{{/if}}
{{#ui/ui-toolbar dark=false light=true raised=true large=false bordered=true}} {{ui/ui-toolbar-icon icon=constants.Icon.Locked color=constants.Color.Gray - tooltip="Set view permissions" onClick=(action "onShowAccessPicker" cat.id)}} + tooltip=(localize 'permissions') onClick=(action "onShowAccessPicker" cat.id)}} {{ui/ui-toolbar-icon icon=constants.Icon.Edit color=constants.Color.Gray - tooltip="Edit category" onClick=(action "onShowEdit" cat.id)}} + tooltip=(localize 'edit') onClick=(action "onShowEdit" cat.id)}} {{ui/ui-toolbar-icon icon=constants.Icon.Delete color=constants.Color.Red - tooltip="Delete category" onClick=(action "onShowDelete" cat.id)}} + tooltip=(localize 'delete') onClick=(action "onShowDelete" cat.id)}} {{/ui/ui-toolbar}}
@@ -53,15 +52,15 @@