Repository navigation
Add UI translations (i18n) with English and Spanish - #256
Open
ufortstephen wants to merge 1 commit into
Open
ufortstephen wants to merge 1 commit into
ufortstephen wants to merge 1 commit into
Conversation
|
@ufortstephen is attempting to deploy a commit to the Dhanush Nehru's projects Team on Vercel. A member of the Team first needs to authorize it. |
Sets up react-i18next with JSON messages in src/locales/ and moves the editor, header, sign-in, stars and footer text to translation keys. Adds a language switcher in the header that saves the choice in localStorage and otherwise follows the browser language. Missing keys fall back to English. The Spanish messages are drafts awaiting review by a fluent speaker. Adds a "How to add a language" section to CONTRIBUTING.md. Part of DhanushNehru#247
ufortstephen
force-pushed
the
i18n-spanish
branch
from
November 11, 2026 09:53
ca43024 to
92a10a0
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
|
Thanks, the code, tests and preview check out. Before merging, src/locales/es.json still needs review from a fluent Spanish speaker, as agreed in #247. Please leave any corrections directly on that file and confirm when the Spanish review is complete. |
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.
Part of #247 (the i18n layer with English and Spanish. Hindi and Tamil will follow in separate PRs, so the issue can stay open.)
PR Fixes:
src/i18n.js. Messages are JSON files insrc/locales/(en.json,es.json) and ship with the bundle, so nothing extra is fetched.AuthContext, the stars prompt, both selects, the dark-mode toggle label and the footer. Theme names inconstants.jsand the people's names in the footer stay as they are.EN/ES). The choice is saved inlocalStorage(uiLanguage). With no saved choice it uses the browser language, and regional variants work too (es-MXgets Spanish).<html lang>follows the active language.src/i18n.test.jscovers the English default, switching to Spanish, falling back to English for a missing key, and checks thates.jsonhas no keysen.jsonlacks.setupTests.jsloads i18n so the existing tests run in English and pass unchanged.es.jsonwas drafted with localize.dev, which I'm building, and I corrected a few things by hand: sentence case, "lenguaje" rather than "idioma" for the programming-language select, shorter select labels so they fit the 150px fields, and the product name left untranslated. It hasn't been reviewed by a native speaker yet, so please don't merge until a fluent Spanish speaker has reviewedsrc/locales/es.json. Suggestions on the file are welcome.English output
Every English string is the same text as before, with two small differences:
Dependencies
i18next@23,react-i18next@14andi18next-browser-languagedetector@8. Newer i18next majors declare a TypeScript 5 peer, which conflicts with the TypeScript 4.9 that react-scripts 5 installs. These versions avoid that, sonpm cikeeps working without--legacy-peer-deps.Checklist before requesting a review
mainbranchnpm run lint:fixlocallyTested:
npm run lintis clean,npm testpasses (29 tests),npm run buildsucceeds, and I went through the signed-out page and the editor in English and Spanish in the browser (switching languages, settings, import/export, output panel).