Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
context
the hosted sign-in page and the react component render in english for everyone. integrators can pass their own
localizationstrings, but there are no built-in translations, and some text can't be translated at all: the 18 error-code titles and descriptions on the error step and the "powered by" footer are hardcoded english.changes
errorCodeMessages) and the footer (poweredBy) intoLocalization, so every string the component owns goes through it.captcha_blockedstill prefers the server's message when there is one.LOCALIZATIONSalongside english.matchLocale(preferred), which returns the first language tag with a built-in localization, matching on the language subtag (sv-SE→sv,no→nb).Localizernow requires completemfaTypeLabelsanderrorCodeMessagesmaps, so a localization missing a string fails typecheck.translations follow the register google uses on its sign-in pages: formal in german and french, informal elsewhere.
text from the session itself (field labels, placeholders, option text, server error messages) is unchanged and shows as the api sends it.
testing
bun test: 110 pass, including new tests formatchLocale, placeholder interpolation in every localization, localized error-code copy, partial overrides keeping default error copy, and the localized footer.bun run typecheck,bun run build,bun run format:checkpass.