Stop Squinting at GitHub in English: This Userscript Translates the Whole Interface
You know that feeling when you're deep in a pull request, trying to review a colleague's changes, and you just want the UI to be in your native language? GitHub's interface is English-only by default, and for millions of developers who aren't native English speakers, that's a constant minor friction point. You can navigate it, sure, but it's never quite as comfortable as working in your own language. That's where this project comes in—a userscript that systematically translates GitHub's entire interface into Simplified Chinese, using a clever combination of regex matching and an actively maintained translation dictionary.
What It Does
The project, called github-chinese, is a userscript (and VS Code extension) that localizes the GitHub web interface into Simplified Chinese. It's a fork of the earlier 52cik/github-hans project, but it's clearly outgrown its origins. The core mechanism is straightforward: it runs in your browser via a userscript manager like Tampermonkey or Violentmonkey, intercepts the page content, and translates UI elements—menus, titles, buttons, and more—on the fly.
Under the hood, it relies on a few clever techniques. It uses smart regex matching to identify translatable text, rather than doing naive string replacement. It also supports machine translation for project descriptions, which is a nice touch for browsing unfamiliar repositories. And it automatically localizes time elements, so "3 days ago" becomes something like "3 天前" in your locale. The translation dictionary is continuously updated—the development version gets a fresh word list every Friday, while the stable version syncs weekly on Mondays.
The architecture is split into two main components: the userscript itself and a separate VS Code extension for those who use GitHub's integrated browser within the editor. The project also has a well-structured codebase with config constants and a state manager, which suggests it's built to be maintainable despite the inherent fragility of scraping a constantly-changing site like GitHub.
Why It's Cool
What makes this project stand out isn't just that it translates GitHub—it's how it handles the complexity of doing so.
-
It's a constant game of catch-up, and it plays it well. The README's changelog is a testament to this. Look at the recent versions: fixes for React GlobalNav, search module ignore ranges, header navigation translations. GitHub is a moving target, and this project is actively tracking those changes. The maintainers aren't just writing a script once; they're maintaining a living piece of software that has to adapt every time GitHub's frontend team sneezes.
-
The regex-based approach is smarter than it sounds. Instead of a brittle one-to-one mapping of English to Chinese strings, it uses pattern matching to catch variations. This means it can handle things like plural forms, dynamic content, and context-dependent phrasing more gracefully than a simple dictionary lookup.
-
Versioned releases for different risk tolerances. You've got a choice: the development version from GitHub or a mirror, which updates in near-real-time, or the stable version from GreasyFork, which is synced weekly. If you want the latest translations and don't mind occasional breakage, go dev. If you need stability for daily work, go stable. That's a thoughtful approach to user choice.
-
It acknowledges its own limitations. The changelog literally documents a temporary fix where GitHub's React migration broke the header search box, and the side effect was that the entire header navigation couldn't be translated. That's honest engineering—sometimes you have to trade one feature to keep another alive.
-
Local debugging is a first-class citizen. The project provides clear instructions for loading the dictionary file locally and pointing your userscript at it, which is essential for anyone who wants to contribute or customize the translations.
How to Try It
Getting started is straightforward, assuming you're comfortable with userscripts. Here's the quick path:
- Install a userscript manager. The README recommends Tampermonkey, but it also supports Violentmonkey, Macaque, and Stay, depending on your browser.
- If you're on Chrome or Chromium, you'll need to enable "Developer mode" in your extensions page and then enable "Allow user scripts" for the manager extension. There's a helpful Tampermonkey FAQ on this.
- Pick your installation source:
- Refresh your GitHub tab. The plugin should kick in immediately. If not, restart your browser.
If you're a VS Code user, there's also an extension available—check the project's extension README for details.
For local development, you can download the dictionary file, modify the @require path in the script to point to your local copy, and enable Tampermonkey's "Allow access to file URLs" option. There's also a tip: drag the dictionary file into your browser's address bar to get a ready-to-use file:/// path.
Final Thoughts
This project is clearly a labor of love for its maintainer, and it shows in the meticulous changelog and the willingness to document temporary regressions. If you're a Chinese-speaking developer who lives on GitHub, this is almost certainly worth installing—the stable version is low-risk, and the convenience of a fully localized interface is hard to overstate. Even if you're not, it's a fascinating case study in how to build a resilient scraper against a hostile (read: constantly-changing) target. It's not a flashy project, but it's a genuinely useful one, and the community around it is actively keeping it alive. Give it a shot—you might be surprised how much more comfortable GitHub feels in your own language.
Follow @githubprojects for more developer tools and open source projects.