Repository navigation
refactor(web): move login form copy into ui-config/strings - #896
Open
RafaelJaime wants to merge 1 commit into
Open
RafaelJaime wants to merge 1 commit into
RafaelJaime wants to merge 1 commit into
Conversation
The login page and the checkout login form hardcoded their placeholders, the Terms link label, validation messages and error toasts, while the rest of their copy already came from ui-config/strings.ts. Every visible text of both forms now lives there, with the same English values, so the UI reads the same and a fork or a future i18n layer can translate the forms in one place.
This branch has not been 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.
The login page and the checkout login form take most of their copy from
ui-config/strings.ts, but a few visible texts were still hardcoded in the components: the email and code placeholders, the "Terms" link label, the checkout form's validation messages and the reCAPTCHA / sign-in error toasts.This moves every one of them into
ui-config/strings.tswith the same English values, so nothing changes for users. It makes both login forms translatable from one file, which is what self-hosters running CourseLit in another language currently have to patch by hand (related: #508, #711). It does not add an i18n layer.apps/web/app/(with-contexts)/(with-layout)/login/login-form.tsx: placeholders, Terms label, sign-in error and reCAPTCHA messages.apps/web/components/public/payments/login-form.tsx: placeholders, Terms label, zod validation messages and reCAPTCHA messages.apps/web/ui-config/strings.ts: the new constants (LOGIN_*,CHECKOUT_LOGIN_*,RECAPTCHA_*). The reCAPTCHA score message keeps its exact output.Tests: a new
login/__tests__/login-form.test.tsxand a new case inpayments/__tests__/login-form.test.tsxcheck that the email step renders its placeholder and Terms link from the constants. Both failed before the change and pass now. Fullpnpm test: 101 suites, 837 tests pass; eslint adds no warnings; prettier applied.