Skip to content

Commit

Permalink
Allow setTitle with nonTranslate, use it in some detail views (#4483)
Browse files Browse the repository at this point in the history
  • Loading branch information
reiterl authored Dec 13, 2024
1 parent 2d8ed92 commit 3b63252
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
9 changes: 6 additions & 3 deletions client/src/app/site/base/base.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h2>{{ 'Autopilot' | translate }}</h2>
[target]="lowerProjectionTarget"
>
<h1>
{{ title | translate }}
{{ title }}
</h1>
</a>
</mat-card-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
})
Expand Down

0 comments on commit 3b63252

Please sign in to comment.