From 97c4c927acb8b47ba2c9b98d197892c6bd1a9d22 Mon Sep 17 00:00:00 2001 From: McMatts Date: Tue, 8 Mar 2022 12:50:34 -0500 Subject: [PATCH] i18n space strings --- gui/app/components/folder/settings-general.js | 11 ++++++----- .../components/customize/space-admin.hbs | 2 +- .../components/folder/documents-list.hbs | 4 ++-- .../components/folder/settings-delete.hbs | 10 +++++----- .../components/folder/settings-general.hbs | 14 +++++++------- gui/public/i18n/en-US.json | 16 +++++++++++++++- 6 files changed, 36 insertions(+), 21 deletions(-) diff --git a/gui/app/components/folder/settings-general.js b/gui/app/components/folder/settings-general.js index 0eeef891..e347da53 100644 --- a/gui/app/components/folder/settings-general.js +++ b/gui/app/components/folder/settings-general.js @@ -24,6 +24,7 @@ export default Component.extend(AuthMixin, Notifier, { spaceSvc: service('folder'), iconSvc: service('icon'), localStorage: service('localStorage'), + i18n: service(), isSpaceAdmin: computed('permissions', function() { return this.get('permissions.spaceOwner') || this.get('permissions.spaceManage'); }), @@ -120,9 +121,9 @@ export default Component.extend(AuthMixin, Notifier, { let folder = this.get('space'); let spaceTypeOptions = A([]); - spaceTypeOptions.pushObject({id: constants.SpaceType.Private, label: 'Private - viewable only by me'}); - spaceTypeOptions.pushObject({id: constants.SpaceType.Protected, label: 'Protected - access is restricted to selected users'}); - spaceTypeOptions.pushObject({id: constants.SpaceType.Public, label: 'Public - can be seen by everyone'}); + spaceTypeOptions.pushObject({id: constants.SpaceType.Private, label: this.i18n.localize('personal_explain')}); + spaceTypeOptions.pushObject({id: constants.SpaceType.Protected, label: this.i18n.localize('protected_explain')}); + spaceTypeOptions.pushObject({id: constants.SpaceType.Public, label: this.i18n.localize('public_explain')}); this.set('spaceTypeOptions', spaceTypeOptions); this.set('spaceType', spaceTypeOptions.findBy('id', folder.get('spaceType'))); @@ -131,7 +132,7 @@ export default Component.extend(AuthMixin, Notifier, { if (this.get('allowLikes')) { this.set('likes', folder.get('likes')); } else { - this.set('likes', 'Did this help you?'); + this.set('likes', this.i18n.localize('likes_prompt')); } this.set('spaceName', this.get('space.name')); @@ -184,7 +185,7 @@ export default Component.extend(AuthMixin, Notifier, { space.set('labelId', this.get('spaceLabel')); this.get('spaceSvc').save(space).then(() => { - this.notifySuccess('Saved'); + this.notifySuccess(this.i18n.localize('saved')); }); } } diff --git a/gui/app/templates/components/customize/space-admin.hbs b/gui/app/templates/components/customize/space-admin.hbs index db30faec..fb5b459e 100644 --- a/gui/app/templates/components/customize/space-admin.hbs +++ b/gui/app/templates/components/customize/space-admin.hbs @@ -25,7 +25,7 @@ {{#ui/ui-toolbar dark=false light=true raised=true large=false bordered=true}} {{ui/ui-toolbar-icon icon=constants.Icon.AddUser color=constants.Color.Green tooltip=(localize 'space_admin_make_owner') onClick=(action "onOwner" space.id)}} - {{ui/ui-toolbar-icon icon=constants.Icon.Delete color=constants.Color.Red tooltip=(localize 'space_admin_delete') onClick=(action "onShow" space.id)}} + {{ui/ui-toolbar-icon icon=constants.Icon.Delete color=constants.Color.Red tooltip=(localize 'space_delete') onClick=(action "onShow" space.id)}} {{/ui/ui-toolbar}} diff --git a/gui/app/templates/components/folder/documents-list.hbs b/gui/app/templates/components/folder/documents-list.hbs index 4a1173cb..f75b53ef 100644 --- a/gui/app/templates/components/folder/documents-list.hbs +++ b/gui/app/templates/components/folder/documents-list.hbs @@ -129,11 +129,11 @@ {{#ui/ui-dialog title=(localize 'delete_documents') confirmCaption=(localize 'delete') buttonColor=constants.Color.Red show=showDeleteDialog onAction=(action "onDeleteDocuments")}} -

Are you sure you want to delete {{selectedDocuments.length}} {{selectedCaption}}?

+

{{localize 'delete_confirm'}} ({{selectedDocuments.length}} {{selectedCaption}})

{{/ui/ui-dialog}} {{#ui/ui-dialog title=(localize 'move_documents') confirmCaption=(localize 'move') buttonColor=constants.Color.Green show=showMoveDialog onAction=(action "onMoveDocuments")}} -

Select space for {{selectedDocuments.length}} {{selectedCaption}}

+

{{localize 'space_change_prompt'}} ({{selectedDocuments.length}} {{selectedCaption}})

{{ui/ui-list-picker items=moveOptions nameField="name" singleSelect=true}} {{/ui/ui-dialog}} diff --git a/gui/app/templates/components/folder/settings-delete.hbs b/gui/app/templates/components/folder/settings-delete.hbs index 83675430..c4f87149 100644 --- a/gui/app/templates/components/folder/settings-delete.hbs +++ b/gui/app/templates/components/folder/settings-delete.hbs @@ -1,13 +1,13 @@ {{layout/logo-heading - title="Delete Space" - desc="Proceed with caution as there is no undo" + title=(localize 'delete_space') + desc=(localize 'no_undo') icon=constants.Icon.Delete}}
- - {{focus-input id="delete-space-name" type="text" value=deleteSpaceName class="form-control mousetrap" placeholder="Space name" autocomplete="off"}} - This will delete all documents and templates within this space! + + {{focus-input id="delete-space-name" type="text" value=deleteSpaceName class="form-control mousetrap" placeholder=(localize 'name') autocomplete="off"}} + {{localize 'space_delete_warn'}}
diff --git a/gui/app/templates/components/folder/settings-general.hbs b/gui/app/templates/components/folder/settings-general.hbs index 56b61bfa..6598ea80 100644 --- a/gui/app/templates/components/folder/settings-general.hbs +++ b/gui/app/templates/components/folder/settings-general.hbs @@ -5,19 +5,19 @@
- + {{focus-input id="space-name" type="text" value=spaceName class=(if hasNameError "form-control is-invalid" "form-control") placeholder="Space name" autocomplete="off"}}
- +
{{{spaceDesc}}}
- + {{ui/ui-select id="spacetypes-dropdown" content=spaceTypeOptions optionValuePath="id" optionLabelPath="label" selection=spaceType action=(action "onSetSpaceType")}}
@@ -37,7 +37,7 @@
    -
  • None
  • +
  • {{localize 'none'}}
  • {{#each labels as |label|}}
  • - + {{x-toggle value=allowLikes size="medium" theme="light" onToggle=(action (mut allowLikes))}}
    {{#if allowLikes}}
    - {{input type="text" id="space-likes-prompt" class="form-control" placeholder="Enter prompt asking for user feedback" value=likes}} - Specify the prompt, e.g. Did this help you? Was this helpful? Did you find what you needed? + {{input type="text" id="space-likes-prompt" class="form-control" placeholder=(localize 'feedback_prompt_hint') value=likes}} + {{localize 'feedback_prompt_explain'}}
    {{/if}}
  • diff --git a/gui/public/i18n/en-US.json b/gui/public/i18n/en-US.json index cf72c57d..ee6643b2 100644 --- a/gui/public/i18n/en-US.json +++ b/gui/public/i18n/en-US.json @@ -66,6 +66,7 @@ "description": "Description", "icon": "Icon", "color": "Color", + "visibility": "Visibility", "running": "Running...", "firstname": "Firstname", "lastname": "Lastname", @@ -97,10 +98,14 @@ "references": "references", "move_up": "Move up", "move_down": "Move down", + "no_undo": "Proceed with caution as there is no undo", "public": "Public", + "public_explain": "Public - can be seen by everyone", "protected": "Protected", + "protected_explain": "Protected - access is restricted to selected users", "personal": "Personal", + "personal_explain": "Personal - viewable only by me", "label": "Label", "labels": "Labels", "labels_none": "No labels", @@ -146,11 +151,15 @@ "add_recent": "Added recently", "update_recent": "Updated recently", "space_change": "Move to another space", + "space_change_prompt": "Select space", "space_new": "New Space", "space_name": "Space name", "space_description": "Space description", "space_clone": "Clone Space", "space_select": "Select Space", + "space_delete": "Delete space", + "space_delete_prompt": "Please type space name to confirm", + "space_delete_warn": "This will delete all documents and templates within this space!", "space_copy": "Copy templates, permissions, documents from existing space", "space_copy_template": "Copy templates", "space_copy_permission": "Copy permissions", @@ -171,6 +180,12 @@ "content_revisions_explain": "Review previous content changes and roll back edits", "move_documents": "Move documents", "delete_documents": "Delete documents", + "feedback_enable": "Enable Feedback", + "feedback_prompt": "Feedback Prompt", + "feedback_prompt_hint": "Enter prompt asking for user feedback", + "feedback_prompt_explain": "Specify the prompt, e.g. Did this help you? Was this helpful? Did you find what you needed?", + "likes_prompt": "Did this help you?", + "delete_confirm": "Are you sure you want to delete?", "login_cas": "Authenticating with CAS...", "login_cass_error": "CAS authentication failure", @@ -281,7 +296,6 @@ "space_admin_export": "Export All Content", "space_admin_export_running": "Export running....", "space_admin_make_owner": "Add myself as owner", - "space_admin_delete": "Delete space", "space_admin_empty": "There are no shared spaces to manage", "space_admin_delete_title": "Space Deletion", "space_admin_delete_check": "Are you sure you want to delete this space and all documents?",