refactor(auth): merge the duplicate login form and localize the auth screens
Gitea Actions Runner Test / test-job (push) Successful in 1s
CI / check (push) Successful in 1m8s
CI / tests-integration (push) Successful in 1m53s
CI / tests-unit (push) Successful in 1m59s
CI / tests-ui (push) Successful in 2m42s
CI / preflight (push) Skipped
CI / deploy (push) Successful in 4m33s
Gitea Actions Runner Test / test-job (push) Successful in 1s
CI / check (push) Successful in 1m8s
CI / tests-integration (push) Successful in 1m53s
CI / tests-unit (push) Successful in 1m59s
CI / tests-ui (push) Successful in 2m42s
CI / preflight (push) Skipped
CI / deploy (push) Successful in 4m33s
`home-login-form.tsx` and `login-form.tsx` were two ~240-line near-identical components. Delete the former and give `LoginForm` a `variant` prop: - `variant="page"` sr-only labels plus the register/forgot footer (/login) - `variant="compact"` visible labels, no footer (homepage sidebar) Field ids now come from `useId()`, so the two usages can never collide, and the hardcoded "Show"/"Hide"/"Loading" strings are translated. Localization of the login and register screens: - `home-login-form.tsx` was entirely hardcoded English. - `passwordStrength()` returned hardcoded "Weak"/"Fair"/"Good"/"Strong". - `register.ts` returned only English strings. It now returns a locale-independent `code` next to the message, and the form renders `t(code)` with the English string as a fallback. - Backfilled the new keys across all 25 locales, plus the login/register strings that were still English in most of them. `ar`, `fi` and `ja` had their entire login/register namespace in English and are now filled in. Locale parity stays at 0 missing keys, as `i18n:check` requires. Copy that did not match the enforced rules: the UI advertised "min 8 chars" (EN) / "min 6 tekens" (NL) while registration requires 12 characters plus an uppercase, a lowercase, a digit and a special character. Corrected in every locale. `password-reset.ts` enforced only 6 characters and is raised to 12 to match registration. Accessibility: `login-form.tsx` had no `<label>`, no `id` and no `required` on any field. All three are now present, and error banners are announced with `role="alert"`. Adds `src/i18n/auth-messages.test.ts`, which asserts every `RegisterErrorCode` resolves to a non-empty message in all 25 locales; verified it fails when a key is removed. The existing register tests now also assert the error `code`.
This commit is contained in:
1 parent
3d828a61ab
commit
6bffc53779
33 files changed
+1756
-842
No files matched your search
+47
-16
@@ -839,11 +839,15 @@
|
||||
"errorInvalid2fa": "Nieprawidłowy kod 2FA",
|
||||
"welcomeBack": "Witaj z powrotem",
|
||||
"welcomeBackSub": "Zaloguj się, aby kontynuować w {hotelName}",
|
||||
"errorUnverified": "Please verify your email before signing in.",
|
||||
"errorCaptcha": "Captcha verification failed. Please try again.",
|
||||
"whoIsOnline": "Who's online",
|
||||
"newestCitizens": "Newest citizens",
|
||||
"usersOnline": "{count} online"
|
||||
"errorUnverified": "Potwierdź swój e-mail przed zalogowaniem.",
|
||||
"errorCaptcha": "Weryfikacja captcha nie powiodła się. Spróbuj ponownie.",
|
||||
"whoIsOnline": "Kto jest online",
|
||||
"newestCitizens": "Najnowsi mieszkańcy",
|
||||
"usersOnline": "{count} online",
|
||||
"username": "Nazwa użytkownika",
|
||||
"password": "Hasło",
|
||||
"showPassword": "Pokaż",
|
||||
"hidePassword": "Ukryj"
|
||||
},
|
||||
"register": {
|
||||
"title": "Utwórz konto",
|
||||
@@ -854,7 +858,7 @@
|
||||
"confirmPassword": "Powtórz hasło",
|
||||
"usernamePlaceholder": "Nazwa użytkownika",
|
||||
"emailPlaceholder": "E-mail",
|
||||
"passwordPlaceholder": "Hasło (min. 6 znaków)",
|
||||
"passwordPlaceholder": "Hasło (min. 12 znaków)",
|
||||
"confirmPasswordPlaceholder": "Powtórz hasło",
|
||||
"selectOutfit": "Wybierz swój strój",
|
||||
"termsAccept": "Mam ukończone 18 lat i akceptuję warunki i zasady hotelu {hotel}.",
|
||||
@@ -866,7 +870,7 @@
|
||||
"termsError": "Aby się zarejestrować, musisz zaakceptować regulamin.",
|
||||
"usernameError": "Nazwa użytkownika jest wymagana.",
|
||||
"emailError": "Wymagany jest prawidłowy adres e-mail.",
|
||||
"passwordError": "Hasło musi mieć co najmniej 6 znaków.",
|
||||
"passwordError": "Hasło musi mieć co najmniej 12 znaków",
|
||||
"confirmPasswordError": "Hasła nie pasują.",
|
||||
"termsRequired": "Musisz zaakceptować warunki i zasady.",
|
||||
"usernameRequired": "Nazwa użytkownika jest wymagana.",
|
||||
@@ -877,14 +881,39 @@
|
||||
"alreadyHaveAccountLink": "Zaloguj się",
|
||||
"whoIsOnline": "Kto jest online",
|
||||
"usersOnline": "{count} online",
|
||||
"accepted": "Accepted & agreed",
|
||||
"showPassword": "Show",
|
||||
"hidePassword": "Hide",
|
||||
"accountDetails": "Account details",
|
||||
"credentials": "Credentials & security",
|
||||
"newestCitizens": "Newest citizens",
|
||||
"accepted": "Zaakceptowano i zgadzam się",
|
||||
"showPassword": "Pokaż",
|
||||
"hidePassword": "Ukryj",
|
||||
"accountDetails": "Dane konta",
|
||||
"credentials": "Dane logowania i bezpieczeństwo",
|
||||
"newestCitizens": "Najnowsi mieszkańcy",
|
||||
"ageVerified": "Mam 18+ i akceptuję wymóg wieku.",
|
||||
"invitedBy": "Zaproszony przez {username}"
|
||||
"invitedBy": "Zaproszony przez {username}",
|
||||
"strengthWeak": "Słabe",
|
||||
"strengthFair": "Średnie",
|
||||
"strengthGood": "Dobre",
|
||||
"strengthStrong": "Silne",
|
||||
"passwordMinLength": "Hasło musi mieć co najmniej 12 znaków",
|
||||
"passwordUpper": "Hasło musi zawierać co najmniej jedną wielką literę",
|
||||
"passwordLower": "Hasło musi zawierać co najmniej jedną małą literę",
|
||||
"passwordDigit": "Hasło musi zawierać co najmniej jedną cyfrę",
|
||||
"passwordSpecial": "Hasło musi zawierać co najmniej jeden znak specjalny",
|
||||
"passwordMaxLength": "Hasło jest za długie",
|
||||
"usernameMinLength": "Nazwa użytkownika musi mieć co najmniej 3 znaki",
|
||||
"usernameMaxLength": "Nazwa użytkownika może mieć maksymalnie 25 znaków",
|
||||
"usernamePattern": "Nazwa użytkownika może zawierać tylko litery, cyfry, podkreślenie i myślnik",
|
||||
"usernameReserved": "Ta nazwa użytkownika jest zarezerwowana",
|
||||
"emailValid": "Podaj prawidłowy adres e-mail",
|
||||
"emailDisposable": "Tymczasowe domeny e-mail nie są dozwolone",
|
||||
"passwordsMatch": "Hasła nie pasują.",
|
||||
"captchaFailed": "Weryfikacja captcha nie powiodła się. Spróbuj ponownie.",
|
||||
"usernameTaken": "Ta nazwa użytkownika jest już zajęta",
|
||||
"rateLimited": "Zbyt wiele prób rejestracji. Odczekaj kilka minut i spróbuj ponownie.",
|
||||
"vpnBlocked": "Rejestracja przez połączenia VPN/proxy jest niedozwolona.",
|
||||
"maxAccountsPerIp": "Osiągnięto maksymalną liczbę kont dla Twojego połączenia.",
|
||||
"unavailable": "Rejestracja jest tymczasowo niedostępna.",
|
||||
"createFailed": "Nie udało się utworzyć konta. Spróbuj ponownie lub skontaktuj się z obsługą.",
|
||||
"invalidInput": "Sprawdź zaznaczone pola i spróbuj ponownie."
|
||||
},
|
||||
"forgot": {
|
||||
"title": "Zresetuj hasło",
|
||||
@@ -898,9 +927,11 @@
|
||||
"reset": {
|
||||
"title": "Ustaw nowe hasło",
|
||||
"subtitle": "Wybierz silne hasło, którego nie używasz gdzie indziej.",
|
||||
"passwordPlaceholder": "Nowe hasło (min. 6 znaków)",
|
||||
"passwordPlaceholder": "Nowe hasło (min. 12 znaków)",
|
||||
"resetPassword": "Zresetuj hasło",
|
||||
"backToLogin": "Powrót do logowania"
|
||||
"backToLogin": "Powrót do logowania",
|
||||
"passwordMinLength": "Hasło musi mieć co najmniej 12 znaków",
|
||||
"tooManyAttempts": "Zbyt wiele prób — spróbuj później"
|
||||
},
|
||||
"verify": {
|
||||
"verifiedTitle": "Wszystko gotowe",
|
||||
|
||||
Reference in new issue
Block a user