mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-10 08:05:12 +00:00
fix(login): translate authentication and OTP strings (#12668)
Closes #12481 Closes #12226 # Which Problems Are Solved Login V2 still contained several hardcoded authentication-method and OTP strings, preventing them from following the selected locale or being overridden through custom Login translations. Additionally, the password-reset flow already referenced `password.errors.passwordResetNotAllowed`, but the key was missing from the Login V2 translations, causing the raw translation key to be displayed when password reset is disabled. # How the Problems Are Solved * Replaced the hardcoded authentication-method labels with Login V2 translation keys. * Replaced the OTP challenge and verification fallback messages with translated values. * Reused the existing `otp.verify.resendCode` translation for the resend button's accessible label. * Added `password.errors.passwordResetNotAllowed`. * Added the new keys to all supported Login V2 locales and mirrored them in `internal/query/v2-default.json` so frontend and API-provided default translations remain consistent. * Added unit coverage for the translated authentication labels and OTP failure paths. # How the Changes Are Tested * `pnpm nx run @zitadel/login:test-unit` * `pnpm nx run @zitadel/login:lint` * `pnpm nx run @zitadel/login:build` * `pnpm nx run-many --projects @zitadel/login @zitadel/client @zitadel/proto --targets lint build test` * Manually verified Login V2 with multiple locales, including authentication-method labels, OTP failure fallbacks, and the disabled password-reset flow.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { expect, Page } from "@playwright/test";
|
||||
import en from "../../locales/en.json";
|
||||
|
||||
const codeTextInput = "code-text-input";
|
||||
|
||||
@@ -8,5 +9,5 @@ export async function codeScreen(page: Page, code: string) {
|
||||
|
||||
export async function codeScreenExpect(page: Page, code: string) {
|
||||
await expect(page.getByTestId(codeTextInput)).toHaveValue(code);
|
||||
await expect(page.getByTestId("error").locator("div")).toContainText("Could not verify OTP code");
|
||||
await expect(page.getByTestId("error").locator("div")).toContainText(en.otp.errors.couldNotVerifyCode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user