Skip to content

feat/add-kinyarwanda-translation#367

Merged
mattqdev merged 2 commits into
physicshub:mainfrom
Randall-Muana-Sheriff:feat/add-kinyarwanda-translation
Jul 7, 2026
Merged

feat/add-kinyarwanda-translation#367
mattqdev merged 2 commits into
physicshub:mainfrom
Randall-Muana-Sheriff:feat/add-kinyarwanda-translation

Conversation

@Randall-Muana-Sheriff

Copy link
Copy Markdown
Contributor

Summary

Adds a full Kinyarwanda (rw) translation to the site, as described in #249.

Changes

  • Added app/(core)/locales/rw.json with a complete hand-translation of all existing translation keys
  • Registered Kinyarwanda in locales/meta.json (completed: true)
  • Added Kinyarwanda to the LanguageSwitcher component's language list (it wasn't reading from meta.json, so this was required for the language to actually appear in the dropdown)
  • Fixed two missing translation keys ("Simulations", "About") in the nav that were falling back to raw English regardless of selected language, for all languages — added empty values to en.json and translated values to rw.json
  • Wired GitHubHeaderBadge.jsx into the translation system — it previously rendered "Open source", "Built in public", "Star the repo", "stars", and "contributors" as raw hardcoded English strings with no t() call at all, for any language

Testing

Tested locally across Home, Simulations, Blog, About, and Contribute pages with the language switcher set to Kinyarwanda. All UI strings render correctly; blog post content itself remains in its original language as expected (out of scope — that's content, not UI).

Notes for reviewer

I'm not a native Kinyarwanda speaker beyond conversational fluency from Rwanda — happy to have a native speaker double-check nuance on a few technical UI terms (e.g. "modal", "clipboard") if that would help before merging.

- Add rw.json with full Kinyarwanda translation
- Register Kinyarwanda in meta.json and LanguageSwitcher dropdown
- Fix missing 'Simulations'/'About' nav keys (were falling back to raw key)
- Wire GitHubHeaderBadge into the translation system (was fully unwired)
- Add corresponding empty English keys for the above fixes
Copilot AI review requested due to automatic review settings July 7, 2026 12:02
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

@Randall-Muana-Sheriff is attempting to deploy a commit to the PhysicsHub's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a completed Kinyarwanda (rw) UI translation to PhysicsHub’s i18n system and wires a few remaining UI strings into the translation workflow so they no longer render as hardcoded English.

Changes:

  • Added a full rw.json translation file and marked rw as completed in locales/meta.json.
  • Updated the language switcher to include rw and to set the document <html lang="..."> to the selected language code.
  • Moved GitHubHeaderBadge’s rotating label strings into the t() translation system; added missing translation keys (including nav items).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
app/(core)/locales/rw.json Adds a complete Kinyarwanda translation map for existing UI keys, plus new keys used by nav/badge.
app/(core)/locales/meta.json Registers rw as a completed (hand-translated) locale.
app/(core)/locales/en.json Adds empty-string entries for newly referenced keys so t() can resolve consistently (falls back to key text).
app/(core)/components/LanguageSwitcher.jsx Adds rw to the selectable languages and updates the <html lang> behavior.
app/(core)/components/GitHubHeaderBadge.jsx Uses t() for the badge’s rotating “Open source / stars / contributors” style strings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 9 to 13
const LANGUAGES = {
en: "English",
ru: "Русский",
rw: "Kinyarwanda",
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please make this change as copilot says?

@mattqdev

mattqdev commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Hey @Randall-Muana-Sheriff really appreciate your PR, can you please make the changes suggested by copilot?

Addresses Copilot review feedback - LANGUAGES was hardcoded and
required manual updates for every new locale, even though meta.json
already contains the canonical language code -> name mapping.
@Randall-Muana-Sheriff

Copy link
Copy Markdown
Contributor Author

Done! Refactored LanguageSwitcher to derive the language list from meta.json instead of hardcoding it, as Copilot suggested. Tested all 7 languages locally to confirm the dropdown and translations still work correctly.

@mattqdev

mattqdev commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Thank you! Really appreciate it

@mattqdev mattqdev merged commit d693518 into physicshub:main Jul 7, 2026
1 of 2 checks passed
@Randall-Muana-Sheriff Randall-Muana-Sheriff deleted the feat/add-kinyarwanda-translation branch July 7, 2026 14:22
@Randall-Muana-Sheriff

Copy link
Copy Markdown
Contributor Author

Hey @mattqdev! Had fun working on the Kinyarwanda translation today, appreciate the quick review

Looking to jump into something else if you've got anything in mind, doesn't need to be a formal issue, just let me know what'd actually be useful right now!

@mattqdev

mattqdev commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Really appreciate your help! If you want to work to something else, right now the most useful issue you can resolve is this: #350
Good work!

@physicshub

Copy link
Copy Markdown
Owner

🎉 This PR is included in version 3.30.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants