fix(#654, #655): i18n graceful fallback + staging E2E Playwright project#851
Open
oncleweynom wants to merge 1 commit into
Open
fix(#654, #655): i18n graceful fallback + staging E2E Playwright project#851oncleweynom wants to merge 1 commit into
oncleweynom wants to merge 1 commit into
Conversation
… staging E2E Playwright project - Add src/lib/i18n.ts with locale resolution chain (exact → subtag → en), missing-key warn in dev / silent in prod, and registerTranslations helper - Add frontend/I18N_GUIDE.md documenting the i18n approach - Add src/lib/__tests__/i18n.test.ts covering all fallback scenarios - Add 'staging' Playwright project activated via STAGING_URL env var - Add .github/workflows/e2e-staging.yml that runs on merge to main only
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.
Summary
Closes #654 and #655.
#654 — i18n locale detection graceful fallback
frontend/src/lib/i18n.ts— locale resolution chain: exact match → language subtag (e.g.ptfrompt-BR) →en.t()always returns a string; missing keys warn in dev, are silent in prod.frontend/I18N_GUIDE.md— documents resolution order, usage, adding locales, and key naming conventions.frontend/src/lib/__tests__/i18n.test.ts— 16 unit tests covering all fallback scenarios.closes i18n locale detection does not fall back gracefully for unsupported locales #654
#655 — Playwright E2E against real staging API
frontend/playwright.config.ts— addedstagingproject; activated whenSTAGING_URLenv var is set. Local projects andwebServerare suppressed in staging mode..github/workflows/e2e-staging.yml— triggers on push tomainonly (not PRs), runs--project=staging, readsSTAGING_URLfrom GitHub secrets, uploads HTML report as artifact.Testing
cd frontend && npm test -- src/lib/__tests__/i18n.test.tsSTAGING_URL=https://staging.example.com npx playwright test --project=stagingcloses Playwright E2E tests do not run against a real API — all mocked #655