Skip to content
Snippets Groups Projects
Commit 9761e070 authored by rhenck's avatar rhenck
Browse files

[editor] Use translation service for toolbar and unit-view

Other components will follow.
parent c1e9f85a
No related branches found
No related tags found
No related merge requests found
<mat-toolbar> <mat-toolbar>
<button mat-raised-button (click)="load()"> <button mat-raised-button (click)="load()">
{{'loadUnit' | translate}} {{'toolbar.loadUnit' | translate}}
<mat-icon>file_upload</mat-icon> <mat-icon>file_upload</mat-icon>
</button> </button>
<button mat-raised-button (click)="save()"> <button mat-raised-button (click)="save()">
{{'saveUnit' | translate}} {{'toolbar.saveUnit' | translate}}
<mat-icon>file_download</mat-icon> <mat-icon>file_download</mat-icon>
</button> </button>
</mat-toolbar> </mat-toolbar>
<div [style.height.%]="100"> <div [style.height.%]="100">
<button class="drawer-button show-elements-button" (click)="toolbox_drawer.toggle()"> <button class="drawer-button show-elements-button" (click)="toolbox_drawer.toggle()">
<span> <span>
ELEMENTE {{'elements' | translate | uppercase}}
</span> </span>
</button> </button>
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
<mat-icon class="page-alwaysVisible-icon">assignment</mat-icon> <mat-icon class="page-alwaysVisible-icon">assignment</mat-icon>
</ng-container> </ng-container>
<ng-container *ngIf="!page.alwaysVisible && unit.pages[0].alwaysVisible === false"> <ng-container *ngIf="!page.alwaysVisible && unit.pages[0].alwaysVisible === false">
Seite {{i + 1}} {{'page' | translate }} {{i + 1}}
</ng-container> </ng-container>
<ng-container *ngIf="!page.alwaysVisible && unit.pages[0].alwaysVisible === true"> <ng-container *ngIf="!page.alwaysVisible && unit.pages[0].alwaysVisible === true">
Seite {{i}} {{'page' | translate }} {{i}}
</ng-container> </ng-container>
<button mat-icon-button class="menu-button" [matMenuTriggerFor]="pageMenu"> <button mat-icon-button class="menu-button" [matMenuTriggerFor]="pageMenu">
...@@ -34,39 +34,39 @@ ...@@ -34,39 +34,39 @@
<button *ngIf="!page.alwaysVisible" <button *ngIf="!page.alwaysVisible"
mat-menu-item (click)="movePage(page,'up')"> mat-menu-item (click)="movePage(page,'up')">
<mat-icon>west</mat-icon> <mat-icon>west</mat-icon>
<span>nach vorn</span> <span>{{'forward' | translate }}</span>
</button> </button>
<button *ngIf="!page.alwaysVisible" <button *ngIf="!page.alwaysVisible"
mat-menu-item (click)="movePage(page, 'down')"> mat-menu-item (click)="movePage(page, 'down')">
<mat-icon>east</mat-icon> <mat-icon>east</mat-icon>
<span>nach hinten</span> <span>{{'backward' | translate }}</span>
</button> </button>
<button mat-menu-item (click)="deletePage(page)"> <button mat-menu-item (click)="deletePage(page)">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
<span>Löschen</span> <span>{{'delete' | translate }}</span>
</button> </button>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<mat-checkbox class="menuItem" [checked]="page.hasMaxWidth" <mat-checkbox class="menuItem" [checked]="page.hasMaxWidth"
(click)="$any($event).stopPropagation()" (click)="$any($event).stopPropagation()"
(change)="updateModel(page, 'hasMaxWidth', $any($event.source).checked)"> (change)="updateModel(page, 'hasMaxWidth', $any($event.source).checked)">
Maximalbreite {{'maxWidth' | translate }}
</mat-checkbox> </mat-checkbox>
<mat-form-field *ngIf="page.hasMaxWidth" class="menuItem" appearance="fill"> <mat-form-field *ngIf="page.hasMaxWidth" class="menuItem" appearance="fill">
<mat-label>Maximalbreite</mat-label> <mat-label>{{'maxWidth' | translate }}</mat-label>
<input matInput type="number" min="0" #maxWidth="ngModel" <input matInput type="number" min="0" #maxWidth="ngModel"
[ngModel]="page.maxWidth" [ngModel]="page.maxWidth"
(click)="$any($event).stopPropagation()" (click)="$any($event).stopPropagation()"
(ngModelChange)="updateModel(page,'maxWidth', $event, maxWidth.valid)"> (ngModelChange)="updateModel(page,'maxWidth', $event, maxWidth.valid)">
</mat-form-field> </mat-form-field>
<mat-form-field class="menuItem" appearance="fill"> <mat-form-field class="menuItem" appearance="fill">
<mat-label>Randbreite</mat-label> <mat-label>{{'marginWidth' | translate }}</mat-label>
<input matInput type="number" min="0" #margin="ngModel" <input matInput type="number" min="0" #margin="ngModel"
[ngModel]="page.margin" [ngModel]="page.margin"
(click)="$any($event).stopPropagation()" (click)="$any($event).stopPropagation()"
(ngModelChange)="updateModel(page,'margin', $event, margin.valid)"> (ngModelChange)="updateModel(page,'margin', $event, margin.valid)">
</mat-form-field> </mat-form-field>
<mat-form-field class="menuItem" appearance="fill"> <mat-form-field class="menuItem" appearance="fill">
<mat-label>Hintergrundfarbe</mat-label> <mat-label>{{'backgroundColor' | translate }}</mat-label>
<input matInput type="color" <input matInput type="color"
[value]="page.backgroundColor" [value]="page.backgroundColor"
(change)="updateModel(page,'backgroundColor', $any($event.target).value)"> (change)="updateModel(page,'backgroundColor', $any($event.target).value)">
...@@ -76,25 +76,22 @@ ...@@ -76,25 +76,22 @@
[ngModel]="page.alwaysVisible" [ngModel]="page.alwaysVisible"
(click)="$any($event).stopPropagation()" (click)="$any($event).stopPropagation()"
(change)="updateModel(page, 'alwaysVisible', $any($event.source).checked)"> (change)="updateModel(page, 'alwaysVisible', $any($event.source).checked)">
Immer angezeigt {{'alwaysVisible' | translate }}
</mat-checkbox> </mat-checkbox>
<mat-form-field *ngIf="page.alwaysVisible" class="menuItem" appearance="fill"> <mat-form-field *ngIf="page.alwaysVisible" class="menuItem" appearance="fill">
<mat-label>Position</mat-label> <mat-label>{{'position' | translate }}</mat-label>
<mat-select [value]="page.alwaysVisiblePagePosition" <mat-select [value]="page.alwaysVisiblePagePosition"
(click)="$any($event).stopPropagation()" (click)="$any($event).stopPropagation()"
(selectionChange)="updateModel(page, 'alwaysVisiblePagePosition', $event.value)"> (selectionChange)="updateModel(page, 'alwaysVisiblePagePosition', $event.value)">
<mat-option *ngFor="let option of [{displayValue: 'links', value: 'left'}, <mat-option *ngFor="let option of ['left', 'right', 'top', 'bottom']"
{displayValue: 'rechts', value: 'right'}, [value]="option">
{displayValue: 'oben', value: 'top'}, {{option | translate}}
{displayValue: 'unten', value: 'bottom'}]"
[value]="option.value">
{{option.displayValue}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field class="menuItem" appearance="fill" <mat-form-field class="menuItem" appearance="fill"
*ngIf="page.alwaysVisible"> *ngIf="page.alwaysVisible">
<mat-label>Seitenverhältnis (in Prozent)</mat-label> <mat-label>{{'alwaysVisibleAspectRatio' | translate }}</mat-label>
<input matInput type="number" min="0" max="100" <input matInput type="number" min="0" max="100"
[ngModel]="page.alwaysVisibleAspectRatio" [ngModel]="page.alwaysVisibleAspectRatio"
(click)="$any($event).stopPropagation()" (click)="$any($event).stopPropagation()"
...@@ -122,7 +119,7 @@ ...@@ -122,7 +119,7 @@
<button class="drawer-button show-properties-button" (click)="properties_drawer.toggle()"> <button class="drawer-button show-properties-button" (click)="properties_drawer.toggle()">
<span> <span>
EIGENSCHAFTEN {{'properties' | translate | uppercase}}
</span> </span>
</button> </button>
</div> </div>
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { UpperCasePipe } from '@angular/common';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { UnitService } from '../unit.service'; import { UnitService } from '../unit.service';
......
{ {
"loadUnit": "Unit laden", "elements": "Elemente",
"saveUnit": "Unit speichern", "properties": "Eigenschaften",
"page": "Seite",
"forward": "nach vorn",
"backward": "nach hinten",
"delete": "Löschen",
"maxWidth": "Maximalbreite",
"marginWidth": "Randbreite",
"backgroundColor": "Hintergrundfarbe",
"alwaysVisible": "Immer angezeigt",
"position": "Position",
"alwaysVisibleAspectRatio": "Seitenverhältnis (in Prozent)",
"left": "Links",
"right": "Rechts",
"top": "Oben",
"bottom": "Unten",
"toolbar": {
"loadUnit": "Unit laden",
"saveUnit": "Unit speichern"
},
"player": { "player": {
"autoStart": "Autostart", "autoStart": "Autostart",
"loop": "Wiederholt abspielen", "loop": "Wiederholt abspielen",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment