From eff8bb16a03eb6a14930ee198ec59f5855e30061 Mon Sep 17 00:00:00 2001 From: n200534 Date: Tue, 18 Aug 2026 15:33:42 +0530 Subject: [PATCH] Translate login authentication errors --- commafeed-client/src/app/client.test.ts | 23 +++++++++++++++++++ commafeed-client/src/app/client.ts | 9 ++++++++ commafeed-client/src/locales/ar/messages.po | 5 ++++ commafeed-client/src/locales/ca/messages.po | 5 ++++ commafeed-client/src/locales/cs/messages.po | 5 ++++ commafeed-client/src/locales/cy/messages.po | 5 ++++ commafeed-client/src/locales/da/messages.po | 5 ++++ commafeed-client/src/locales/de/messages.po | 5 ++++ commafeed-client/src/locales/en/messages.po | 5 ++++ commafeed-client/src/locales/es/messages.po | 5 ++++ commafeed-client/src/locales/fa/messages.po | 5 ++++ commafeed-client/src/locales/fi/messages.po | 5 ++++ commafeed-client/src/locales/fr/messages.po | 5 ++++ commafeed-client/src/locales/gl/messages.po | 5 ++++ commafeed-client/src/locales/hu/messages.po | 5 ++++ commafeed-client/src/locales/id/messages.po | 5 ++++ commafeed-client/src/locales/it/messages.po | 5 ++++ commafeed-client/src/locales/ja/messages.po | 5 ++++ commafeed-client/src/locales/ko/messages.po | 5 ++++ commafeed-client/src/locales/ms/messages.po | 5 ++++ commafeed-client/src/locales/nb/messages.po | 5 ++++ commafeed-client/src/locales/nl/messages.po | 5 ++++ commafeed-client/src/locales/nn/messages.po | 5 ++++ commafeed-client/src/locales/pl/messages.po | 5 ++++ commafeed-client/src/locales/pt/messages.po | 5 ++++ commafeed-client/src/locales/ru/messages.po | 5 ++++ commafeed-client/src/locales/sk/messages.po | 5 ++++ commafeed-client/src/locales/sv/messages.po | 5 ++++ commafeed-client/src/locales/tr/messages.po | 5 ++++ commafeed-client/src/locales/zh/messages.po | 5 ++++ commafeed-client/src/pages/auth/LoginPage.tsx | 4 ++-- .../src/pages/auth/RegistrationPage.tsx | 4 ++-- .../com/commafeed/e2e/AuthentificationIT.java | 2 +- 33 files changed, 177 insertions(+), 5 deletions(-) create mode 100644 commafeed-client/src/app/client.test.ts diff --git a/commafeed-client/src/app/client.test.ts b/commafeed-client/src/app/client.test.ts new file mode 100644 index 00000000..10da4bea --- /dev/null +++ b/commafeed-client/src/app/client.test.ts @@ -0,0 +1,23 @@ +import type { AxiosError } from "axios" +import { describe, expect, it } from "vitest" +import { loginErrorToStrings } from "./client" + +const axiosError = (status: number, data: unknown) => + ({ + isAxiosError: true, + response: { status, data }, + }) as AxiosError + +describe("loginErrorToStrings", () => { + it("uses the translated message for authentication errors", () => { + const error = axiosError(401, { message: "wrong username or password" }) + + expect(loginErrorToStrings(error, "Translated authentication error")).toEqual(["Translated authentication error"]) + }) + + it("preserves backend messages for unexpected errors", () => { + const error = axiosError(500, { message: "unexpected error" }) + + expect(loginErrorToStrings(error, "Translated authentication error")).toEqual(["unexpected error"]) + }) +}) diff --git a/commafeed-client/src/app/client.ts b/commafeed-client/src/app/client.ts index 25661e34..64b4c143 100644 --- a/commafeed-client/src/app/client.ts +++ b/commafeed-client/src/app/client.ts @@ -136,6 +136,15 @@ export const errorToStrings = (err: unknown) => { return strings } +/** + * Transform a login error into messages that can be displayed to the user. + * Authentication failures use a client-provided message so it can be translated. + */ +export const loginErrorToStrings = (err: unknown, authenticationErrorMessage: string) => { + if (isAuthenticationError(err)) return [authenticationErrorMessage] + return errorToStrings(err) +} + function isMessageError(err: AxiosError): err is AxiosError<{ message: string }> { return !!err.response && !!err.response.data && typeof err.response.data === "object" && "message" in err.response.data } diff --git a/commafeed-client/src/locales/ar/messages.po b/commafeed-client/src/locales/ar/messages.po index 0b8aadea..75be50b0 100644 --- a/commafeed-client/src/locales/ar/messages.po +++ b/commafeed-client/src/locales/ar/messages.po @@ -1150,6 +1150,11 @@ msgstr "موقع الكتروني" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "مرحباً! يبدو أن هذه هي المرة الأولى التي تقوم فيها بتشغيل CommaFeed. يرجى إنشاء حساب مسؤول للبدء." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "أصفر" diff --git a/commafeed-client/src/locales/ca/messages.po b/commafeed-client/src/locales/ca/messages.po index b5f77395..591ac082 100644 --- a/commafeed-client/src/locales/ca/messages.po +++ b/commafeed-client/src/locales/ca/messages.po @@ -1150,6 +1150,11 @@ msgstr "Lloc web" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Benvingut! Sembla que aquesta és la primera vegada que executeu CommaFeed. Creeu un compte d'administrador per començar." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Groc" diff --git a/commafeed-client/src/locales/cs/messages.po b/commafeed-client/src/locales/cs/messages.po index 17f8c49f..d8a913ac 100644 --- a/commafeed-client/src/locales/cs/messages.po +++ b/commafeed-client/src/locales/cs/messages.po @@ -1150,6 +1150,11 @@ msgstr "Webová stránka" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Vítejte! Zdá se, že je to poprvé, co spouštíte CommaFeed. Chcete-li začít, vytvořte si účet správce." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Žlutá" diff --git a/commafeed-client/src/locales/cy/messages.po b/commafeed-client/src/locales/cy/messages.po index fee6ddec..737de27f 100644 --- a/commafeed-client/src/locales/cy/messages.po +++ b/commafeed-client/src/locales/cy/messages.po @@ -1150,6 +1150,11 @@ msgstr "Gwefan" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Croeso! Ymddengys mai dyma'r tro cyntaf i chi redeg CommaFeed. Creuwch gyfrif gweinyddwr i ddechrau." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Melyn" diff --git a/commafeed-client/src/locales/da/messages.po b/commafeed-client/src/locales/da/messages.po index 0d579b8f..4c8401d0 100644 --- a/commafeed-client/src/locales/da/messages.po +++ b/commafeed-client/src/locales/da/messages.po @@ -1150,6 +1150,11 @@ msgstr "Hjemmeside" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Velkommen! Det ser ud til at være første gang, du kører CommaFeed. Opret venligst en administratorkonto for at komme i gang." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Gul" diff --git a/commafeed-client/src/locales/de/messages.po b/commafeed-client/src/locales/de/messages.po index d05bf3b5..1abb07a4 100644 --- a/commafeed-client/src/locales/de/messages.po +++ b/commafeed-client/src/locales/de/messages.po @@ -1150,6 +1150,11 @@ msgstr "Webseite" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Willkommen! Dies scheint das erste Mal zu sein, dass Sie CommaFeed ausführen. Bitte erstellen Sie ein Administrator-Konto, um zu beginnen." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Gelb" diff --git a/commafeed-client/src/locales/en/messages.po b/commafeed-client/src/locales/en/messages.po index 1239a514..e60ce569 100644 --- a/commafeed-client/src/locales/en/messages.po +++ b/commafeed-client/src/locales/en/messages.po @@ -1150,6 +1150,11 @@ msgstr "Website" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "Wrong username or password" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Yellow" diff --git a/commafeed-client/src/locales/es/messages.po b/commafeed-client/src/locales/es/messages.po index 6a6a2ccf..89fc9f22 100644 --- a/commafeed-client/src/locales/es/messages.po +++ b/commafeed-client/src/locales/es/messages.po @@ -1151,6 +1151,11 @@ msgstr "Sitio web" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "¡Bienvenido! Parece que esta es la primera vez que ejecutas CommaFeed. Por favor, crea una cuenta de administrador para empezar." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Amarillo" diff --git a/commafeed-client/src/locales/fa/messages.po b/commafeed-client/src/locales/fa/messages.po index 786c3b44..92e0cad0 100644 --- a/commafeed-client/src/locales/fa/messages.po +++ b/commafeed-client/src/locales/fa/messages.po @@ -1150,6 +1150,11 @@ msgstr "وب سایت" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "خوش آمدید! به نظر می‌رسد این اولین بار است که CommaFeed را اجرا می‌کنید. لطفاً برای شروع یک حساب مدیر ایجاد کنید." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "زرد" diff --git a/commafeed-client/src/locales/fi/messages.po b/commafeed-client/src/locales/fi/messages.po index 31b1a7ba..4c543691 100644 --- a/commafeed-client/src/locales/fi/messages.po +++ b/commafeed-client/src/locales/fi/messages.po @@ -1150,6 +1150,11 @@ msgstr "Verkkosivusto" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Tervetuloa! Näyttää siltä, että suoritat CommaFeediä ensimmäistä kertaa. Luo ylläpitäjän tili aloittaaksesi." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Keltainen" diff --git a/commafeed-client/src/locales/fr/messages.po b/commafeed-client/src/locales/fr/messages.po index a83518ae..6de0e87b 100644 --- a/commafeed-client/src/locales/fr/messages.po +++ b/commafeed-client/src/locales/fr/messages.po @@ -1150,6 +1150,11 @@ msgstr "Site web" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Bienvenue ! Il semble que ce soit le premier démarrage de Commafeed. Avant tout, vous devez créer un compte administrateur." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Jaune" diff --git a/commafeed-client/src/locales/gl/messages.po b/commafeed-client/src/locales/gl/messages.po index babc3f5d..a9b44730 100644 --- a/commafeed-client/src/locales/gl/messages.po +++ b/commafeed-client/src/locales/gl/messages.po @@ -1151,6 +1151,11 @@ msgstr "Páxina web" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Benvida! Semella que é a primeira vez que executas CommaFeed. Para comezar, crea unha conta de administración." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Amarelo" diff --git a/commafeed-client/src/locales/hu/messages.po b/commafeed-client/src/locales/hu/messages.po index 260a797b..3f3eb4d4 100644 --- a/commafeed-client/src/locales/hu/messages.po +++ b/commafeed-client/src/locales/hu/messages.po @@ -1150,6 +1150,11 @@ msgstr "Webhely" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Üdvözöljük! Úgy tűnik, ez az első alkalom, hogy a CommaFeedet futtatja. Kérjük, hozzon létre egy rendszergazdai fiókot a kezdéshez." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Sárga" diff --git a/commafeed-client/src/locales/id/messages.po b/commafeed-client/src/locales/id/messages.po index 27b6b893..89421348 100644 --- a/commafeed-client/src/locales/id/messages.po +++ b/commafeed-client/src/locales/id/messages.po @@ -1150,6 +1150,11 @@ msgstr "Situs Web" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Selamat datang! Ini sepertinya pertama kalinya Anda menjalankan CommaFeed. Silakan buat akun administrator untuk memulai." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Kuning" diff --git a/commafeed-client/src/locales/it/messages.po b/commafeed-client/src/locales/it/messages.po index d3f07316..38093c43 100644 --- a/commafeed-client/src/locales/it/messages.po +++ b/commafeed-client/src/locales/it/messages.po @@ -1150,6 +1150,11 @@ msgstr "Sito web" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Benvenuto! Sembra che sia la prima volta che esegui CommaFeed. Crea un account amministratore per iniziare." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Giallo" diff --git a/commafeed-client/src/locales/ja/messages.po b/commafeed-client/src/locales/ja/messages.po index c4c79054..7fcdbb0b 100644 --- a/commafeed-client/src/locales/ja/messages.po +++ b/commafeed-client/src/locales/ja/messages.po @@ -1150,6 +1150,11 @@ msgstr "ウェブサイト" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "ようこそ!CommaFeedを初めて実行するようです。開始するには管理者アカウントを作成してください。" +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "イエロー" diff --git a/commafeed-client/src/locales/ko/messages.po b/commafeed-client/src/locales/ko/messages.po index caaeb854..578ca7ac 100644 --- a/commafeed-client/src/locales/ko/messages.po +++ b/commafeed-client/src/locales/ko/messages.po @@ -1150,6 +1150,11 @@ msgstr "웹사이트" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "환영합니다! CommaFeed를 처음 실행하는 것 같습니다. 시작하려면 관리자 계정을 만드십시오." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "옐로우" diff --git a/commafeed-client/src/locales/ms/messages.po b/commafeed-client/src/locales/ms/messages.po index 47641ce8..61615e6f 100644 --- a/commafeed-client/src/locales/ms/messages.po +++ b/commafeed-client/src/locales/ms/messages.po @@ -1150,6 +1150,11 @@ msgstr "Laman web" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Selamat datang! Ini nampaknya kali pertama anda menjalankan CommaFeed. Sila cipta akaun pentadbir untuk bermula." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Kuning" diff --git a/commafeed-client/src/locales/nb/messages.po b/commafeed-client/src/locales/nb/messages.po index e282672c..20c8e5ea 100644 --- a/commafeed-client/src/locales/nb/messages.po +++ b/commafeed-client/src/locales/nb/messages.po @@ -1150,6 +1150,11 @@ msgstr "Nettsted" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Velkommen! Det ser ut til å være første gang du kjører CommaFeed. Vennligst opprett en administratorkonto for å komme i gang." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Gul" diff --git a/commafeed-client/src/locales/nl/messages.po b/commafeed-client/src/locales/nl/messages.po index c3556446..b1a41ec4 100644 --- a/commafeed-client/src/locales/nl/messages.po +++ b/commafeed-client/src/locales/nl/messages.po @@ -1150,6 +1150,11 @@ msgstr "Website" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Welkom! Dit lijkt de eerste keer te zijn dat je CommaFeed draait. Maak een beheerdersaccount aan om aan de slag te gaan." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Geel" diff --git a/commafeed-client/src/locales/nn/messages.po b/commafeed-client/src/locales/nn/messages.po index 6e1b0e55..c0fb06dd 100644 --- a/commafeed-client/src/locales/nn/messages.po +++ b/commafeed-client/src/locales/nn/messages.po @@ -1150,6 +1150,11 @@ msgstr "Nettstad" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Velkomen! Det ser ut til å vera fyrste gongen du køyrer CommaFeed. Ver venleg og opprett ein administratorkonto for å koma i gang." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Gul" diff --git a/commafeed-client/src/locales/pl/messages.po b/commafeed-client/src/locales/pl/messages.po index 87b99d5f..f80df0a5 100644 --- a/commafeed-client/src/locales/pl/messages.po +++ b/commafeed-client/src/locales/pl/messages.po @@ -1150,6 +1150,11 @@ msgstr "Strona internetowa" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Witaj! Wygląda na to, że uruchamiasz CommaFeed po raz pierwszy. Aby rozpocząć, utwórz konto administratora." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Żółty" diff --git a/commafeed-client/src/locales/pt/messages.po b/commafeed-client/src/locales/pt/messages.po index 29d9f98a..187ec381 100644 --- a/commafeed-client/src/locales/pt/messages.po +++ b/commafeed-client/src/locales/pt/messages.po @@ -1150,6 +1150,11 @@ msgstr "Site" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Bem-vindo! Esta parece ser a primeira vez que você está executando o CommaFeed. Crie uma conta de administrador para começar." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Amarelo" diff --git a/commafeed-client/src/locales/ru/messages.po b/commafeed-client/src/locales/ru/messages.po index 4f7333b1..3f8e6145 100644 --- a/commafeed-client/src/locales/ru/messages.po +++ b/commafeed-client/src/locales/ru/messages.po @@ -1150,6 +1150,11 @@ msgstr "Веб-сайт" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Добро пожаловать! Похоже, вы запускаете CommaFeed в первый раз. Пожалуйста, создайте учетную запись администратора, чтобы начать работу." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Желтый" diff --git a/commafeed-client/src/locales/sk/messages.po b/commafeed-client/src/locales/sk/messages.po index c41f01cb..66a97485 100644 --- a/commafeed-client/src/locales/sk/messages.po +++ b/commafeed-client/src/locales/sk/messages.po @@ -1150,6 +1150,11 @@ msgstr "Webová stránka" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Vitajte! Zdá sa, že CommaFeed spúšťate prvýkrát. Ak chcete začať, vytvorte si účet správcu." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Žltá" diff --git a/commafeed-client/src/locales/sv/messages.po b/commafeed-client/src/locales/sv/messages.po index 45a55941..1cd6575e 100644 --- a/commafeed-client/src/locales/sv/messages.po +++ b/commafeed-client/src/locales/sv/messages.po @@ -1150,6 +1150,11 @@ msgstr "Webbplats" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Välkommen! Det verkar vara första gången du kör CommaFeed. Skapa ett administratörskonto för att komma igång." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Gul" diff --git a/commafeed-client/src/locales/tr/messages.po b/commafeed-client/src/locales/tr/messages.po index 4e77c8b3..e8c3593c 100644 --- a/commafeed-client/src/locales/tr/messages.po +++ b/commafeed-client/src/locales/tr/messages.po @@ -1150,6 +1150,11 @@ msgstr "Web sitesi" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "Hoş geldiniz! Görünüşe göre CommaFeed'i ilk kez çalıştırıyorsunuz. Başlamak için lütfen bir yönetici hesabı oluşturun." +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "Sarı" diff --git a/commafeed-client/src/locales/zh/messages.po b/commafeed-client/src/locales/zh/messages.po index 8d41c712..89f8b5a3 100644 --- a/commafeed-client/src/locales/zh/messages.po +++ b/commafeed-client/src/locales/zh/messages.po @@ -1150,6 +1150,11 @@ msgstr "网站" msgid "Welcome! This appears to be the first time you're running CommaFeed. Please create an administrator account to get started." msgstr "欢迎!当前页仅当您第一次使用CommaFeed时出现,请创建一个管理员帐号以开始使用。" +#: src/pages/auth/LoginPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Wrong username or password" +msgstr "用户名或密码错误" + #: src/components/settings/DisplaySettings.tsx msgid "Yellow" msgstr "黄" diff --git a/commafeed-client/src/pages/auth/LoginPage.tsx b/commafeed-client/src/pages/auth/LoginPage.tsx index 67000f76..25086869 100644 --- a/commafeed-client/src/pages/auth/LoginPage.tsx +++ b/commafeed-client/src/pages/auth/LoginPage.tsx @@ -5,7 +5,7 @@ import { Anchor, Box, Button, Center, Container, Group, Paper, PasswordInput, St import { useForm } from "@mantine/form" import { useAsyncCallback } from "react-async-hook" import { Link } from "react-router-dom" -import { client, errorToStrings } from "@/app/client" +import { client, loginErrorToStrings } from "@/app/client" import { redirectToRootCategory } from "@/app/redirect/thunks" import { useAppDispatch, useAppSelector } from "@/app/store" import type { LoginRequest } from "@/app/types" @@ -39,7 +39,7 @@ export function LoginPage() { {login.error && ( - + )}
diff --git a/commafeed-client/src/pages/auth/RegistrationPage.tsx b/commafeed-client/src/pages/auth/RegistrationPage.tsx index e529d598..0a6ce986 100644 --- a/commafeed-client/src/pages/auth/RegistrationPage.tsx +++ b/commafeed-client/src/pages/auth/RegistrationPage.tsx @@ -5,7 +5,7 @@ import { Anchor, Box, Button, Center, Container, Group, Paper, PasswordInput, St import { useForm } from "@mantine/form" import { useAsyncCallback } from "react-async-hook" import { Link } from "react-router-dom" -import { client, errorToStrings } from "@/app/client" +import { client, errorToStrings, loginErrorToStrings } from "@/app/client" import { redirectToRootCategory } from "@/app/redirect/thunks" import { useAppDispatch, useAppSelector } from "@/app/store" import type { RegistrationRequest } from "@/app/types" @@ -65,7 +65,7 @@ export function RegistrationPage() { {login.error && ( - + )} diff --git a/commafeed-server/src/test/java/com/commafeed/e2e/AuthentificationIT.java b/commafeed-server/src/test/java/com/commafeed/e2e/AuthentificationIT.java index 89a8c527..87dc955c 100644 --- a/commafeed-server/src/test/java/com/commafeed/e2e/AuthentificationIT.java +++ b/commafeed-server/src/test/java/com/commafeed/e2e/AuthentificationIT.java @@ -36,7 +36,7 @@ class AuthentificationIT { page.navigate(getLoginPageUrl()); PlaywrightTestUtils.login(page, TestConstants.ADMIN_USERNAME, "wrong_password"); PlaywrightAssertions.assertThat(page.getByRole(AriaRole.ALERT)) - .containsText("wrong username or password"); + .containsText("Wrong username or password"); } @Test