From 47119bd2960c8e926d5283dfdbea5ad505297bc7 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 17 Aug 2024 10:56:43 +0200 Subject: [PATCH] Add error messages to translations Signed-off-by: Knut Ahlers --- src/langs/en.json | 4 ++++ src/main.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/langs/en.json b/src/langs/en.json index 12c0c13..68b35d4 100644 --- a/src/langs/en.json +++ b/src/langs/en.json @@ -53,6 +53,10 @@ "header": "Bot-Health" } }, + "errors": { + "loginFailedAccessDenied": "Access denied to this bot instance", + "loginFailedUnexpectedStatus": "Login failed unexpectedly" + }, "menu": { "headers": { "chatInteraction": "Chat Interaction", diff --git a/src/main.ts b/src/main.ts index d7ef905..95ea3a3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -177,9 +177,9 @@ const app = createApp({ }) .then((resp: Response): any => { if (resp.status !== 200) { - let errorText = 'Login failed unexpectedly' + let errorText = this.$t('errors.loginFailedUnexpectedStatus') if (resp.status === 403) { - errorText = 'Access denied to this bot instance' + errorText = this.$t('errors.loginFailedAccessDenied') } this.bus.emit(BusEventTypes.LoginProcessing, false)