From bca7794c0030d7299e5259e370bd24e9c5c702b3 Mon Sep 17 00:00:00 2001 From: McMatts Date: Wed, 9 Mar 2022 15:20:16 -0500 Subject: [PATCH] i18n doc strings --- .../components/document/sidebar-attachment.js | 5 ++-- .../components/document/settings-category.hbs | 6 ++--- .../components/document/settings-general.hbs | 14 +++++------ .../components/document/settings-tag.hbs | 8 +++---- .../document/sidebar-attachment.hbs | 6 ++--- .../components/document/sidebar-toc.hbs | 6 ++--- .../components/document/view-content.hbs | 8 +++---- .../components/document/view-revision.hbs | 6 ++--- gui/public/i18n/en-US.json | 23 ++++++++++++++++--- 9 files changed, 50 insertions(+), 32 deletions(-) diff --git a/gui/app/components/document/sidebar-attachment.js b/gui/app/components/document/sidebar-attachment.js index 2d9de920..fd792f08 100644 --- a/gui/app/components/document/sidebar-attachment.js +++ b/gui/app/components/document/sidebar-attachment.js @@ -22,6 +22,7 @@ export default Component.extend(Modals, Notifier, { browserSvc: service('browser'), appMeta: service(), session: service(), + i18n: service(), hasAttachments: notEmpty('files'), canEdit: computed('permissions.{documentApprove,documentEdit}', 'document.protection', function() { // Check to see if specific scenarios prevent us from changing doc level attachments. @@ -86,7 +87,7 @@ export default Component.extend(Modals, Notifier, { }); this.on("queuecomplete", function () { - self.notifySuccess('Uploaded file'); + self.notifySuccess(this.i18n.localize('uploaded')); self.getAttachments(); }); @@ -115,7 +116,7 @@ export default Component.extend(Modals, Notifier, { actions: { onDelete(attachment) { this.get('documentService').deleteAttachment(this.get('document.id'), attachment.id).then(() => { - this.notifySuccess('File deleted'); + this.notifySuccess(this.i18n.localize('deleted')); this.getAttachments(); }); } diff --git a/gui/app/templates/components/document/settings-category.hbs b/gui/app/templates/components/document/settings-category.hbs index 187f185e..1084ce6e 100644 --- a/gui/app/templates/components/document/settings-category.hbs +++ b/gui/app/templates/components/document/settings-category.hbs @@ -1,6 +1,6 @@ {{layout/logo-heading - title="Categories" - desc="Assign one or more categories to help organize content within this space" + title=(localize 'categories') + desc=(localize 'doc_category_explain') icon=constants.Icon.Category}} {{#if categories}} @@ -15,5 +15,5 @@ light=true onClick=(action "onSave")}} {{else}} -

This space has no categories yet

+

{{localize 'category_none'}}

{{/if}} diff --git a/gui/app/templates/components/document/settings-general.hbs b/gui/app/templates/components/document/settings-general.hbs index 8741b1c4..68b4fdb1 100644 --- a/gui/app/templates/components/document/settings-general.hbs +++ b/gui/app/templates/components/document/settings-general.hbs @@ -1,19 +1,19 @@ {{layout/logo-heading - title="Content Settings" - desc="Set name, description and lifecycle stage" + title=(localize 'content') + desc=(localize 'setings') icon=constants.Icon.Settings}}
- + {{focus-input id="document-name" type="text" value=docName - class=(if hasNameError "form-control mousetrap is-invalid" "form-control mousetrap") placeholder="Title" autocomplete="off"}} + class=(if hasNameError "form-control mousetrap is-invalid" "form-control mousetrap") placeholder="" autocomplete="off"}}
- - {{textarea id="document-excerpt" rows="4" value=docExcerpt class="form-control mousetrap" placeholder="Excerpt" autocomplete="off"}} - Optional description explaining content + + {{textarea id="document-excerpt" rows="4" value=docExcerpt class="form-control mousetrap" placeholder="" autocomplete="off"}} + {{localize 'excerpt'}}
{{ui/ui-button diff --git a/gui/app/templates/components/document/settings-tag.hbs b/gui/app/templates/components/document/settings-tag.hbs index b5a5cf9f..1c40836f 100644 --- a/gui/app/templates/components/document/settings-tag.hbs +++ b/gui/app/templates/components/document/settings-tag.hbs @@ -1,7 +1,7 @@ {{layout/logo-heading - title="Tags" - desc=(concat "Specify up to " appMeta.maxTags " tags — lowercase, characters, numbers, hyphens only") - icon=constants.Icon.Category}} + title=(localize 'tags') + desc=(localize 'tag_rules' appMeta.maxTags) + icon=constants.Icon.Tag}} {{#each tagz as |tag|}}
@@ -10,7 +10,7 @@
- {{input type="text" id=(concat "add-tag-field-" tag.number) class="form-control mousetrap tag-input" placeholder="Tag name" value=tag.value}} + {{input type="text" id=(concat "add-tag-field-" tag.number) class="form-control mousetrap tag-input" placeholder=(localize 'tag') value=tag.value}} {{/each}} diff --git a/gui/app/templates/components/document/sidebar-attachment.hbs b/gui/app/templates/components/document/sidebar-attachment.hbs index 5142f7b7..adefb36f 100644 --- a/gui/app/templates/components/document/sidebar-attachment.hbs +++ b/gui/app/templates/components/document/sidebar-attachment.hbs @@ -1,6 +1,6 @@ {{#if (or hasAttachments canEdit)}} -
attachments
+
{{localize 'attachments'}}
    {{#each files key="id" as |file|}} @@ -14,7 +14,7 @@ {{#attach-popover class="ember-attacher-popper" hideOn="escapekey, clickout" showOn="click" isShown=false}}
    -

    Are you sure you want to delete this file?

    +

    {{localize 'attachment_delete_confirm'}}

    {{ui/ui-button light=false @@ -31,7 +31,7 @@ {{/each}} {{#if canEdit}}
  • - +
  • {{/if}}
diff --git a/gui/app/templates/components/document/sidebar-toc.hbs b/gui/app/templates/components/document/sidebar-toc.hbs index f8dbe412..83bd6800 100644 --- a/gui/app/templates/components/document/sidebar-toc.hbs +++ b/gui/app/templates/components/document/sidebar-toc.hbs @@ -1,4 +1,4 @@ -
table of contents
+
{{localize 'toc'}}
{{#if canEdit}}
@@ -29,11 +29,11 @@ title={{item.page.title}}> {{item.page.numbering}} {{#if (or item.userHasChangePending userHasNewPagePending)}} - [*]  + [*]  {{/if}} {{#if (or permissions.documentApprove roles.documentApprove)}} {{#if item.changeAwaitingReview}} - [*]  + [*]  {{/if}} {{/if}} {{item.page.title}} diff --git a/gui/app/templates/components/document/view-content.hbs b/gui/app/templates/components/document/view-content.hbs index 4d13a3f5..81da84c2 100644 --- a/gui/app/templates/components/document/view-content.hbs +++ b/gui/app/templates/components/document/view-content.hbs @@ -33,21 +33,21 @@ {{#if canEdit}}
- +
{{/if}} {{#if showLikes}}
{{#if voteThanks}} -
Thanks for the feedback!
+
{{localize 'feedback_thanks'}}
{{else}}
{{folder.likes}}
- {{ui/ui-button color=constants.Color.Yellow light=true label="Yes, thanks!" onClick=(action "onVote" 1)}} + {{ui/ui-button color=constants.Color.Yellow light=true label=(localize 'feedback_help_yes') onClick=(action "onVote" 1)}} {{ui/ui-button-gap}} - {{ui/ui-button color=constants.Color.Yellow light=true label="Not really" onClick=(action "onVote" 2)}} + {{ui/ui-button color=constants.Color.Yellow light=true label=(localize 'feedback_help_no') onClick=(action "onVote" 2)}}
{{/if}}
diff --git a/gui/app/templates/components/document/view-revision.hbs b/gui/app/templates/components/document/view-revision.hbs index bf8aa249..1fa59455 100644 --- a/gui/app/templates/components/document/view-revision.hbs +++ b/gui/app/templates/components/document/view-revision.hbs @@ -1,5 +1,5 @@ {{#unless revisions}} -

No revisions made

+

{{localize 'revision_none'}}

{{/unless}}
@@ -21,9 +21,9 @@