Skip to content

Commit

Permalink
Move strings from BulkSelectionController into sharing namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
klaustopher committed Jun 26, 2024
1 parent af3c483 commit 8dc697f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions config/locales/js-en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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');
}
Expand Down

0 comments on commit 8dc697f

Please sign in to comment.