Translate alert page

This commit is contained in:
Matteo Gheza 2023-10-23 15:53:34 +02:00
parent 250ec74f69
commit 65551a1f79
4 changed files with 43 additions and 15 deletions

View File

@ -1,5 +1,5 @@
<div class="modal-header">
<h4 class="modal-title pull-left">Stato dell'allerta</h4>
<h4 class="modal-title pull-left" translate>alert.state</h4>
<button type="button" class="btn-close close pull-right" [attr.aria-label]="'close'|translate|titlecase" (click)="bsModalRef.hide()">
<span aria-hidden="true" class="visually-hidden">&times;</span>
</button>
@ -11,13 +11,13 @@
</div>
<div class="modal-body" *ngIf="id !== 0">
<div class="alert alert-danger" role="alert" *ngIf="alertClosed">
<i class="fas fa-exclamation-triangle"></i> Allerta conclusa
<i class="fas fa-exclamation-triangle"></i> {{ 'alert.closed'|translate }}
</div>
<table class="table table-border table-striped w-100">
<thead>
<tr>
<td>Nome</td>
<td colspan="2">Stato risposta</td>
<td>{{ 'name'|translate|titlecase }}</td>
<td colspan="2">{{ 'alert.response_status'|translate }}</td>
</tr>
</thead>
<tbody>
@ -31,32 +31,32 @@
</td>
<ng-container *ngIf="crewUser.accepted == null && alertClosed">
<td style="width: 1px;"><i class="fa fa-times" style="color:red"></i></td>
<td>Nessuna risposta</td>
<td translate>alert.no_response</td>
</ng-container>
<ng-container *ngIf="crewUser.accepted == null && !alertClosed">
<td style="width: 1px;"><i class="fas fa-spinner fa-spin"></i></td>
<td>In attesa di risposta</td>
<td translate>alert.waiting_for_response</td>
</ng-container>
<ng-container *ngIf="crewUser.accepted == true">
<td style="width: 1px;"><i class="fa fa-check" style="color:green"></i></td>
<td>Presente</td>
<td translate>alert.response_yes</td>
</ng-container>
<ng-container *ngIf="crewUser.accepted == false">
<td style="width: 1px;"><i class="fa fa-times" style="color:red"></i></td>
<td>Non presente</td>
<td translate>alert.response_no</td>
</ng-container>
</tr>
</ng-container>
</tbody>
</table>
<div class="well well-lg card card-block card-header">
<label for="details" class="form-label">Dettagli allerta</label>
<label for="details" class="form-label" translate>alert.details</label>
<textarea class="form-control" id="details" rows="3"
[(ngModel)]="notes" [disabled]="!auth.profile.can('users-read') || alertClosed==1" (keyup)="notesUpdated()"></textarea>
<button class="btn btn-secondary mt-2" (click)="saveAlertSettings()" [disabled]="!auth.profile.can('users-read') || !notesHasUnsavedChanges || alertClosed">Salva</button>
<button class="btn btn-secondary mt-2" (click)="saveAlertSettings()" [disabled]="!auth.profile.can('users-read') || !notesHasUnsavedChanges || alertClosed" translate>save_changes</button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" (click)="deleteAlert()" *ngIf="auth.profile.can('users-read') && !alertClosed">Rimuovi allerta corrente <i class="fas fa-exclamation-triangle"></i></button>
<button type="button" class="btn btn-danger" (click)="deleteAlert()" *ngIf="auth.profile.can('users-read') && !alertClosed">{{ 'alert.delete'|translate }} <i class="fas fa-exclamation-triangle"></i></button>
<button type="button" class="btn btn-secondary" (click)="bsModalRef.hide()">{{ 'close'|translate }}</button>
</div>

View File

@ -13,15 +13,15 @@
</div>
<alert type="danger" *ngIf="alerts.length > 0">
<strong>Attenzione!</strong> Allertamento in corso.<br>
<strong>{{ 'warning'|translate|titlecase }}!</strong> {{ 'alert.warning_body'|translate }}<br>
<ng-container *ngIf="alerts.length == 1">
Emergenza attuale: <a (click)="openAlert(alerts[0]['id'])"><b>{{ alerts[0]["created_at"] | date:'dd/MM/YYYY, HH:mm:ss' }}</b> (premere per ulteriori informazioni)</a>
{{ 'alert.current_alert'|translate }}: <a (click)="openAlert(alerts[0]['id'])"><b>{{ alerts[0]["created_at"] | date:'dd/MM/YYYY, HH:mm:ss' }}</b> ({{ 'press_for_more_info'|translate }})</a>
</ng-container>
<ng-container *ngIf="alerts.length > 1">
Emergenze attuali:
{{ 'alert.current_alerts'|translate }}:
<ul>
<li *ngFor="let alert of alerts">
<a (click)="openAlert(alert['id'])"><b>{{ alert["created_at"] | date:'dd/MM/YYYY, HH:mm:ss' }}</b> (premere per ulteriori informazioni)</a>
<a (click)="openAlert(alert['id'])"><b>{{ alert["created_at"] | date:'dd/MM/YYYY, HH:mm:ss' }}</b> ({{ 'press_for_more_info'|translate }})</a>
</li>
</ul>
</ng-container>

View File

@ -32,6 +32,18 @@
"telegram_bot_token_request_failed": "Telegram bot token could not be generated. Please try again"
},
"alert": {
"warning_body": "Alert in progress.",
"current_alert": "Current alert",
"current_alerts": "Current alerts",
"state": "Alert state",
"closed": "Alert closed",
"response_status": "Response status",
"no_response": "No response",
"waiting_for_response": "Waiting for response",
"response_yes": "Available",
"response_no": "Not available",
"details": "Alert details",
"delete": "Remove current alert",
"delete_confirm_title": "Are you sure you want to remove this alert?",
"delete_confirm_text": "This action cannot be undone.",
"deleted_successfully": "Alert removed successfully",
@ -87,6 +99,8 @@
"training_load_failed": "Errore durante il caricamento dell'intervento. Riprovare più tardi",
"users_load_failed": "Errore durante il caricamento degli utenti. Riprovare più tardi"
},
"warning": "warning",
"press_for_more_info": "press here for more info",
"update_availability_schedule": "Update availability schedule",
"save_changes": "Save changes",
"close": "Close",

View File

@ -32,6 +32,18 @@
"telegram_bot_token_request_failed": "Errore durante la richiesta del token del bot Telegram. Riprova più tardi"
},
"alert": {
"warning_body": "Allertamento in corso.",
"current_alert": "Emergenza in corso",
"current_alerts": "Emergenze in corso",
"state": "Stato dell'allerta",
"closed": "Allerta rientrata",
"response_status": "Stato della risposta",
"no_response": "Nessuna risposta",
"waiting_for_response": "In attesa di risposta",
"response_yes": "Presente",
"response_no": "Non presente",
"details": "Dettagli dell'allerta",
"delete": "Ritira allerta",
"delete_confirm_title": "Sei sicuro di voler rimuovere questa allerta?",
"delete_confirm_text": "I vigili saranno avvisati della rimozione.",
"deleted_successfully": "Allerta rimossa con successo",
@ -87,6 +99,8 @@
"training_load_failed": "Errore durante il caricamento dell'intervento. Riprovare più tardi",
"users_load_failed": "Errore durante il caricamento degli utenti. Riprovare più tardi"
},
"warning": "attenzione",
"press_for_more_info": "premi qui per informazioni",
"update_availability_schedule": "Aggiorna programmazione disponibilità",
"save_changes": "Salva modifiche",
"close": "Chiudi",