From 8dc697f3959713d2da3713dfeb59e6fe4aa4e488 Mon Sep 17 00:00:00 2001 From: Klaus Zanders Date: Wed, 26 Jun 2024 10:35:41 +0200 Subject: [PATCH] Move strings from BulkSelectionController into sharing namespace --- config/locales/js-en.yml | 8 +++++--- .../dynamic/shares/bulk-selection.controller.ts | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml index 76d0b619abd2..7e58a84fa88e 100644 --- a/config/locales/js-en.yml +++ b/config/locales/js-en.yml @@ -990,6 +990,11 @@ en: preformatted_text: "Preformatted Text" wiki_link: "Link to a Wiki page" image: "Image" + sharing: + selected_count: "%{count} selected" + selection: + mixed: "Mixed" + work_packages: bulk_actions: move: "Bulk change of project" @@ -1149,9 +1154,6 @@ en: share: "Share" title: "Share work package" show_all_users: "Show all users with whom the work package has been shared with" - selected_count: "%{count} selected" - selection: - mixed: "Mixed" upsale: description: "Share work packages with users who are not members of the project." table: diff --git a/frontend/src/stimulus/controllers/dynamic/shares/bulk-selection.controller.ts b/frontend/src/stimulus/controllers/dynamic/shares/bulk-selection.controller.ts index 3e01bc147cf7..a82042673b8a 100644 --- a/frontend/src/stimulus/controllers/dynamic/shares/bulk-selection.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/shares/bulk-selection.controller.ts @@ -32,7 +32,7 @@ import { Controller } from '@hotwired/stimulus'; export default class BulkSelectionController extends Controller { static values = { - bulkUpdateRoleLabel: { type: String, default: I18n.t('js.work_packages.sharing.selection.mixed') }, + bulkUpdateRoleLabel: { type: String, default: I18n.t('js.sharing.selection.mixed') }, }; declare bulkUpdateRoleLabelValue:string; @@ -152,7 +152,7 @@ export default class BulkSelectionController extends Controller { private updateBulkUpdateRoleLabelValue() { if (new Set(this.selectedPermissions).size > 1) { - this.bulkUpdateRoleLabelValue = I18n.t('js.work_packages.sharing.selection.mixed'); + this.bulkUpdateRoleLabelValue = I18n.t('js.sharing.selection.mixed'); this.bulkPermissionButtons.forEach((button) => button.setAttribute('aria-checked', 'false')); } else { this.bulkUpdateRoleLabelValue = this.selectedPermissions[0]; @@ -180,7 +180,7 @@ export default class BulkSelectionController extends Controller { } private showSelectedCounter() { - this.selectedCounterTarget.textContent = I18n.t('js.work_packages.sharing.selected_count', { count: this.checked.length }); + this.selectedCounterTarget.textContent = I18n.t('js.sharing.selected_count', { count: this.checked.length }); this.sharedCounterTarget.setAttribute('hidden', 'true'); this.selectedCounterTarget.removeAttribute('hidden'); }