Skip to content

Commit

Permalink
translate notifications
Browse files Browse the repository at this point in the history
Fixes #193
  • Loading branch information
lakhoune committed Jun 7, 2023
1 parent c6ede92 commit 090e148
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/app/cards/form/form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ export class FormComponent implements OnInit, OnDestroy {
sub = this.actionState.addCard$.subscribe((res) => {
if (res.type === httpFailure.type) {
this.notifs.addNotification(
new WarnMessage('Ein fehler ist passiert: ' + (res as any as { reason: string }).reason)
new WarnMessage(
this.translate.instant('notifications.add-card-failure', {
message: (res as any as { reason: string }).reason,
})
)
);
} else {
const message = this.translate.instant('notifications.add-card-success');
Expand Down
1 change: 1 addition & 0 deletions frontend/src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
"notifications": {
"notifications": "Benachrichtigungen",
"add-card-success": "Deine Karte wurde erfolgreich hinzugefügt.",
"add-card-failure": "Deine Karte konnte nicht hinzugefügt werden. Ein Fehler ist aufgetreten: {{message}}",
"pick-up": "Möchtest du zu deiner zuletzt besuchten Karte zurückkehren?",
"server-offline": "Der Server scheint offline zu sein.",
"check-later": "Versuche es später erneut.",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
"notifications": {
"notifications": "Notifications",
"add-card-success": "Your card has been added successfully",
"add-card-failure": "An error occured while adding your card: {{message}}",
"pick-up": "Do you want to pick up where you left off?",
"server-offline": "The server is offline.",
"check-later": "Please try again later.",
Expand Down

0 comments on commit 090e148

Please sign in to comment.