From 245c5389904b093bb2598d654a8212aa318ee679 Mon Sep 17 00:00:00 2001 From: McMatts Date: Tue, 1 Mar 2022 16:22:53 -0500 Subject: [PATCH 01/46] Initial i18n experiment --- gui/.eslintrc.js | 6 +++- gui/app/helpers/localize.js | 17 +++++++++++ gui/app/initializers/i18n.js | 19 +++++++++++++ gui/app/models/user.js | 1 + gui/app/pods/auth/login/controller.js | 1 - gui/app/pods/folders/template.hbs | 2 +- gui/app/services/app-meta.js | 1 + gui/app/services/i18n.js | 33 +++++++++++++++++++++ gui/app/services/session.js | 5 ++++ gui/ember-cli-build.js | 12 ++++---- gui/public/i18n/en-US.json | 3 ++ gui/yarn.lock | 41 ++++++++------------------- 12 files changed, 103 insertions(+), 38 deletions(-) create mode 100644 gui/app/helpers/localize.js create mode 100644 gui/app/initializers/i18n.js create mode 100644 gui/app/services/i18n.js create mode 100644 gui/public/i18n/en-US.json diff --git a/gui/.eslintrc.js b/gui/.eslintrc.js index 134bf586..f3117e9b 100644 --- a/gui/.eslintrc.js +++ b/gui/.eslintrc.js @@ -24,7 +24,11 @@ module.exports = { "ember/no-get": "off", "ember/no-jquery": "off", "ember/no-mixins": "off", - "ember/no-actions-hash": "off" + "ember/no-actions-hash": "off", + "ember/require-computed-macros": "off", + "ember/use-ember-data-rfc-395-imports": "off", + "ember/avoid-leaking-state-in-ember-objects": "off", + "ember/require-return-from-computed": "off" }, overrides: [ // node files diff --git a/gui/app/helpers/localize.js b/gui/app/helpers/localize.js new file mode 100644 index 00000000..2a825a91 --- /dev/null +++ b/gui/app/helpers/localize.js @@ -0,0 +1,17 @@ +// Copyright 2022 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// https://www.documize.com + +import Helper from '@ember/component/helper'; +import { inject as service } from '@ember/service'; + +export default Helper.extend({ + i18n: service(), + + compute([key, ...rest]) { + return this.i18n.localize(key, ...rest); + } +}); diff --git a/gui/app/initializers/i18n.js b/gui/app/initializers/i18n.js new file mode 100644 index 00000000..cd9f5b59 --- /dev/null +++ b/gui/app/initializers/i18n.js @@ -0,0 +1,19 @@ +// Copyright 2022 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// https://www.documize.com + +export function initialize(application) { + application.inject('route', 'i18n', 'service:i18n'); + application.inject('controller', 'i18n', 'service:i18n'); + application.inject('component', 'i18n', 'service:i18n'); + application.inject('model', 'i18n', 'service:i18n'); +} + +export default { + name: 'i18n', + after: "application", + initialize: initialize +}; diff --git a/gui/app/models/user.js b/gui/app/models/user.js index 548a0aed..e1c53610 100644 --- a/gui/app/models/user.js +++ b/gui/app/models/user.js @@ -30,6 +30,7 @@ export default Model.extend({ theme: attr('string'), created: attr(), revised: attr(), + locale: attr('string', { defaultValue: "en-US" }), fullname: computed('firstname', 'lastname', function () { return `${this.get('firstname')} ${this.get('lastname')}`; diff --git a/gui/app/pods/auth/login/controller.js b/gui/app/pods/auth/login/controller.js index 50483d53..9599ad5d 100644 --- a/gui/app/pods/auth/login/controller.js +++ b/gui/app/pods/auth/login/controller.js @@ -76,5 +76,4 @@ export default Controller.extend(AuthProvider, { // } } } - }); diff --git a/gui/app/pods/folders/template.hbs b/gui/app/pods/folders/template.hbs index da6c224a..328a8366 100644 --- a/gui/app/pods/folders/template.hbs +++ b/gui/app/pods/folders/template.hbs @@ -23,7 +23,7 @@ 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" From 08f21346c1e74585acf86bf1419f4727282c0f0e Mon Sep 17 00:00:00 2001 From: McMatts Date: Tue, 1 Mar 2022 22:40:51 -0500 Subject: [PATCH 05/46] [WIP] i18n constant strings --- gui/app/constants/constants.js | 40 ------------------- gui/app/pods/auth/login/template.hbs | 2 +- gui/app/pods/folder/index/template.hbs | 2 +- gui/app/pods/folders/template.hbs | 2 +- gui/app/pods/theming/template.hbs | 22 +++++----- .../components/customize/auth-settings.hbs | 2 +- .../components/customize/backup-restore.hbs | 2 +- .../components/customize/general-settings.hbs | 2 +- .../customize/integration-settings.hbs | 4 +- .../components/customize/license-key.hbs | 2 +- .../components/customize/space-admin.hbs | 2 +- .../components/customize/space-labels.hbs | 2 +- .../components/customize/user-admin.hbs | 2 +- .../components/customize/user-groups.hbs | 14 +++---- .../components/customize/user-list.hbs | 14 +++---- .../components/document/content-linker.hbs | 4 +- .../components/document/document-toolbar.hbs | 8 ++-- .../components/document/page-heading.hbs | 8 ++-- .../document/section-attachment.hbs | 2 +- .../components/document/settings-category.hbs | 2 +- .../components/document/settings-general.hbs | 2 +- .../components/document/settings-tag.hbs | 2 +- .../document/sidebar-attachment.hbs | 2 +- .../components/document/view-revision.hbs | 4 +- .../components/folder/documents-list.hbs | 2 +- .../components/folder/settings-category.hbs | 8 ++-- .../components/folder/settings-delete.hbs | 2 +- .../components/folder/settings-general.hbs | 2 +- .../folder/settings-permissions.hbs | 8 ++-- .../components/folder/space-toolbar.hbs | 2 +- .../components/layout/master-navigation.hbs | 2 +- .../components/onboard/share-folder.hbs | 4 +- .../components/search/search-results.hbs | 2 +- .../components/search/search-view.hbs | 2 +- .../components/section/jira/type-editor.hbs | 2 +- .../section/tabular/type-editor.hbs | 2 +- .../components/user/forgot-password.hbs | 2 +- .../components/user/password-reset.hbs | 2 +- .../components/user/user-profile.hbs | 2 +- gui/public/i18n/en-US.json | 37 ++++++++++++++++- 40 files changed, 112 insertions(+), 117 deletions(-) diff --git a/gui/app/constants/constants.js b/gui/app/constants/constants.js index 4640593a..17298509 100644 --- a/gui/app/constants/constants.js +++ b/gui/app/constants/constants.js @@ -306,46 +306,6 @@ let constants = EmberObject.extend({ Yellow: 'yellow', Gray: 'gray' }, - - Label: { // eslint-disable-line ember/avoid-leaking-state-in-ember-objects - Close: 'Close', - Copy: 'Copy', - Delete: 'Delete', - Duplicate: 'Duplicate', - Edit: 'Edit', - Export: 'Export', - File: 'File', - Import: 'Import', - Insert: 'Insert', - Invite: 'Invite', - Join: 'Join', - Leave: 'Leave', - Login: 'Login', - Move: 'Move', - Next: 'Next', - OK: 'OK', - Preview: 'Preview', - Print: 'Print', - Publish: 'Publish', - Reject: 'Reject', - Remove: 'Remove', - Reply: 'Reply', - Reset: 'Reset', - Restore: 'Restore', - Request: 'Request', - Save: 'Save', - Search: 'Search', - Send: 'Send', - Share: 'Share', - SignIn: 'Sign In', - Sort: 'Sort', - Space: 'Space', - Spaces: 'Spaces', - Unassigned: 'Unassigned', - Update: 'Update', - Upload: 'Upload', - Version: 'Version' - } }); export default { constants }; diff --git a/gui/app/pods/auth/login/template.hbs b/gui/app/pods/auth/login/template.hbs index 6f42d6a8..860148fc 100644 --- a/gui/app/pods/auth/login/template.hbs +++ b/gui/app/pods/auth/login/template.hbs @@ -27,7 +27,7 @@ {{input type="password" value=password id="authPassword" class="form-control" autocomplete="current-password"}} {{/if}} - {{ui/ui-button color=constants.Color.Green light=true label=constants.Label.SignIn onClick=(action "login")}} + {{ui/ui-button color=constants.Color.Green light=true label=(localize 'signin') onClick=(action "login")}}
Invalid credentials
diff --git a/gui/app/pods/folder/index/template.hbs b/gui/app/pods/folder/index/template.hbs index 526b84db..198ec2ac 100644 --- a/gui/app/pods/folder/index/template.hbs +++ b/gui/app/pods/folder/index/template.hbs @@ -3,7 +3,7 @@
{{#ui/ui-toolbar dark=false light=false raised=false large=false bordered=false}} {{ui/ui-toolbar-button themed=true uppercase=true - icon=constants.Icon.ArrowLeft label=constants.Label.Spaces onClick=(action "onBack")}} + icon=constants.Icon.ArrowLeft label=(localize 'spaces') onClick=(action "onBack")}} {{/ui/ui-toolbar}}
diff --git a/gui/app/pods/folders/template.hbs b/gui/app/pods/folders/template.hbs index 923f1696..8169caf6 100644 --- a/gui/app/pods/folders/template.hbs +++ b/gui/app/pods/folders/template.hbs @@ -7,7 +7,7 @@ {{#ui/ui-toolbar dark=false light=false raised=false large=false bordered=false}} {{#if session.isEditor}} {{ui/ui-toolbar-button icon=constants.Icon.Plus color=constants.Color.Green - label=constants.Label.Space onClick=(action "onShowModal")}} + label=(localize 'space') onClick=(action "onShowModal")}} {{ui/ui-toolbar-divider}} {{/if}} {{#if session.isAdmin}} diff --git a/gui/app/pods/theming/template.hbs b/gui/app/pods/theming/template.hbs index a386a9b6..0050476b 100644 --- a/gui/app/pods/theming/template.hbs +++ b/gui/app/pods/theming/template.hbs @@ -6,39 +6,39 @@

Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.

{{/layout/master-sidebar}} {{#layout/master-content}} - {{ui/ui-button themed=true label=constants.Label.Save onClick=(action "onButtonClick" 1)}} + {{ui/ui-button themed=true label=(localize 'save') onClick=(action "onButtonClick" 1)}} {{ui/ui-button-gap}} - {{ui/ui-button themed=true light=true label=constants.Label.Update onClick=(action "onButtonClick" 2)}} + {{ui/ui-button themed=true light=true label=(localize 'update') onClick=(action "onButtonClick" 2)}} {{ui/ui-button-gap}}

- {{ui/ui-button color=constants.Color.Green label=constants.Label.Save onClick=(action "onSuccess")}} + {{ui/ui-button color=constants.Color.Green label=(localize 'save') onClick=(action "onSuccess")}} {{ui/ui-button-gap}} - {{ui/ui-button color=constants.Color.Yellow label=constants.Label.Update onClick=(action "onInfo")}} + {{ui/ui-button color=constants.Color.Yellow label=(localize 'update') onClick=(action "onInfo")}} {{ui/ui-button-gap}} {{ui/ui-button color=constants.Color.Gray label=(localize 'cancel') onClick=(action "onWarn")}} {{ui/ui-button-gap}} - {{ui/ui-button color=constants.Color.Red label=constants.Label.Delete onClick=(action "onError")}} + {{ui/ui-button color=constants.Color.Red label=(localize 'delete') onClick=(action "onError")}} {{ui/ui-button-gap}}

- {{ui/ui-button color=constants.Color.Green light=true label=constants.Label.Save onClick=(action "onSuccess")}} + {{ui/ui-button color=constants.Color.Green light=true label=(localize 'save') onClick=(action "onSuccess")}} {{ui/ui-button-gap}} - {{ui/ui-button color=constants.Color.Yellow light=true label=constants.Label.Update onClick=(action "onInfo")}} + {{ui/ui-button color=constants.Color.Yellow light=true label=(localize 'update') onClick=(action "onInfo")}} {{ui/ui-button-gap}} {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'cancel') onClick=(action "onWarn")}} {{ui/ui-button-gap}} - {{ui/ui-button color=constants.Color.Red light=true label=constants.Label.Delete onClick=(action "onError")}} + {{ui/ui-button color=constants.Color.Red light=true label=(localize 'delete') onClick=(action "onError")}} {{ui/ui-button-gap}}

- {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Plus label=constants.Label.Save onClick=(action "onSuccess")}} + {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Plus label=(localize 'save') onClick=(action "onSuccess")}} {{ui/ui-button-gap}} - {{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.Settings label=constants.Label.Update onClick=(action "onInfo")}} + {{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.Settings label=(localize 'update') onClick=(action "onInfo")}} {{ui/ui-button-gap}} {{ui/ui-button color=constants.Color.Gray light=true icon=constants.Icon.Print label=(localize 'cancel') onClick=(action "onWarn")}} {{ui/ui-button-gap}} - {{ui/ui-button color=constants.Color.Red light=true icon=constants.Icon.Delete label=constants.Label.Delete onClick=(action "onError")}} + {{ui/ui-button color=constants.Color.Red light=true icon=constants.Icon.Delete label=(localize 'delete') onClick=(action "onError")}} {{ui/ui-button-gap}}

diff --git a/gui/app/templates/components/customize/auth-settings.hbs b/gui/app/templates/components/customize/auth-settings.hbs index c6cecf98..6454397f 100644 --- a/gui/app/templates/components/customize/auth-settings.hbs +++ b/gui/app/templates/components/customize/auth-settings.hbs @@ -186,7 +186,7 @@ e.g. http://Documize URL/auth/cas
{{/if}} - {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Locked label=constants.Label.Activate onClick=(action "onSave")}} + {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Locked label=(localize 'activate') onClick=(action "onSave")}} {{#if (gt keycloakFailure.length 0)}} diff --git a/gui/app/templates/components/customize/backup-restore.hbs b/gui/app/templates/components/customize/backup-restore.hbs index 9ae7001c..f8caf4a0 100644 --- a/gui/app/templates/components/customize/backup-restore.hbs +++ b/gui/app/templates/components/customize/backup-restore.hbs @@ -85,7 +85,7 @@ diff --git a/gui/app/templates/components/customize/general-settings.hbs b/gui/app/templates/components/customize/general-settings.hbs index b8144045..734579ef 100644 --- a/gui/app/templates/components/customize/general-settings.hbs +++ b/gui/app/templates/components/customize/general-settings.hbs @@ -60,5 +60,5 @@ How many tags can be assigned to a document (between 3 and 10 tags) - {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Settings label=constants.Label.Save onClick=(action "save")}} + {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Settings label=(localize 'save') onClick=(action "save")}} diff --git a/gui/app/templates/components/customize/integration-settings.hbs b/gui/app/templates/components/customize/integration-settings.hbs index be917a2d..c9604a2d 100644 --- a/gui/app/templates/components/customize/integration-settings.hbs +++ b/gui/app/templates/components/customize/integration-settings.hbs @@ -28,6 +28,6 @@ {{/if}} - {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Integrations label=constants.Label.Save onClick=(action "onSave")}} + {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Integrations label=(localize 'save') onClick=(action "onSave")}} - \ No newline at end of file + diff --git a/gui/app/templates/components/customize/license-key.hbs b/gui/app/templates/components/customize/license-key.hbs index ced30f05..33a7bbc8 100644 --- a/gui/app/templates/components/customize/license-key.hbs +++ b/gui/app/templates/components/customize/license-key.hbs @@ -143,7 +143,7 @@

If you haven"t already, please run a backup to download all your data.

diff --git a/gui/app/templates/components/customize/space-admin.hbs b/gui/app/templates/components/customize/space-admin.hbs index 3ae9659b..1120417b 100644 --- a/gui/app/templates/components/customize/space-admin.hbs +++ b/gui/app/templates/components/customize/space-admin.hbs @@ -50,7 +50,7 @@ diff --git a/gui/app/templates/components/customize/space-labels.hbs b/gui/app/templates/components/customize/space-labels.hbs index c5f50cfd..d9352d42 100644 --- a/gui/app/templates/components/customize/space-labels.hbs +++ b/gui/app/templates/components/customize/space-labels.hbs @@ -67,7 +67,7 @@ diff --git a/gui/app/templates/components/customize/user-admin.hbs b/gui/app/templates/components/customize/user-admin.hbs index 6e8bd10c..0fe365be 100644 --- a/gui/app/templates/components/customize/user-admin.hbs +++ b/gui/app/templates/components/customize/user-admin.hbs @@ -35,7 +35,7 @@ diff --git a/gui/app/templates/components/customize/user-groups.hbs b/gui/app/templates/components/customize/user-groups.hbs index 51296358..af7bc696 100644 --- a/gui/app/templates/components/customize/user-groups.hbs +++ b/gui/app/templates/components/customize/user-groups.hbs @@ -18,7 +18,7 @@ @@ -63,9 +63,9 @@ @@ -89,9 +89,9 @@ @@ -116,7 +116,7 @@ @@ -164,7 +164,7 @@ diff --git a/gui/app/templates/components/customize/user-list.hbs b/gui/app/templates/components/customize/user-list.hbs index 8988c2bb..4875127d 100644 --- a/gui/app/templates/components/customize/user-list.hbs +++ b/gui/app/templates/components/customize/user-list.hbs @@ -202,9 +202,9 @@ @@ -218,9 +218,9 @@

Are you sure you want to delete selected users?

@@ -251,9 +251,9 @@
{{#if group.isMember}} - {{ui/ui-button color=constants.Color.Red light=true label=constants.Label.Leave onClick=(action "onLeaveGroup" group.id)}} + {{ui/ui-button color=constants.Color.Red light=true label=(localize 'leave') onClick=(action "onLeaveGroup" group.id)}} {{else}} - {{ui/ui-button color=constants.Color.Green light=true label=constants.Label.Join onClick=(action "onJoinGroup" group.id)}} + {{ui/ui-button color=constants.Color.Green light=true label=(localize 'join') onClick=(action "onJoinGroup" group.id)}} {{/if}}
@@ -263,7 +263,7 @@ {{/each}} diff --git a/gui/app/templates/components/document/content-linker.hbs b/gui/app/templates/components/document/content-linker.hbs index f6a617b5..a7b04cd2 100644 --- a/gui/app/templates/components/document/content-linker.hbs +++ b/gui/app/templates/components/document/content-linker.hbs @@ -101,9 +101,9 @@ {{/if}} diff --git a/gui/app/templates/components/document/document-toolbar.hbs b/gui/app/templates/components/document/document-toolbar.hbs index d614d839..36e433d0 100644 --- a/gui/app/templates/components/document/document-toolbar.hbs +++ b/gui/app/templates/components/document/document-toolbar.hbs @@ -89,7 +89,7 @@ @@ -110,7 +110,7 @@ @@ -126,7 +126,7 @@ @@ -148,7 +148,7 @@ diff --git a/gui/app/templates/components/document/page-heading.hbs b/gui/app/templates/components/document/page-heading.hbs index 06d75c58..a7e4cfaf 100644 --- a/gui/app/templates/components/document/page-heading.hbs +++ b/gui/app/templates/components/document/page-heading.hbs @@ -84,7 +84,7 @@ @@ -111,7 +111,7 @@ @@ -137,7 +137,7 @@ @@ -164,7 +164,7 @@ diff --git a/gui/app/templates/components/document/section-attachment.hbs b/gui/app/templates/components/document/section-attachment.hbs index 33e66285..e6a45e2e 100644 --- a/gui/app/templates/components/document/section-attachment.hbs +++ b/gui/app/templates/components/document/section-attachment.hbs @@ -20,7 +20,7 @@ {{ui/ui-button light=false - label=constants.Label.Delete + label=(localize 'delete') color=constants.Color.Red onClick=(action "onDelete" file)}} diff --git a/gui/app/templates/components/document/settings-category.hbs b/gui/app/templates/components/document/settings-category.hbs index a4a9ce8d..187f185e 100644 --- a/gui/app/templates/components/document/settings-category.hbs +++ b/gui/app/templates/components/document/settings-category.hbs @@ -11,7 +11,7 @@ {{ui/ui-button color=constants.Color.Green icon=constants.Icon.Category - label=constants.Label.Save + label=(localize 'save') light=true onClick=(action "onSave")}} {{else}} diff --git a/gui/app/templates/components/document/settings-general.hbs b/gui/app/templates/components/document/settings-general.hbs index 38220c67..8741b1c4 100644 --- a/gui/app/templates/components/document/settings-general.hbs +++ b/gui/app/templates/components/document/settings-general.hbs @@ -19,7 +19,7 @@ {{ui/ui-button color=constants.Color.Green icon=constants.Icon.Settings - label=constants.Label.Save + label=(localize 'save') light=true onClick=(action "onSave")}} diff --git a/gui/app/templates/components/document/settings-tag.hbs b/gui/app/templates/components/document/settings-tag.hbs index cbc7c376..b5a5cf9f 100644 --- a/gui/app/templates/components/document/settings-tag.hbs +++ b/gui/app/templates/components/document/settings-tag.hbs @@ -20,6 +20,6 @@ {{ui/ui-button color=constants.Color.Green icon=constants.Icon.Tag - label=constants.Label.Save + label=(localize 'save') light=true onClick=(action "onSave")}} diff --git a/gui/app/templates/components/document/sidebar-attachment.hbs b/gui/app/templates/components/document/sidebar-attachment.hbs index 4421c295..5142f7b7 100644 --- a/gui/app/templates/components/document/sidebar-attachment.hbs +++ b/gui/app/templates/components/document/sidebar-attachment.hbs @@ -18,7 +18,7 @@ {{ui/ui-button light=false - label=constants.Label.Delete + label=(localize 'delete') color=constants.Color.Red onClick=(action "onDelete" file)}} diff --git a/gui/app/templates/components/document/view-revision.hbs b/gui/app/templates/components/document/view-revision.hbs index a357010e..bf8aa249 100644 --- a/gui/app/templates/components/document/view-revision.hbs +++ b/gui/app/templates/components/document/view-revision.hbs @@ -15,7 +15,7 @@ {{#if canRollback}} - {{ui/ui-button color=constants.Color.Red icon=constants.Icon.TimeBack light=true label=constants.Label.Restore onClick=(action "onShowModal")}} + {{ui/ui-button color=constants.Color.Red icon=constants.Icon.TimeBack light=true label=(localize 'restore') onClick=(action "onShowModal")}} {{/if}} diff --git a/gui/app/templates/components/folder/documents-list.hbs b/gui/app/templates/components/folder/documents-list.hbs index ab901312..31f8e59b 100644 --- a/gui/app/templates/components/folder/documents-list.hbs +++ b/gui/app/templates/components/folder/documents-list.hbs @@ -49,7 +49,7 @@ {{ui/ui-button light=true color=constants.Color.Yellow - label=constants.Label.Sort + label=(localize 'sort') onClick=(action "onSortBy" attacher)}} {{/attach-popover}} diff --git a/gui/app/templates/components/folder/settings-category.hbs b/gui/app/templates/components/folder/settings-category.hbs index a7198422..c31562a6 100644 --- a/gui/app/templates/components/folder/settings-category.hbs +++ b/gui/app/templates/components/folder/settings-category.hbs @@ -65,9 +65,9 @@ @@ -81,9 +81,9 @@

Are you sure you want to delete this category?

diff --git a/gui/app/templates/components/folder/settings-delete.hbs b/gui/app/templates/components/folder/settings-delete.hbs index 07f6e23a..83675430 100644 --- a/gui/app/templates/components/folder/settings-delete.hbs +++ b/gui/app/templates/components/folder/settings-delete.hbs @@ -14,6 +14,6 @@ {{ui/ui-button color=constants.Color.Red icon=constants.Icon.Delete - label=constants.Label.Delete + label=(localize 'delete') light=true onClick=(action "onDelete")}} diff --git a/gui/app/templates/components/folder/settings-general.hbs b/gui/app/templates/components/folder/settings-general.hbs index 3b8aec22..56b61bfa 100644 --- a/gui/app/templates/components/folder/settings-general.hbs +++ b/gui/app/templates/components/folder/settings-general.hbs @@ -65,6 +65,6 @@ {{ui/ui-button color=constants.Color.Green icon=constants.Icon.Settings - label=constants.Label.Save + label=(localize 'save') light=true onClick=(action "onSave")}} diff --git a/gui/app/templates/components/folder/settings-permissions.hbs b/gui/app/templates/components/folder/settings-permissions.hbs index e3132cce..a99b0ac7 100644 --- a/gui/app/templates/components/folder/settings-permissions.hbs +++ b/gui/app/templates/components/folder/settings-permissions.hbs @@ -144,7 +144,7 @@ {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Locked - label=constants.Label.Save onClick=(action "onSave")}} + label=(localize 'save') onClick=(action "onSave")}} @@ -199,9 +199,9 @@ diff --git a/gui/app/templates/components/folder/space-toolbar.hbs b/gui/app/templates/components/folder/space-toolbar.hbs index ed5d752d..db42eefe 100644 --- a/gui/app/templates/components/folder/space-toolbar.hbs +++ b/gui/app/templates/components/folder/space-toolbar.hbs @@ -134,7 +134,7 @@ diff --git a/gui/app/templates/components/layout/master-navigation.hbs b/gui/app/templates/components/layout/master-navigation.hbs index 5f04c5c5..db78e842 100644 --- a/gui/app/templates/components/layout/master-navigation.hbs +++ b/gui/app/templates/components/layout/master-navigation.hbs @@ -99,7 +99,7 @@ {{else}} {{#link-to "auth.login" class="option"}} - {{constants.Label.Login}} + {{localize 'login'}} {{/link-to}} {{/if}} diff --git a/gui/app/templates/components/onboard/share-folder.hbs b/gui/app/templates/components/onboard/share-folder.hbs index cb3bc0d3..c027fdf4 100644 --- a/gui/app/templates/components/onboard/share-folder.hbs +++ b/gui/app/templates/components/onboard/share-folder.hbs @@ -9,7 +9,7 @@ - {{ui/ui-button id="stage-1-next" color=constants.Color.Green light=true icon=constants.Icon.ArrowRight label=constants.Label.Next}} + {{ui/ui-button id="stage-1-next" color=constants.Color.Green light=true icon=constants.Icon.ArrowRight label=(localize 'next')}}
@@ -25,7 +25,7 @@ Re-type your chosen password
- {{ui/ui-button id="stage-2-next" color=constants.Color.Green light=true icon=constants.Icon.ArrowRight label=constants.Label.SignIn}} + {{ui/ui-button id="stage-2-next" color=constants.Color.Green light=true icon=constants.Icon.ArrowRight label=(localize 'signin')}}
diff --git a/gui/app/templates/components/search/search-results.hbs b/gui/app/templates/components/search/search-results.hbs index 075dc774..e01a94ed 100644 --- a/gui/app/templates/components/search/search-results.hbs +++ b/gui/app/templates/components/search/search-results.hbs @@ -41,7 +41,7 @@ {{ui/ui-button light=true color=constants.Color.Yellow - label=constants.Label.Sort + label=(localize 'sort') onClick=(action "onSortBy" attacher)}}
{{/attach-popover}} diff --git a/gui/app/templates/components/search/search-view.hbs b/gui/app/templates/components/search/search-view.hbs index b2a1a34d..d376aa2b 100644 --- a/gui/app/templates/components/search/search-view.hbs +++ b/gui/app/templates/components/search/search-view.hbs @@ -4,7 +4,7 @@ {{focus-input type="text" value=keywords class="form-control mr-3 search-box" placeholder="keywords, tags"}}
- {{ui/ui-button color=constants.Color.Green light=true label=constants.Label.Search onClick=(action "onSearch")}} + {{ui/ui-button color=constants.Color.Green light=true label=(localize 'search') onClick=(action "onSearch")}}
{{#if validSearch}} diff --git a/gui/app/templates/components/section/jira/type-editor.hbs b/gui/app/templates/components/section/jira/type-editor.hbs index 3a2b8e5f..f6a32649 100644 --- a/gui/app/templates/components/section/jira/type-editor.hbs +++ b/gui/app/templates/components/section/jira/type-editor.hbs @@ -20,7 +20,7 @@ {{focus-input id="jira-jql" type="text" value=config.jql class="form-control" placeholder="e.g. (status = resolved AND project = SysAdmin) OR assignee = bobsmith"}} - {{ui/ui-button color=constants.Color.Yellow light=true label=constants.Label.Preview submit=true onClick=(action "onPreview")}} + {{ui/ui-button color=constants.Color.Yellow light=true label=(localize 'preview') submit=true onClick=(action "onPreview")}} > diff --git a/gui/app/templates/components/section/tabular/type-editor.hbs b/gui/app/templates/components/section/tabular/type-editor.hbs index 98db075f..76611019 100644 --- a/gui/app/templates/components/section/tabular/type-editor.hbs +++ b/gui/app/templates/components/section/tabular/type-editor.hbs @@ -43,7 +43,7 @@ diff --git a/gui/app/templates/components/user/forgot-password.hbs b/gui/app/templates/components/user/forgot-password.hbs index 652fc2bf..d95314da 100644 --- a/gui/app/templates/components/user/forgot-password.hbs +++ b/gui/app/templates/components/user/forgot-password.hbs @@ -9,7 +9,7 @@

Email not found

{{/if}} - {{ui/ui-button color=constants.Color.Yellow light=true label=constants.Label.Reset onClick=(action "forgot")}} + {{ui/ui-button color=constants.Color.Yellow light=true label=(localize 'reset') onClick=(action "forgot")}} {{/if}} diff --git a/gui/app/templates/components/user/password-reset.hbs b/gui/app/templates/components/user/password-reset.hbs index 47e81895..921348a5 100644 --- a/gui/app/templates/components/user/password-reset.hbs +++ b/gui/app/templates/components/user/password-reset.hbs @@ -11,7 +11,7 @@ Please type your new password again
- {{ui/ui-button color=constants.Color.Green light=true label=constants.Label.Reset onClick=(action "reset")}} + {{ui/ui-button color=constants.Color.Green light=true label=(localize 'reset') onClick=(action "reset")}} Passwords must match
diff --git a/gui/app/templates/components/user/user-profile.hbs b/gui/app/templates/components/user/user-profile.hbs index 98ba80cc..a919b8ce 100644 --- a/gui/app/templates/components/user/user-profile.hbs +++ b/gui/app/templates/components/user/user-profile.hbs @@ -21,5 +21,5 @@ {{input id="confirmPassword" type="password" value=password.confirmation class=(if hasConfirmPasswordError "form-control is-invalid" "form-control")}} {{/if}} - {{ui/ui-button color=constants.Color.Green light=true label=constants.Label.Save onClick=(action "save")}} + {{ui/ui-button color=constants.Color.Green light=true label=(localize 'save') onClick=(action "save")}} diff --git a/gui/public/i18n/en-US.json b/gui/public/i18n/en-US.json index 2596434f..f239979c 100644 --- a/gui/public/i18n/en-US.json +++ b/gui/public/i18n/en-US.json @@ -5,7 +5,40 @@ "approve": "Approve", "authenticate": "Authenticate", "cancel": "Cancel", - + "close": "Close", + "copy": "Copy", + "delete": "Delete", + "duplicate": "Duplicate", + "edit": "Edit", + "import": "Import", + "export": "Export", + "file": "File", + "insert": "Insert", + "invite": "Invite", + "join": "Join", + "leave": "Leave", + "login": "Login", + "move": "Move", + "next": "Next", + "ok": "OK", + "preview": "Preview", + "publish": "Publish", + "print": "Print", + "reject": "Reject", + "remove": "Remove", + "reply": "Reply", + "reset": "Reset", + "restore": "Restore", + "request": "Request", + "save": "Save", + "search": "Search", + "send": "Send", + "share": "Share", + "signin": "Sign In", + "sort": "Sort", + "unassigned": "Unassigned", + "update": "Update", + "version": "Version", "name": "Name", "description": "Description", @@ -23,6 +56,8 @@ "label": "Label", "labels_none": "No labels", + "space": "Space", + "spaces": "Spaces", "space_new": "New Space", "space_name": "Space name", "space_description": "Space description", From a7dac6911c717cfe47bb458f72d5dbb472dc3a5e Mon Sep 17 00:00:00 2001 From: McMatts Date: Tue, 1 Mar 2022 22:59:56 -0500 Subject: [PATCH 06/46] i18n strings --- gui/app/models/document-activity.js | 22 +++++++++++----------- gui/public/i18n/en-US.json | 18 ++++++++++++++---- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/gui/app/models/document-activity.js b/gui/app/models/document-activity.js index 5e3b9347..f6c5ec69 100644 --- a/gui/app/models/document-activity.js +++ b/gui/app/models/document-activity.js @@ -31,37 +31,37 @@ export default Model.extend({ switch (this.get('activityType')) { case constants.UserActivityType.Created: - label = 'Added'; + label = this.i18n.localize('added'); break; case constants.UserActivityType.Read: - label = 'Viewed'; + label = this.i18n.localize('viewed'); break; case constants.UserActivityType.Edited: - label = 'Edited'; + label = this.i18n.localize('edited'); break; case constants.UserActivityType.Deleted: - label = 'Deleted'; + label = this.i18n.localize('deleted'); break; case constants.UserActivityType.Archived: - label = 'Archived'; + label = this.i18n.localize('archived'); break; case constants.UserActivityType.Approved: - label = 'Approved'; + label = this.i18n.localize('approved'); break; case constants.UserActivityType.Reverted: - label = 'Reverted'; + label = this.i18n.localize('reverted'); break; case constants.UserActivityType.PublishedTemplate: - label = 'Published Template'; + label = this.i18n.localize('template_published'); break; case constants.UserActivityType.PublishedBlock: - label = 'Published Block'; + label = this.i18n.localize('block_published'); break; case constants.UserActivityType.Rejected: - label = 'Rejected'; + label = this.i18n.localize('rejected'); break; case constants.UserActivityType.Published: - label = 'Published'; + label = this.i18n.localize('published'); break; default: break; diff --git a/gui/public/i18n/en-US.json b/gui/public/i18n/en-US.json index f239979c..4fe9287b 100644 --- a/gui/public/i18n/en-US.json +++ b/gui/public/i18n/en-US.json @@ -8,6 +8,7 @@ "close": "Close", "copy": "Copy", "delete": "Delete", + "deleted": "Deleted", "duplicate": "Duplicate", "edit": "Edit", "import": "Import", @@ -25,6 +26,7 @@ "publish": "Publish", "print": "Print", "reject": "Reject", + "rejected": "Rejected", "remove": "Remove", "reply": "Reply", "reset": "Reset", @@ -39,13 +41,18 @@ "unassigned": "Unassigned", "update": "Update", "version": "Version", - - "name": "Name", - "description": "Description", - "icon": "Icon", + "added": "Added", + "viewed": "Viewed", + "edited": "Edited", "draft": "Draft", "live": "Live", "archived": "Archived", + "approved": "Approved", + "reverted": "Reverted", + "published": "Published", + "name": "Name", + "description": "Description", + "icon": "Icon", "filter": "Filter", "all": "All", @@ -75,6 +82,9 @@ "approval_majority": "Majority approval required from approvers", "approval_unanimous": "Unanimous approval required from all approvers", + "template_published": "Published Template", + + "block_published": "Published Block", "z": "z" } From 479d03ba7099ebb9e1dd23d2f57a38ff6582ce0d Mon Sep 17 00:00:00 2001 From: McMatts Date: Wed, 2 Mar 2022 19:55:52 -0500 Subject: [PATCH 07/46] i18n admin sections --- gui/app/components/customize/search-index.js | 15 +++-- gui/app/services/i18n.js | 14 ++--- .../components/customize/auth-settings.hbs | 14 +++-- .../components/customize/backup-restore.hbs | 46 ++++++--------- .../components/customize/change-log.hbs | 6 +- .../components/customize/general-settings.hbs | 35 ++++++----- .../customize/integration-settings.hbs | 18 +++--- .../components/customize/search-index.hbs | 2 +- gui/public/i18n/en-US.json | 59 ++++++++++++++++++- 9 files changed, 131 insertions(+), 78 deletions(-) diff --git a/gui/app/components/customize/search-index.js b/gui/app/components/customize/search-index.js index 77d43c9b..e9a1761f 100644 --- a/gui/app/components/customize/search-index.js +++ b/gui/app/components/customize/search-index.js @@ -15,14 +15,21 @@ import Component from '@ember/component'; export default Component.extend(Notifier, { appMeta: service(), - buttonLabel: 'Rebuild', + i18n: service(), + buttonLabel: '', + + init() { + this._super(...arguments); + this.buttonLabel = this.i18n.localize('search_reindex_rebuild'); + }, actions: { reindex() { - this.set('buttonLabel', 'Running...'); - this.notifyInfo("Starting search re-index process"); + this.set('buttonLabel', this.i18n.localize('running')); + this.notifyInfo(this.i18n.localize('search_reindex_start')); this.get('reindex')(() => { - this.notifySuccess("Search re-indexing complete"); + this.notifySuccess(this.i18n.localize('search_reindex_finish')); + this.set('buttonLabel', this.i18n.localize('search_reindex_rebuild')); }); } } diff --git a/gui/app/services/i18n.js b/gui/app/services/i18n.js index 68b382c3..1fac5375 100644 --- a/gui/app/services/i18n.js +++ b/gui/app/services/i18n.js @@ -21,8 +21,6 @@ export default Service.extend({ }, localize(key, ...args) { - console.log(this.session.locale); - let str = ""; switch(this.session.locale) { @@ -33,13 +31,15 @@ export default Service.extend({ str = this.langs.enUS[key]; } - if (str === "") { - console.log("i18n miss", key); - return; + if (_.isUndefined(str)) { + console.log(">>>>>>>>>>>> i18n missed key", key); + return `!${key}!`; } - for (let i = 0; i < args.length; i++) { - str = str.replace(`{${i+1}}`, args[i]); + if (args) { + for (let i = 0; i < args.length; i++) { + str = str.replace(`{${i+1}}`, args[i]); + } } return str; diff --git a/gui/app/templates/components/customize/auth-settings.hbs b/gui/app/templates/components/customize/auth-settings.hbs index 6454397f..ed235616 100644 --- a/gui/app/templates/components/customize/auth-settings.hbs +++ b/gui/app/templates/components/customize/auth-settings.hbs @@ -4,28 +4,28 @@
  • Documize
    -
    Built-in email/password
    +
    {{localize 'auth_email_password'}}
    {{#if isDocumizeProvider}} {{/if}}
  • Keycloak
    -
    Via authentication server
    +
    {{localize 'auth_connect_keycloak'}}
    {{#if isKeycloakProvider}} {{/if}}
  • LDAP
    -
    Connect to LDAP/Active Directory
    +
    {{localize 'auth_connect_ldap'}}
    {{#if isLDAPProvider}} {{/if}}
  • CAS
    -
    Via Central Authentication Server
    +
    {{localize 'auth_connect_cas'}}
    {{#if isCASProvider}} {{/if}} @@ -174,7 +174,8 @@ {{ui/ui-button color=constants.Color.Yellow light=true label="Test →" onClick=(action "onLDAPPreview")}} {{ui/ui-button-gap}} {{/if}} - {{#if isCASProvider}} + + {{#if isCASProvider}}
    {{focus-input id="cas-url" type="text" value=casConfig.url class=(if casErrorUrl "form-control is-invalid" "form-control")}} @@ -183,9 +184,10 @@
    {{focus-input id="cas-redirect-url" type="text" value=casConfig.redirectUrl class=(if casErrorRedirectUrl "form-control is-invalid" "form-control")}} - e.g. http://Documize URL/auth/cas + e.g. http://DocumizeURL/auth/cas
    {{/if}} + {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Locked label=(localize 'activate') onClick=(action "onSave")}} diff --git a/gui/app/templates/components/customize/backup-restore.hbs b/gui/app/templates/components/customize/backup-restore.hbs index f8caf4a0..9bb2cbec 100644 --- a/gui/app/templates/components/customize/backup-restore.hbs +++ b/gui/app/templates/components/customize/backup-restore.hbs @@ -2,40 +2,32 @@
    {{#if session.isGlobalAdmin}} -

    - Documize Community is a multi-tenanted application enabling both "tech.mycompany.com" and "sales.mycompany.com" to run using the same executable/database. - As a Documize Community Global Administrator, you will be performing a complete system-wide backup across all tenants. - The Documize Community Tenant Administrator can login to perform a tenant-level backup (e.g. marketing.mycompany.com). -

    +

    {{localize 'backup_explain1'}}

    {{else}} -

    - Documize Community is a multi-tenanted application enabling both "tech.mycompany.com" and "sales.mycompany.com" to run using the same executable/database. - A Documize Community Global Administrator, you will be performing a complete system-wide backup across all tenants. - As a Documize Community Tenant Administrator you can perform a tenant-level backup (e.g. marketing.mycompany.com). -

    +

    {{localize 'backup_explain2'}}

    {{/if}} -

    It can take several minutes to complete the backup process — please be patient while the backup operation is in progress.

    +

    {{localize 'backup_explain3'}}

    {{#ui/ui-checkbox selected=backupSpec.retain}} - Retain backup file on server + {{localize 'backup_retain'}} {{/ui/ui-checkbox}}
    {{#if backupRunning}} -

    Backup running, please wait...

    +

    {{localize 'backup_running'}}

    {{else}} - {{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.Database label=(concat "BACKUP TENANT (" appMeta.appHost ")") onClick=(action "onBackup")}} + {{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.Database label=(concat (localize 'backup_tenant') " " appMeta.appHost) onClick=(action "onBackup")}} {{#if session.isGlobalAdmin}} {{ui/ui-button-gap}} - {{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.Database label="BACKUP SYSTEM" onClick=(action "onSystemBackup")}} + {{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.Database label=(localize 'backup_system') onClick=(action "onSystemBackup")}} {{/if}} {{/if}} {{#if backupFailed}} -
    Backup failed — please check server logs
    +
    {{localize 'backup_failed'}}
    {{/if}} {{#if backupSuccess}} -
    Backup successful ({{backupFilename}})
    +
    {{localize 'backup_success'}} ({{backupFilename}})
    {{/if}}
    @@ -43,23 +35,23 @@
    {{#if session.isGlobalAdmin}} -

    Restore from a system backup should only be performed on an empty Documize Community database.

    +

    {{localize 'restore_explain1'}}

    {{/if}} -

    Restore operation will re-create users, groups, permissions, spaces, categories and content.

    -

    It can take several minutes to complete the restore process — please be patient while the restore operation is in progress.

    +

    {{localize 'restore_explain2'}}

    +

    {{localize 'restore_explain3'}}

    - +
    {{#if restoreFailed}} -
    Restore failed — please check server logs
    +
    {{localize 'restore_failed'}}
    {{else if restoreSuccess}} -
    Restore completed — restart your browser and log in
    +
    {{localize 'restore_success'}}
    {{else}} {{#if restoreUploadReady}} {{ui/ui-button color=constants.Color.Red light=false icon=constants.Icon.Database label=restoreButtonLabel onClick=(action "onShowRestoreModal")}} @@ -72,13 +64,13 @@
  • @@ -36,14 +36,14 @@
    {{#ui/ui-toolbar dark=false light=true raised=false large=false bordered=false}} - {{ui/ui-toolbar-icon icon=constants.Icon.Edit color=constants.Color.Green tooltip="Update label" onClick=(action "onShowUpdateModal" label)}} - {{ui/ui-toolbar-icon icon=constants.Icon.Delete color=constants.Color.Red tooltip="Delete label" onClick=(action "onShowDeleteModal" label)}} + {{ui/ui-toolbar-icon icon=constants.Icon.Edit color=constants.Color.Green tooltip=(localize 'update') onClick=(action "onShowUpdateModal" label)}} + {{ui/ui-toolbar-icon icon=constants.Icon.Delete color=constants.Color.Red tooltip=(localize 'delete') onClick=(action "onShowDeleteModal" label)}} {{/ui/ui-toolbar}}
    @@ -30,14 +30,14 @@
- diff --git a/gui/public/i18n/en-US.json b/gui/public/i18n/en-US.json index 540a2b03..983b47b7 100644 --- a/gui/public/i18n/en-US.json +++ b/gui/public/i18n/en-US.json @@ -83,6 +83,8 @@ "meta": "Meta", "permissions": "Permissions", "profile": "Profile", + "go_top": "Go top", + "help": "Help", "public": "Public", "protected": "Protected", @@ -102,6 +104,11 @@ "pinned": "Pinned", "unpinned": "Unpinned", "blocks": "Content Blocks", + "actions": "Actions", + "activity": "Activity", + "reports": "Reports", + "bookmarks": "Bookmarks", + "content": "Content", "space_new": "New Space", "space_name": "Space name", @@ -154,6 +161,9 @@ "search_example8": "Show results that contain either word", "search_example9": "Show results that have \"google\", either \"apple\" or \"microsoft\" but not \"ibm\"", "search_example10": "Show results that contain words that start with \"apple\", such as \"applesauce\" or \"applet\"", + "space_density_complete": "Complete", + "space_density_comfort": "Comfort", + "space_density_compact": "Compact", "backup_explain1": "Documize Community is a multi-tenanted application enabling both 'tech.mycompany.com' and 'sales.mycompany.com' to run using the same executable/database. As a Documize Community Global Administrator, you will be performing a complete system-wide backup across all tenants. The Documize Community Tenant Administrator can login to perform a tenant-level backup (e.g. marketing.mycompany.com).", "backup_explain2": "Documize Community is a multi-tenanted application enabling both 'tech.mycompany.com' and 'sales.mycompany.com' to run using the same executable/database. A Documize Community Global Administrator, you will be performing a complete system-wide backup across all tenants. As a Documize Community Tenant Administrator you can perform a tenant-level backup (e.g. marketing.mycompany.com).", @@ -225,6 +235,7 @@ "smtp_ssl": "Use SSL", "smtp_save_test": "Save & Test", "smtp_sent_test_email": "Sending test email to you", + "smtp_missing": "Missing mail server settings", "space_admin_export": "Export All Content", "space_admin_export_running": "Export running....", "space_admin_make_owner": "Add myself as owner", @@ -351,6 +362,10 @@ "product_feedback": "Have a product idea, suggestion or some feedback?", "product_news": "Product News", "product_news_explain": "Latest product news and updates", + "product_update": "Update available", + "product_whats_new": "What's New", + "product_activation_key_missing": "Missing activation key", + "account_update": "Update Account", "404": "Oops! That page couldn't be found.", "404_explain": "Maybe the content you're looking for is no longer available?", "close_account": "Please close my Documize account.", From e0805d71314f9d686e25628b1e601be2d5c52de0 Mon Sep 17 00:00:00 2001 From: McMatts Date: Tue, 8 Mar 2022 11:35:59 -0500 Subject: [PATCH 19/46] i18n search strings --- gui/app/components/search/search-results.js | 18 +++++++++--------- .../components/search/search-results.hbs | 16 +++++++--------- .../components/search/search-view.hbs | 4 ++-- gui/public/i18n/en-US.json | 15 ++++++++++++++- 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/gui/app/components/search/search-results.js b/gui/app/components/search/search-results.js index 8e44df3d..be3b364b 100644 --- a/gui/app/components/search/search-results.js +++ b/gui/app/components/search/search-results.js @@ -15,13 +15,13 @@ import Component from '@ember/component'; export default Component.extend({ localStorage: service('localStorage'), + i18n: service(), resultPhrase: '', searchQuery: computed('keywords', function() { return encodeURIComponent(this.get('keywords')); }), - // eslint-disable-next-line ember/avoid-leaking-state-in-ember-objects sortBy: { - name: true, + name: true, created: false, updated: false, asc: true, @@ -33,15 +33,15 @@ export default Component.extend({ let docs = this.get('results'); let duped = []; - let phrase = 'Nothing found'; + let phrase = this.i18n.localize('nothing_found'); if (docs.length > 0) { duped = _.uniqBy(docs, function(item) { return item.get('documentId'); }); - let references = docs.length === 1 ? "reference" : "references"; - let docLabel = duped.length === 1 ? "document" : "documents"; + let references = docs.length === 1 ? this.i18n.localize('reference') : this.i18n.localize('references'); + let docLabel = duped.length === 1 ? this.i18n.localize('document') : this.i18n.localize('documents'); let i = docs.length; let j = duped.length; phrase = `${i} ${references} in ${j} ${docLabel}`; @@ -68,19 +68,19 @@ export default Component.extend({ if (_.isNull(docs)) return; - if (sortBy.name) { + if (sortBy.name) { docs = docs.sortBy('document'); ls.storeSessionItem('search.sortBy', 'name'); } - if (sortBy.created) { + if (sortBy.created) { docs = docs.sortBy('created'); ls.storeSessionItem('search.sortBy', 'created'); } - if (sortBy.updated) { + if (sortBy.updated) { docs = docs.sortBy('revised'); ls.storeSessionItem('search.sortBy', 'updated'); } - if (sortBy.desc) { + if (sortBy.desc) { docs = docs.reverseObjects(); ls.storeSessionItem('search.sortOrder', 'desc'); } else { diff --git a/gui/app/templates/components/search/search-results.hbs b/gui/app/templates/components/search/search-results.hbs index e01a94ed..8ac7ca04 100644 --- a/gui/app/templates/components/search/search-results.hbs +++ b/gui/app/templates/components/search/search-results.hbs @@ -1,9 +1,8 @@