From a8b04c54ab0f0d742a3aeca14ab670465ac5a3e1 Mon Sep 17 00:00:00 2001 From: Ludwig Reiter Date: Thu, 12 Dec 2024 11:25:35 +0100 Subject: [PATCH 1/2] Allow setTitle with nonTranslate, use it in some detail views --- client/src/app/site/base/base.component.ts | 9 ++++++--- .../components/topic-detail/topic-detail.component.ts | 2 +- .../assignment-detail/assignment-detail.component.ts | 2 +- .../components/autopilot/autopilot.component.html | 2 +- .../components/motion-view/motion-view.component.ts | 2 +- .../participant-detail-view.component.ts | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/client/src/app/site/base/base.component.ts b/client/src/app/site/base/base.component.ts index 7f8bcd2bab..968e80be8d 100644 --- a/client/src/app/site/base/base.component.ts +++ b/client/src/app/site/base/base.component.ts @@ -93,9 +93,12 @@ export abstract class BaseComponent extends BaseUiComponent implements OnDestroy * Set the title in web browser using angulars TitleService * @param prefix The title prefix. Should be translated here. */ - public setTitle(prefix: string): void { - const translatedPrefix = this.translate.instant(prefix); - this.titleService.setTitle(translatedPrefix + this.titleSuffix); + public setTitle(prefix: string, nonTranslate?: boolean): void { + let titlePrefix = prefix; + if (!nonTranslate) { + titlePrefix = this.translate.instant(prefix); + } + this.titleService.setTitle(titlePrefix + this.titleSuffix); } /** diff --git a/client/src/app/site/pages/meetings/pages/agenda/modules/topics/pages/topic-detail/components/topic-detail/topic-detail.component.ts b/client/src/app/site/pages/meetings/pages/agenda/modules/topics/pages/topic-detail/components/topic-detail/topic-detail.component.ts index 191bdb36aa..d96d4ea9bc 100644 --- a/client/src/app/site/pages/meetings/pages/agenda/modules/topics/pages/topic-detail/components/topic-detail/topic-detail.component.ts +++ b/client/src/app/site/pages/meetings/pages/agenda/modules/topics/pages/topic-detail/components/topic-detail/topic-detail.component.ts @@ -280,7 +280,7 @@ export class TopicDetailComponent extends BaseMeetingComponent implements OnInit // also ensures edition cannot be interrupted by autoupdate if (newViewTopic) { const title = newViewTopic.getListTitle(); - super.setTitle(title); + super.setTitle(title, true); this.topic = newViewTopic; // personalInfoForm is undefined during 'new' and directly after reloading if (!this.editTopic) { diff --git a/client/src/app/site/pages/meetings/pages/assignments/pages/assignment-detail/components/assignment-detail/assignment-detail.component.ts b/client/src/app/site/pages/meetings/pages/assignments/pages/assignment-detail/components/assignment-detail/assignment-detail.component.ts index dda6004960..52056f4935 100644 --- a/client/src/app/site/pages/meetings/pages/assignments/pages/assignment-detail/components/assignment-detail/assignment-detail.component.ts +++ b/client/src/app/site/pages/meetings/pages/assignments/pages/assignment-detail/components/assignment-detail/assignment-detail.component.ts @@ -200,7 +200,7 @@ export class AssignmentDetailComponent extends BaseMeetingComponent implements O this.assignmentRepo.getViewModelObservable(assignmentId).subscribe(assignment => { if (assignment) { const title = assignment.getTitle(); - super.setTitle(title); + super.setTitle(title, true); this.assignment = assignment; if (!this.isEditing) { this.patchForm(this.assignment); diff --git a/client/src/app/site/pages/meetings/pages/autopilot/components/autopilot/autopilot.component.html b/client/src/app/site/pages/meetings/pages/autopilot/components/autopilot/autopilot.component.html index b4b984b6f8..d51dd74402 100644 --- a/client/src/app/site/pages/meetings/pages/autopilot/components/autopilot/autopilot.component.html +++ b/client/src/app/site/pages/meetings/pages/autopilot/components/autopilot/autopilot.component.html @@ -36,7 +36,7 @@

{{ 'Autopilot' | translate }}

[target]="lowerProjectionTarget" >

- {{ title | translate }} + {{ title }}

diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-view/components/motion-view/motion-view.component.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-view/components/motion-view/motion-view.component.ts index af6e6174ae..f04422a30f 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-view/components/motion-view/motion-view.component.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-view/components/motion-view/motion-view.component.ts @@ -231,7 +231,7 @@ export class MotionViewComponent extends BaseMeetingComponent implements OnInit, public onMotionUpdated(motion: ViewMotion): void { const title = motion.getTitle(); - super.setTitle(title); + super.setTitle(title, true); this.motion = motion; this.cd.markForCheck(); } diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-view/participant-detail-view.component.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-view/participant-detail-view.component.ts index 93cd1118e6..00d17206dd 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-view/participant-detail-view.component.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-view/participant-detail-view.component.ts @@ -279,7 +279,7 @@ export class ParticipantDetailViewComponent extends BaseMeetingComponent { this.repo.getViewModelObservable(this._userId!).subscribe(user => { if (user) { const title = user.getTitle(); - super.setTitle(title); + super.setTitle(title, true); this.user = user; this.cd.markForCheck(); } From dc65706e5b415701b8ce8cfae4b7d49a84837ea7 Mon Sep 17 00:00:00 2001 From: Ludwig Reiter Date: Fri, 13 Dec 2024 08:39:35 +0100 Subject: [PATCH 2/2] Add nonTranslate true to projector-detail view --- .../components/projector-detail/projector-detail.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/app/site/pages/meetings/pages/projectors/modules/projector-detail/components/projector-detail/projector-detail.component.ts b/client/src/app/site/pages/meetings/pages/projectors/modules/projector-detail/components/projector-detail/projector-detail.component.ts index 28a7e656dc..8ae1f60cc6 100644 --- a/client/src/app/site/pages/meetings/pages/projectors/modules/projector-detail/components/projector-detail/projector-detail.component.ts +++ b/client/src/app/site/pages/meetings/pages/projectors/modules/projector-detail/components/projector-detail/projector-detail.component.ts @@ -349,7 +349,7 @@ export class ProjectorDetailComponent extends BaseMeetingComponent implements On this.repo.getViewModelObservable(this._projectorId!).subscribe(projector => { if (projector) { const title = projector.name; - super.setTitle(title); + super.setTitle(title, true); this.projector = projector; } })