Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setTitle with nonTranslate, use it in some detail views #4483

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading