Connection status i18n fix

This commit is contained in:
Adina Țeudan 2021-11-11 21:38:36 +02:00
parent 9d1cdea98b
commit db7c3d6bec
3 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,5 @@
<div *ngIf="connectionStatus$ | async as status" [@animateOpenClose]="status" [ngClass]="status" class="indicator flex-align-items-center">
<span [translate]="'error.' + status"></span>
<span [translate]="translations[status]"></span>
</div>
<ng-container *ngIf="errorService.serverError$ | async as error">

View File

@ -5,6 +5,7 @@ import { animate, state, style, transition, trigger } from '@angular/animations'
import { fromEvent, merge, Observable } from 'rxjs';
import { delay, map, mapTo } from 'rxjs/operators';
import { shareLast } from '../../utils';
import { connectionStatusTranslations } from '../../translations/connection-status-translations';
@Component({
selector: 'iqser-full-page-error',
@ -21,6 +22,7 @@ import { shareLast } from '../../utils';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FullPageErrorComponent {
translations = connectionStatusTranslations;
readonly iconButtonTypes = IconButtonTypes;
readonly connectionStatus$: Observable<string | undefined>;

View File

@ -0,0 +1,6 @@
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
export const connectionStatusTranslations: { [key in string]: string } = {
online: _('error.online'),
offline: _('error.offline'),
} as const;