From ce4f62d34694c7ca1691b4fb4261da01c1675bb4 Mon Sep 17 00:00:00 2001 From: McMatts Date: Tue, 1 Mar 2022 22:03:18 -0500 Subject: [PATCH] [WIP] i18n strings --- gui/app/constants/constants.js | 17 --------- gui/app/models/document.js | 8 +++-- gui/app/models/template.js | 8 +++-- gui/app/pods/folders/template.hbs | 34 +++++++++--------- gui/app/pods/theming/template.hbs | 6 ++-- .../components/customize/auth-settings.hbs | 2 +- .../components/customize/backup-restore.hbs | 2 +- .../components/customize/license-key.hbs | 2 +- .../components/customize/space-admin.hbs | 2 +- .../components/customize/space-labels.hbs | 8 ++--- .../components/customize/user-admin.hbs | 6 ++-- .../components/customize/user-groups.hbs | 4 +-- .../components/document/add-section.hbs | 2 +- .../components/document/document-toolbar.hbs | 8 ++--- .../components/document/page-heading.hbs | 8 ++--- .../components/document/view-revision.hbs | 2 +- .../components/folder/settings-category.hbs | 2 +- .../components/folder/space-toolbar.hbs | 12 +++---- .../components/section/gemini/type-editor.hbs | 2 +- .../section/papertrail/type-editor.hbs | 2 +- .../section/tabular/type-editor.hbs | 2 +- .../components/section/trello/type-editor.hbs | 2 +- gui/public/i18n/en-US.json | 36 +++++++++++++++++-- 23 files changed, 98 insertions(+), 79 deletions(-) diff --git a/gui/app/constants/constants.js b/gui/app/constants/constants.js index cc56eac4..4640593a 100644 --- a/gui/app/constants/constants.js +++ b/gui/app/constants/constants.js @@ -68,10 +68,6 @@ let constants = EmberObject.extend({ None: 0, Lock: 1, Review: 2, - - NoneLabel: 'Changes permitted without approval', - LockLabel: 'Locked, changes not permitted', - ReviewLabel: 'Changes require approval before publication' }, // Document @@ -80,10 +76,6 @@ let constants = EmberObject.extend({ Anybody: 1, Majority: 2, Unanimous: 3, - - AnybodyLabel: 'Approval required from any approver', - MajorityLabel: 'Majority approval required from approvers', - UnanimousLabel: 'Unanimous approval required from all approvers' }, // Section @@ -115,10 +107,6 @@ let constants = EmberObject.extend({ Draft: 0, Live: 1, Archived: 2, - - DraftLabel: 'Draft', - LiveLabel: 'Live', - ArchivedLabel: 'Archived', }, // Document Version -- document.groupId links different versions of documents together @@ -320,11 +308,6 @@ let constants = EmberObject.extend({ }, Label: { // eslint-disable-line ember/avoid-leaking-state-in-ember-objects - Add: 'Add', - Activate: "Activate", - Approve: 'Approve', - Authenticate: 'Authenticate', - Cancel: 'Cancel', Close: 'Close', Copy: 'Copy', Delete: 'Delete', diff --git a/gui/app/models/document.js b/gui/app/models/document.js index 03d93406..82015d05 100644 --- a/gui/app/models/document.js +++ b/gui/app/models/document.js @@ -57,13 +57,15 @@ export default Model.extend({ lifecycleLabel: computed('lifecycle', function () { let constants = this.get('constants'); + let i18n = this.get('i18n'); + switch (this.get('lifecycle')) { case constants.Lifecycle.Draft: - return constants.Lifecycle.DraftLabel; + return i18n.localize('draft'); case constants.Lifecycle.Live: - return constants.Lifecycle.LiveLabel; + return i18n.localize('live'); case constants.Lifecycle.Archived: - return constants.Lifecycle.ArchivedLabel; + return i18n.localize('archived'); } return ''; diff --git a/gui/app/models/template.js b/gui/app/models/template.js index 5e170e6c..01deaeea 100644 --- a/gui/app/models/template.js +++ b/gui/app/models/template.js @@ -53,13 +53,15 @@ export default Model.extend({ lifecycleLabel: computed('lifecycle', function () { let constants = this.get('constants'); + let i18n = this.get('i18n'); + switch (this.get('lifecycle')) { case constants.Lifecycle.Draft: - return constants.Lifecycle.DraftLabel; + return i18n.localize('draft'); case constants.Lifecycle.Live: - return constants.Lifecycle.LiveLabel; + return i18n.localize('live'); case constants.Lifecycle.Archived: - return constants.Lifecycle.ArchivedLabel; + return i18n.localize('archived'); } return ''; diff --git a/gui/app/pods/folders/template.hbs b/gui/app/pods/folders/template.hbs index ddf1d05b..923f1696 100644 --- a/gui/app/pods/folders/template.hbs +++ b/gui/app/pods/folders/template.hbs @@ -62,7 +62,7 @@ {{/each}} {{else}} -
{{localize 'no_labels'}}
+
{{localize 'labels_none'}}
{{/if}} @@ -76,22 +76,22 @@ diff --git a/gui/app/templates/components/customize/license-key.hbs b/gui/app/templates/components/customize/license-key.hbs index 2ff1049e..ced30f05 100644 --- a/gui/app/templates/components/customize/license-key.hbs +++ b/gui/app/templates/components/customize/license-key.hbs @@ -126,7 +126,7 @@ diff --git a/gui/app/templates/components/customize/space-admin.hbs b/gui/app/templates/components/customize/space-admin.hbs index a3f845ef..3ae9659b 100644 --- a/gui/app/templates/components/customize/space-admin.hbs +++ b/gui/app/templates/components/customize/space-admin.hbs @@ -48,7 +48,7 @@ diff --git a/gui/app/templates/components/customize/space-labels.hbs b/gui/app/templates/components/customize/space-labels.hbs index 63c41519..c5f50cfd 100644 --- a/gui/app/templates/components/customize/space-labels.hbs +++ b/gui/app/templates/components/customize/space-labels.hbs @@ -3,7 +3,7 @@ light=true color=constants.Color.Green icon=constants.Icon.Checkbox - label=constants.Label.Add + label=(localize 'add') onClick=(action "onShowAddModal")}} @@ -42,9 +42,9 @@ @@ -65,7 +65,7 @@ diff --git a/gui/app/templates/components/customize/user-admin.hbs b/gui/app/templates/components/customize/user-admin.hbs index a287664c..6e8bd10c 100644 --- a/gui/app/templates/components/customize/user-admin.hbs +++ b/gui/app/templates/components/customize/user-admin.hbs @@ -1,6 +1,6 @@
{{#if (or isAuthProviderDocumize isDualAuth)}} - {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Person label=constants.Label.Add onClick=(action "onOpenUserModal")}} + {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Person label=(localize 'add') onClick=(action "onOpenUserModal")}} - {{ui/ui-button color=constants.Color.Green icon=constants.Icon.People light=true label=constants.Label.Add onClick=(action "onAddUsers")}} + {{ui/ui-button color=constants.Color.Green icon=constants.Icon.People light=true label=(localize 'add') onClick=(action "onAddUsers")}}
diff --git a/gui/app/templates/components/document/document-toolbar.hbs b/gui/app/templates/components/document/document-toolbar.hbs index 41f75bd5..d614d839 100644 --- a/gui/app/templates/components/document/document-toolbar.hbs +++ b/gui/app/templates/components/document/document-toolbar.hbs @@ -87,7 +87,7 @@ @@ -108,7 +108,7 @@ {{/each}} @@ -124,7 +124,7 @@

Are you sure you want to delete this document?

@@ -146,7 +146,7 @@ diff --git a/gui/app/templates/components/document/page-heading.hbs b/gui/app/templates/components/document/page-heading.hbs index 8c7a5e30..06d75c58 100644 --- a/gui/app/templates/components/document/page-heading.hbs +++ b/gui/app/templates/components/document/page-heading.hbs @@ -82,7 +82,7 @@ @@ -109,7 +109,7 @@ @@ -135,7 +135,7 @@ @@ -162,7 +162,7 @@ diff --git a/gui/app/templates/components/document/view-revision.hbs b/gui/app/templates/components/document/view-revision.hbs index 6304d99f..a357010e 100644 --- a/gui/app/templates/components/document/view-revision.hbs +++ b/gui/app/templates/components/document/view-revision.hbs @@ -26,7 +26,7 @@

Are you sure you want to restore this revision?

diff --git a/gui/app/templates/components/folder/settings-category.hbs b/gui/app/templates/components/folder/settings-category.hbs index 91392a8d..a7198422 100644 --- a/gui/app/templates/components/folder/settings-category.hbs +++ b/gui/app/templates/components/folder/settings-category.hbs @@ -10,7 +10,7 @@ {{focus-input id="new-category-name" type="text" class="form-control mousetrap" placeholder="Category name" value=newCategory}} {{ui/ui-button color=constants.Color.Green light=true - label=constants.Label.Add icon=constants.Icon.Category + label=(localize 'add') icon=constants.Icon.Category onClick=(action "onAdd")}} diff --git a/gui/app/templates/components/folder/space-toolbar.hbs b/gui/app/templates/components/folder/space-toolbar.hbs index 7218a693..ed5d752d 100644 --- a/gui/app/templates/components/folder/space-toolbar.hbs +++ b/gui/app/templates/components/folder/space-toolbar.hbs @@ -49,9 +49,9 @@ @@ -83,9 +83,9 @@ @@ -111,7 +111,7 @@ @@ -132,7 +132,7 @@ {{/if}} diff --git a/gui/app/templates/components/section/gemini/type-editor.hbs b/gui/app/templates/components/section/gemini/type-editor.hbs index 69cb2b3b..14d35e54 100644 --- a/gui/app/templates/components/section/gemini/type-editor.hbs +++ b/gui/app/templates/components/section/gemini/type-editor.hbs @@ -21,7 +21,7 @@ {{input id="gemini-apikey" type="password" value=config.APIKey class="form-control"}} Gemini user API key (from user profile) - {{ui/ui-button color=constants.Color.Green light=true label=constants.Label.Authenticate onClick=(action "auth")}} + {{ui/ui-button color=constants.Color.Green light=true label=(localize 'authenticate') onClick=(action "auth")}}
{{#if authenticated}} diff --git a/gui/app/templates/components/section/papertrail/type-editor.hbs b/gui/app/templates/components/section/papertrail/type-editor.hbs index 009dfd62..e5df209a 100644 --- a/gui/app/templates/components/section/papertrail/type-editor.hbs +++ b/gui/app/templates/components/section/papertrail/type-editor.hbs @@ -14,7 +14,7 @@ {{focus-input id="papertrail-apitoken" type="password" value=config.APIToken class="form-control"}} API Token (from your profile)
- {{ui/ui-button color=constants.Color.Green light=true label=constants.Label.Authenticate onClick=(action "auth")}} + {{ui/ui-button color=constants.Color.Green light=true label=(localize 'authenticate') onClick=(action "auth")}}
diff --git a/gui/app/templates/components/section/tabular/type-editor.hbs b/gui/app/templates/components/section/tabular/type-editor.hbs index 52a09cea..98db075f 100644 --- a/gui/app/templates/components/section/tabular/type-editor.hbs +++ b/gui/app/templates/components/section/tabular/type-editor.hbs @@ -41,7 +41,7 @@
diff --git a/gui/app/templates/components/section/trello/type-editor.hbs b/gui/app/templates/components/section/trello/type-editor.hbs index 351da23d..cdd03543 100644 --- a/gui/app/templates/components/section/trello/type-editor.hbs +++ b/gui/app/templates/components/section/trello/type-editor.hbs @@ -35,7 +35,7 @@ {{/if}} {{else}} {{ui/ui-button color=constants.Color.Green light=true - label=constants.Label.Authenticate onClick=(action "auth")}} + label=(localize 'authenticate') onClick=(action "auth")}} {{/if}} {{else}} {{#if session.isGlobalAdmin}} diff --git a/gui/public/i18n/en-US.json b/gui/public/i18n/en-US.json index 5e8fc7ae..2596434f 100644 --- a/gui/public/i18n/en-US.json +++ b/gui/public/i18n/en-US.json @@ -1,12 +1,44 @@ { + "none": "None", + "add": "Add", + "activate": "Activate", + "approve": "Approve", + "authenticate": "Authenticate", + "cancel": "Cancel", + + + "name": "Name", + "description": "Description", + "icon": "Icon", + "draft": "Draft", + "live": "Live", + "archived": "Archived", + "filter": "Filter", "all": "All", "public": "Public", "protected": "Protected", "personal": "Personal", - "label": "Label", - "no_labels": "No labels", + "label": "Label", + "labels_none": "No labels", + + "space_new": "New Space", + "space_name": "Space name", + "space_description": "Space description", + "space_clone": "Clone Space", + "space_select": "Select Space", + "space_copy": "Copy templates, permissions, documents from existing space", + "space_copy_template": "Copy templates", + "space_copy_permission": "Copy permissions", + "space_copy_document": "Copy documents", + + "protection_none": "Changes permitted without approval", + "protection_lock": "Locked, changes not permitted", + "protection_review": "Changes require approval before publication", + "approval_anybody": "Approval required from any approver", + "approval_majority": "Majority approval required from approvers", + "approval_unanimous": "Unanimous approval required from all approvers", "z": "z"