Skip to content

Commit

Permalink
UI: fix & update translations (#2595)
Browse files Browse the repository at this point in the history
* Fix Emergency-Slider Translation
* Fix EMERGENCY_RESERVE Case Match
  • Loading branch information
Sn0w3y committed Mar 31, 2024
1 parent b3f2eee commit dc3d4d9
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion ui/src/app/edge/history/storage/socchart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class SocStorageChartComponent extends AbstractHistoryChart implements On
if (channelAddress.channelId === 'ActualReserveSoc') {
datasets.push({
label:
this.emergencyCapacityReserveComponents.length > 1 ? component.alias : this.translate.instant("Edge.Index.EmergencyReserve.emergencyReserve"),
this.emergencyCapacityReserveComponents.length > 1 ? component.alias : this.translate.instant("Edge.Index.EmergencyReserve.EMERGENCY_RESERVE"),
data: data,
borderDash: [3, 3],

Expand Down
12 changes: 6 additions & 6 deletions ui/src/app/edge/live/common/storage/modal/modal.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<tr>
<ion-item-divider color="light">
<td style="width: 70%;" translate>
Edge.Index.EmergencyReserve.emergencyReserve
Edge.Index.EmergencyReserve.EMERGENCY_RESERVE
</td>
<td style="width: 15%;" class="align_right">
{{formGroup.value[component.id]?.['emergencyReserveController']?.reserveSoc|
Expand All @@ -133,7 +133,7 @@
<ion-note class="ion-text-wrap ion-align-items-center">
<ion-text>
<small translate>
Edge.Index.EmergencyReserve.InfoForEmergencyReserveSlider
Edge.Index.EmergencyReserve.INFO_FOR_EMERGENCY_RESERVE_SLIDER
</small>
</ion-text>
</ion-note>
Expand Down Expand Up @@ -486,7 +486,7 @@
<tr>
<ion-item-divider color="light">
<td style="width: 70%;" translate>
Edge.Index.EmergencyReserve.emergencyReserve
Edge.Index.EmergencyReserve.EMERGENCY_RESERVE
</td>
<td style="width: 15%;" class="align_right">
{{formGroup.value[component.id]?.['emergencyReserveController']?.reserveSoc|
Expand Down Expand Up @@ -515,7 +515,7 @@
<ion-note class="ion-text-wrap ion-align-items-center">
<ion-text>
<small translate>
Edge.Index.EmergencyReserve.InfoForEmergencyReserveSlider
Edge.Index.EmergencyReserve.INFO_FOR_EMERGENCY_RESERVE_SLIDER
</small>
</ion-text>
</ion-note>
Expand Down Expand Up @@ -720,7 +720,7 @@
<tr>
<ion-item-divider color="light">
<td style="width: 70%;" translate>
Edge.Index.EmergencyReserve.emergencyReserve
Edge.Index.EmergencyReserve.EMERGENCY_RESERVE
</td>
<td style="width: 15%;" class="align_right">
{{formGroup.value[component.id]?.['emergencyReserveController']?.reserveSoc|
Expand All @@ -747,7 +747,7 @@
<ion-note class="ion-text-wrap ion-align-items-center">
<ion-text>
<small translate>
Edge.Index.EmergencyReserve.InfoForEmergencyReserveSlider
Edge.Index.EmergencyReserve.INFO_FOR_EMERGENCY_RESERVE_SLIDER
</small>
</ion-text>
</ion-note>
Expand Down
22 changes: 11 additions & 11 deletions ui/src/app/edge/settings/alerting/alerting.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
<ion-row>
<ion-col size="6">
<ion-label>
<span translate>Edge.Config.Alerting.activate</span>
<span translate>Edge.Config.ALERTING.ACTIVATE</span>
</ion-label>
</ion-col>
<ion-col size="6">
<ion-label>
<span translate>Edge.Config.Alerting.delay</span>
<span translate>Edge.Config.ALERTING.DELAY</span>
</ion-label>
</ion-col>
</ion-row>
Expand All @@ -47,7 +47,7 @@
<ion-row>
<ion-col size="12">
<ion-label class="wrap-text" style="opacity: 0.7;">
<span translate>Edge.Config.Alerting.offlineAlerting</span>
<span translate>Edge.Config.ALERTING.OFFLINE</span>
</ion-label>
</ion-col>
<ion-col size="6">
Expand All @@ -72,7 +72,7 @@
<ion-row>
<ion-col size="12">
<ion-label class="wrap-text" style="opacity: 0.7;">
<span translate>Edge.Config.Alerting.faultAlerting</span>
<span translate>Edge.Config.ALERTING.FAULT</span>
</ion-label>
</ion-col>
<ion-col size="6">
Expand All @@ -97,7 +97,7 @@
<ion-row>
<ion-col size="12">
<ion-label class="wrap-text" style="opacity: 0.7;">
<span translate>Edge.Config.Alerting.warningAlerting</span>
<span translate>Edge.Config.ALERTING.WARNING</span>
</ion-label>
</ion-col>
<ion-col size="6">
Expand Down Expand Up @@ -153,17 +153,17 @@
</ion-col>
<ion-col size="2.5">
<ion-label class="wrap-text">
<span translate>Edge.Config.Alerting.offlineAlerting</span>
<span translate>Edge.Config.ALERTING.OFFLINE</span>
</ion-label>
</ion-col>
<ion-col size="2.5">
<ion-label class="wrap-text">
<span translate>Edge.Config.Alerting.faultAlerting</span>
<span translate>Edge.Config.ALERTING.FAULT</span>
</ion-label>
</ion-col>
<ion-col size="2.5">
<ion-label class="wrap-text">
<span translate>Edge.Config.Alerting.warningAlerting</span>
<span translate>Edge.Config.ALERTING.WARNING</span>
</ion-label>
</ion-col>
</ion-row>
Expand All @@ -182,7 +182,7 @@
<ion-col size="2.5">
<ion-select class="custom-options" interface="popover" formControlName="offlineEdgeDelay">
<ion-select-option [value]="0">
<span translate>Edge.Config.Alerting.deactivated</span>
<span translate>Edge.Config.ALERTING.DEACTIVATED</span>
</ion-select-option>
<ion-select-option *ngFor="let option of defaultValues[AlertingType.offline]"
[value]="option.value">
Expand All @@ -197,7 +197,7 @@
<ion-col size="2.5">
<ion-select class="custom-options" interface="popover" formControlName="faultEdgeDelay">
<ion-select-option [value]="0">
<span translate>Edge.Config.Alerting.deactivated</span>
<span translate>Edge.Config.ALERTING.DEACTIVATED</span>
</ion-select-option>
<ion-select-option *ngFor="let option of defaultValues[AlertingType.fault]"
[value]="option.value">
Expand All @@ -212,7 +212,7 @@
<ion-col size="2.5">
<ion-select class="custom-options" interface="popover" formControlName="warningEdgeDelay">
<ion-select-option [value]="0">
<span translate>Edge.Config.Alerting.deactivated</span>
<span translate>Edge.Config.ALERTING.DEACTIVATED</span>
</ion-select-option>
<ion-select-option *ngFor="let option of defaultValues[AlertingType.warning]"
[value]="option.value">
Expand Down
16 changes: 8 additions & 8 deletions ui/src/app/edge/settings/alerting/alerting.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,22 @@ export class AlertingComponent implements OnInit {
*/
protected getLabelToDelay(delay: number): string {
if (delay <= 0) {
return this.translate.instant("Edge.Config.Alerting.deactivated");
return this.translate.instant("Edge.Config.ALERTING.DEACTIVATED");
}
if (delay >= 1440) {
delay = delay / 1440;
return delay + ' ' + (delay == 1
? this.translate.instant("Edge.Config.Alerting.interval.day")
: this.translate.instant("Edge.Config.Alerting.interval.days"));
? this.translate.instant("General.TIME.DAY")
: this.translate.instant("General.TIME.DAYS"));
} else if (delay >= 60) {
delay = delay / 60;
return delay + ' ' + (delay == 1
? this.translate.instant("Edge.Config.Alerting.interval.hour")
: this.translate.instant("Edge.Config.Alerting.interval.hours"));
? this.translate.instant("General.TIME.HOUR")
: this.translate.instant("General.TIME.HOURS"));
} else {
return delay + ' ' + (delay == 1
? this.translate.instant("Edge.Config.Alerting.interval.minute")
: this.translate.instant("Edge.Config.Alerting.interval.minutes"));
? this.translate.instant("General.TIME.MINUTE")
: this.translate.instant("General.TIME.MINUTES"));
}
}

Expand Down Expand Up @@ -292,7 +292,7 @@ export class AlertingComponent implements OnInit {
}).catch(reason => {
let error = reason.error;
console.error(error);
this.errorToast(this.translate.instant('Edge.Config.Alerting.toast.error'), error.message);
this.errorToast(this.translate.instant('Edge.Config.ALERTING.TOAST.ERROR'), error.message);
reject(reason);
}).finally(() => {
this.service.stopSpinner(this.spinnerId);
Expand Down
4 changes: 2 additions & 2 deletions ui/src/assets/i18n/cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@
"Edge": {
"Index": {
"EmergencyReserve": {
"InfoForEmergencyReserveSlider": "Aktivací nouzové rezervy výkonu lze libovolně zvolit hodnotu mezi 5 % a 100 %.",
"emergencyReserve": "pohotovostní rezerva"
"INFO_FOR_EMERGENCY_RESERVE_SLIDER": "Aktivací nouzové rezervy výkonu lze libovolně zvolit hodnotu mezi 5 % a 100 %.",
"EMERGENCY_RESERVE": "pohotovostní rezerva"
},
"Energymonitor": {
"activePower": "Činný výkon",
Expand Down
4 changes: 2 additions & 2 deletions ui/src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"Edge": {
"Index": {
"EmergencyReserve": {
"InfoForEmergencyReserveSlider": "Durch Aktivieren kann eine Notstromreserve zwischen 5 % und 100 % der Batteriekapazität eingestellt werden.",
"emergencyReserve": "Notstromreserve"
"INFO_FOR_EMERGENCY_RESERVE_SLIDER": "Durch Aktivieren kann eine Notstromreserve zwischen 5 % und 100 % der Batteriekapazität eingestellt werden.",
"EMERGENCY_RESERVE": "Notstromreserve"
},
"Energymonitor": {
"activePower": "Ausgabeleistung",
Expand Down
4 changes: 2 additions & 2 deletions ui/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"Edge": {
"Index": {
"EmergencyReserve": {
"InfoForEmergencyReserveSlider": "By activating the emergency power reserve, the value can be freely selected between 5% and 100%.",
"emergencyReserve": "Emergencyreserve"
"INFO_FOR_EMERGENCY_RESERVE_SLIDER": "By activating the emergency power reserve, the value can be freely selected between 5% and 100%.",
"EMERGENCY_RESERVE": "Emergencyreserve"
},
"Energymonitor": {
"activePower": "Active power",
Expand Down
4 changes: 2 additions & 2 deletions ui/src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@
"Edge": {
"Index": {
"EmergencyReserve": {
"InfoForEmergencyReserveSlider": "Al activar la reserva de energía de emergencia, el valor puede seleccionarse libremente entre el 5% y el 100%.",
"emergencyReserve": "reserva de emergencia"
"INFO_FOR_EMERGENCY_RESERVE_SLIDER": "Al activar la reserva de energía de emergencia, el valor puede seleccionarse libremente entre el 5% y el 100%.",
"EMERGENCY_RESERVE": "reserva de emergencia"
},
"Energymonitor": {
"activePower": "Potencia de salida",
Expand Down
4 changes: 2 additions & 2 deletions ui/src/assets/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@
"Edge": {
"Index": {
"EmergencyReserve": {
"InfoForEmergencyReserveSlider": "En activant la réserve d'énergie de secours, la valeur peut être librement choisie entre 5 % et 100 %.",
"emergencyReserve": "réserve d'urgence"
"INFO_FOR_EMERGENCY_RESERVE_SLIDER": "En activant la réserve d'énergie de secours, la valeur peut être librement choisie entre 5 % et 100 %.",
"EMERGENCY_RESERVE": "réserve d'urgence"
},
"Energymonitor": {
"activePower": "Puissance Active",
Expand Down
4 changes: 2 additions & 2 deletions ui/src/assets/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"Edge": {
"Index": {
"EmergencyReserve": {
"InfoForEmergencyReserveSlider": "緊急電力予備を有効にすることで、値は5%から100%まで自由に選択することができます。",
"emergencyReserve": "緊急予備"
"INFO_FOR_EMERGENCY_RESERVE_SLIDER": "緊急電力予備を有効にすることで、値は5%から100%まで自由に選択することができます。",
"EMERGENCY_RESERVE": "緊急予備"
},
"Energymonitor": {
"activePower": "アクティブパワー",
Expand Down
4 changes: 2 additions & 2 deletions ui/src/assets/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@
"Edge": {
"Index": {
"EmergencyReserve": {
"InfoForEmergencyReserveSlider": "Door de noodstroomreserve te activeren, kan de waarde vrij worden gekozen tussen 5% en 100%.",
"emergencyReserve": "noodreserve"
"INFO_FOR_EMERGENCY_RESERVE_SLIDER": "Door de noodstroomreserve te activeren, kan de waarde vrij worden gekozen tussen 5% en 100%.",
"EMERGENCY_RESERVE": "noodreserve"
},
"Energymonitor": {
"activePower": "Actief vermogen",
Expand Down

0 comments on commit dc3d4d9

Please sign in to comment.