Support automatic per-visitor language selection for repository README files (README.<lang>.md) #214064
Replies: 2 comments
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
This is a genuinely hard one, and the auto-detect part is why. The README is rendered server-side from the repo contents; GitHub has no reliable signal that a visitor prefers Chinese over English, and the account language setting isn't a locale preference for content. Guessing from What actually works today: keep If you control a companion site, GitHub Pages can do client-side locale selection with a tiny script and then link back to the right README file. Some projects also use a GitHub Action that keeps a translated README in sync from Crowdin or Weblate. I'd file the request as "native language switcher on repository homepages" with explicit opt-in and a remembered choice. That avoids the server-side guessing problem, which is probably the blocker. |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Product Feedback
Body
Problem
Open-source repositories increasingly serve a global audience, yet GitHub has no built-in way to display a repository's README in the visitor's preferred language automatically (e.g., showing a Chinese README to Chinese-speaking visitors and an English README to English-speaking visitors without manual clicking).
Today, maintainers have to rely on workarounds that all have clear limitations:
README.md: Doubles the length of the page and forces every reader to scroll past languages they don't use.README.<lang>.mdfiles with manual links: Non-default-language visitors still land on the default README first, have to click a link, and get sent to a/blob/...single-file view where the repository file tree and sidebar are gone.README.mdserver-side, strips<script>and<iframe>tags, and caches images through Camo, neither GitHub Apps nor Actions can switch README content per visitor. Browser userscripts only work for visitors who install an extension.Proposed Solution
Add native, server-side or edge-based README locale detection based on a standard naming convention:
README.md(for example,README.zh-CN.md,README.ja.md,README.ko.md,README.es.md), withREADME.mdas the fallback.Accept-Languageheader (with standard fallback such aszh-Hans-CN→zh-CN→zh→README.md) and render the matching README directly on the repo homepage.Why This Matters
Native README localization removes friction for both maintainers and international contributors, keeps repository homepages clean, and unlocks a standard convention that the entire GitHub ecosystem can adopt.
All reactions