Repository navigation
feat(repo-xray): add an English interface alongside the Chinese one - #197
Merged
MyPrototypeWhat merged 7 commits intoDec 3, 2026
Merged
MyPrototypeWhat merged 7 commits into
MyPrototypeWhat merged 7 commits into
Conversation
The sidebar now has a language control that switches the whole interface between Chinese and English, and the choice survives a reload. English lives in a catalogue keyed by the Chinese text, so the Chinese wording is untouched and anything without a translation yet falls back to Chinese instead of breaking the page. The local server answers each request in the language that request asked for, so a report read in English never mixes in Chinese findings or Chinese error messages.
The vitals line and the footer put the number before the noun, so a repository with one commit read "1 commits" and one branch read "1 branches". The English now leads with the label, which is right for every count, and the empty-state heading no longer repeats the sentence below it.
There was a problem hiding this comment.
🟡 Changes recommended
Changing language during the Remove undo window cancels the queued DELETE request, causing the repository to reappear and leaving its cached clone intact.
1 open issue
1 file not reviewed
plugins/yujiachen-y/repo-xray/miniapp/client/strings.js: Generated file
What changed in this PR
Adds English alongside Chinese to Repo X-Ray, the Mini App for exploring repository Git history.
Changes:
- Adds a remembered language choice and translated interface labels.
- Localizes server messages, analysis findings, and progress events.
- Adds translation checks, updates documentation, and bumps the package version.
| File | Description |
|---|---|
| README.zh-CN.md | Advertises bilingual support. |
| README.md | Advertises bilingual support. |
| plugins/yujiachen-y/repo-xray/tests/i18n.test.mjs | Checks translation coverage and consistency. |
| plugins/yujiachen-y/repo-xray/README.zh-CN.md | Documents language switching and verification. |
| plugins/yujiachen-y/repo-xray/README.md | Documents bilingual behavior and development checks. |
| plugins/yujiachen-y/repo-xray/miniapp/node/techstack.mjs | Adds bilingual manifest-count evidence. |
| plugins/yujiachen-y/repo-xray/miniapp/node/server.mjs | Localizes requests and progress streams. |
| plugins/yujiachen-y/repo-xray/miniapp/node/i18n.mjs | Adds request-scoped language helpers. |
| plugins/yujiachen-y/repo-xray/miniapp/node/git.mjs | Provides bilingual Git errors. |
| plugins/yujiachen-y/repo-xray/miniapp/node/codemap.mjs | Localizes grouped map labels. |
| plugins/yujiachen-y/repo-xray/miniapp/node/analyze.mjs | Produces bilingual findings and recommendations. |
| plugins/yujiachen-y/repo-xray/miniapp/client/strings.js | Adds the English translation catalogue. |
| plugins/yujiachen-y/repo-xray/miniapp/client/index.html | Adds language controls and translation hooks. |
| plugins/yujiachen-y/repo-xray/miniapp/client/i18n.js | Stores language choice and resolves translations. |
| plugins/yujiachen-y/repo-xray/miniapp/client/charts.js | Localizes chart labels and formatting. |
| plugins/yujiachen-y/repo-xray/.minimax-plugin/plugin.json | Bumps version and adds English example queries. |
Review effort: Balanced
The language switch reloads the page, and a reload drops the timer and the queued DELETE that the Remove button waits out, so the repository came back and its cached clone stayed. The queue of pending removals is kept in sessionStorage now and picked up again at boot, so the removal still happens and can still be undone after a reload.
The server lists the files it serves by hand, so the new module was not served and the page could not load it: the import failed and the app never started. A test now checks that every file in the client directory is served.
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.

Repo X-Ray now speaks English as well as Chinese.
The sidebar has a language control that switches the whole interface between Chinese and English, and the choice survives a reload, so you find the app in the language you left it in. The Chinese wording is unchanged: the English lives in a catalogue keyed by the Chinese text, so anything without a translation yet falls back to Chinese instead of breaking the page. The local server answers each request in the language that request asked for, so a report read in English never mixes in Chinese findings or Chinese error messages.
Tested environment and results
npm run check: 96/96. This package reports OK — 0 errors, 0 warnings.node --test plugins/yujiachen-y/repo-xray/tests/): 22/22.t()are byte-identical to the wording in this repository before the change. The checker carries a negative control that correctly rejects a wording this repository never had.(root)in the New files list and in the contributors' Top directories column, with no Chinese text left on any tab, the language choice survives a reload, popping the page out into its own window works, and a repository removed just before a language switch still goes, with its undo still on offer.npm run checkreports the package as OK there, and the package tests pass 22/22 there. Both interfaces were walked on that machine: the language control switches the whole interface, the English interface shows(root)in the New files list and in the contributors' Top directories column with no Chinese left on any of the six views, an error message is in English, switching back to Chinese shows(根目录)in the same two places, the choice survives a reload, the page pops out into its own window, a repository removed just before a language switch still goes with its undo still on offer, and the console and network are clean.Not verified
prefers-reduced-motion, and the append-to-conversation confirmation.package.jsontest script globs onlytest/**, soplugins/*/*/tests/does not run in CI. The tests above were run by hand; the package README says so under Development. On Windows the repository's own suite fails two symlink cases intest/files.test.mjswithEPERM, because creating a symbolic link needs Developer Mode or elevation — that is the machine, not this package.Remaining
npm run checkwarningsNone for this package.
Access declared by the Mini App
None beyond the Mini App itself, and this change adds none: no
agentAccess, notoolAccess, nodeviceAccess, nohostAccess, no MCP endpoints. The package's existing behaviour — thegit,gh,glabandscutilcommands it runs, and the network accessgitneeds for a remote repository — is unchanged and is documented in the package README under "Data & access".What users will notice
ALGO_VERSIONgoes from 8 to 10, so every repository is analysed once more on the next run.{zh, en}object instead of a plain string:lastSync.error.message,job.error.message,job.detail,report.problems,recommendations.watchOut,tech.*.evidenceandcodemap.blocks[].name. The page reads either shape, so a report saved by an older build still opens.Repository root
One table row in
README.mdand one inREADME.zh-CN.md.Written by MiniMax M3.1
How it works
The change is a bilingual layer over the existing app rather than a rewrite:
miniapp/client/i18n.jsholds the language state. It readslocalStoragethensessionStorage, falls back tosessionStoragewhen the browser refuses to write tolocalStorage, and drops the stalelocalStorageentry in that case so it cannot shadow the new choice. It also exposesplainName(), which strips the(令牌)and(根目录)markers without translating them.miniapp/client/strings.jsis the catalogue: Chinese text in, English out. A key may hold two readings, and the page picks the one that fits the count it is rendering.miniapp/node/i18n.mjskeeps the language per request withAsyncLocalStorage, so concurrent requests cannot read each other's language.x-rr-langon every request andlangon the event stream.