Skip to content

feat(repo-xray): add an English interface alongside the Chinese one - #197

Merged
MyPrototypeWhat merged 7 commits into
MiniMax-AI:mainfrom
beardedeagle-mirrors:feat/bilingual-interface
Dec 3, 2026
Merged

MyPrototypeWhat merged 7 commits into
MiniMax-AI:mainfrom
beardedeagle-mirrors:feat/bilingual-interface

Conversation

@beardedeagle

@beardedeagle beardedeagle commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

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

  • MiniMax Code 3.1.3-preview.4675 on macOS 27 with Git 2.54 and Node 26.13.1, installed through the Host publish flow and opened in the right panel.
  • npm run check: 96/96. This package reports OK — 0 errors, 0 warnings.
  • Package tests (node --test plugins/yujiachen-y/repo-xray/tests/): 22/22.
  • Server end to end: the report is produced, the Chinese finding is Chinese, the English finding is English, error messages follow the requested language, and the event stream answers.
  • Chinese parity: 625 strings rendered through 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.
  • Cross-request language isolation: 96 concurrent mixed-language requests, 0 answered in the wrong language.
  • In the app on macOS: the English interface shows (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.
  • Windows 11 Pro (build 26300) with Git 2.56.1 and Node 26.14.0, in MiniMax Code 3.1.21.235: the package installs from the repository directory, npm run check reports 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

  • Linux, prefers-reduced-motion, and the append-to-conversation confirmation.
  • The English was read on a local build in MiniMax Code: the landing page, the keyboard shortcut list, the local repository scan, both themes, a full analysis of a local repository in each language, the language control, and the choice surviving a reload.
  • The repository's root package.json test script globs only test/**, so plugins/*/*/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 in test/files.test.mjs with EPERM, because creating a symbolic link needs Developer Mode or elevation — that is the machine, not this package.

Remaining npm run check warnings

None for this package.

Access declared by the Mini App

None beyond the Mini App itself, and this change adds none: no agentAccess, no toolAccess, no deviceAccess, no hostAccess, no MCP endpoints. The package's existing behaviour — the git, gh, glab and scutil commands it runs, and the network access git needs for a remote repository — is unchanged and is documented in the package README under "Data & access".

What users will notice

  • ALGO_VERSION goes from 8 to 10, so every repository is analysed once more on the next run.
  • These persisted values now hold a {zh, en} object instead of a plain string: lastSync.error.message, job.error.message, job.detail, report.problems, recommendations.watchOut, tech.*.evidence and codemap.blocks[].name. The page reads either shape, so a report saved by an older build still opens.
  • The language control reloads the page, so a repository whose removal is waiting out its undo window is kept across that reload instead of coming back.

Repository root

One table row in README.md and one in README.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.js holds the language state. It reads localStorage then sessionStorage, falls back to sessionStorage when the browser refuses to write to localStorage, and drops the stale localStorage entry in that case so it cannot shadow the new choice. It also exposes plainName(), which strips the (令牌) and (根目录) markers without translating them.
  • miniapp/client/strings.js is 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.mjs keeps the language per request with AsyncLocalStorage, so concurrent requests cannot read each other's language.
  • The page sends x-rr-lang on every request and lang on the event stream.
  • Raw names stay raw in links, request parameters and colour hashes; the translation is applied where the name is displayed.
  • The catalogue is keyed by the Chinese, and the Chinese is byte-identical to the wording in this repository before the change.

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.
Copilot AI balanced review requested due to automatic review settings December 2, 2026 20:30

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.

🟡 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.
@MyPrototypeWhat
MyPrototypeWhat merged commit 8cf3ac9 into MiniMax-AI:main Dec 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants