Skip to content

Localise recognised Doctor guidance and Chinese formula labels - #256

Open
singkia wants to merge 6 commits into
Homebrew:mainfrom
singkia:feat/doctor-diagnostics-localization
Open

singkia wants to merge 6 commits into
Homebrew:mainfrom
singkia:feat/doctor-diagnostics-localization

Conversation

@singkia

@singkia singkia commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

What and why

After #187, a Chinese session still showed recognised Doctor explanations in English, and it still showed Formula / FORMULA for formulae. This localises known Doctor titles, prose and captions, and uses 配方 for formulae in both Chinese locales. That covers five existing Discover and Installed labels and the package-type badge on formula rows. Cask, CASK, Cellar and keg stay as Homebrew terms. Unknown Doctor wording falls back to the original text.

Package names, tap names, paths, URLs, commands and arguments stay verbatim. The raw Doctor transcript and the copied report stay verbatim. The parser keeps a remediation caption when a blank line separates it from the following list. The Doctor catalogue gains 31 keys. The contributor docs record this boundary.

Homebrew's Simplified Chinese site copy has used 配方 since a merged 2017 change. The current Traditional Chinese page still says formula, so 配方 there is a BrewUI terminology choice.

The console status shown after a command, while the installed list reloads, is 正在刷新 in Simplified Chinese and 重新整理中 in Traditional Chinese. A review adjusted some Chinese sentences: the formula upgrade summary, the Traditional unlinked-keg explanation, the Traditional warning note and the specified unbrewed-file titles.

To reproduce the old behaviour, open BrewUI in Chinese. A recognised Doctor warning shows an English structured explanation, and formula rows are badged FORMULA. With this branch that explanation and the badge are Chinese. The raw console stays English.

Validation

Local environment: macOS 27.0 (26A428), Apple Silicon arm64, Xcode 27.0 (27A5237l), Apple Swift 6.4.

On 8dc01cd, local scripts/localize verify and scripts/test passed. zh-Hans and zh-Hant have no untranslated catalog strings.

Local scripts/test-e2e passed with no failures and no retries. The plan built and launched this branch's Debug app, 0.4.5 (1178). hello was absent before the run and absent after it.

Fork CI for 8dc01cd:

The release build job failed at Import signing certificates, before archive. This fork has no upstream signing secrets.

A local Debug build of cf7b9d9 shows 配方 on formula rows in zh-Hans and zh-Hant. CASK stays CASK. 8dc01cd changes Chinese catalog values only.

  • I followed the conventions and workflow, checked for duplicate PRs and kept this change focused.
  • I added regression coverage for bug fixes or explained why automated coverage is impractical, and reported the relevant validation above.

DoctorMessageCopyTests covers recognised wording and the verbatim fallback. DoctorBlankLineCaptionTests covers the blank-line caption.

Screenshots

Light appearance. Each table is one language and each cell is one capture. The lists use deterministic fixture data, not this machine's cellar. Commands, package names, paths, Cask, CASK, Cellar and keg stay verbatim. The pane under the Doctor findings is the raw brew doctor transcript.

Before keeps the previous Chinese wording: formulae were still labelled Formula / FORMULA, and recognised Doctor prose was still English. After uses 配方 and the translated Doctor prose.

Those captures predate 8dc01cd. The Simplified upgrades summary in the screenshot still says 升级所有有新版本的配方. The catalog now says 升级所有可升级的配方. The Traditional Doctor screenshot still says 提交問題, 排查故障 and 無法正常執行. The catalog now says 回報問題, 除錯 and 無法正常運作. The console status refreshing is not in these captures.

Simplified Chinese.

Before After
Before: unlinked-keg Doctor finding in English After: unlinked-keg Doctor finding in Simplified Chinese
Before: Installed formulae labelled Formula After: Installed formulae labelled 配方
Before: Upgrades summary still says Formula After: Upgrades summary says 配方
Before: Discover trending labelled 热门 Formula After: Discover trending labelled 热门配方
Before: empty Discover search says 没有匹配的 Formula After: empty Discover search says 没有匹配的配方

Traditional Chinese.

Before After
Before: unlinked-keg Doctor finding in English After: unlinked-keg Doctor finding in Traditional Chinese
Before: Installed formulae labelled Formula After: Installed formulae labelled 配方
Before: Upgrades summary still says Formula After: Upgrades summary says 配方
Before: Discover trending labelled 熱門 Formula After: Discover trending labelled 熱門配方
Before: empty Discover search says 沒有符合條件的 Formula After: empty Discover search says 沒有符合條件的配方

AI assistance

  • AI was used to generate or assist with generating this PR.

OpenAI Codex (GPT-6) implemented the change, wrote the translations and tests. Grok 4.7 captured the fixture screenshots linked above, applied the reviewed Chinese wording and the refreshing translations in 8dc01cd, ran local scripts/test and scripts/test-e2e, and rewrote this description from the branch diff and those checks.

The five unmanaged-file titles and headings used two phrasings in each language. One pattern now covers the family: files Homebrew did not install, and a single heading for the unexpected paths.
The console status uses 正在刷新 and 重新整理中. The reviewed sentences
replace the formula upgrade summary, the Traditional unlinked-keg
explanation, the Traditional warning note and the unbrewed-file titles
the contributor specified.
Copilot AI balanced review requested due to automatic review settings September 29, 2026 21:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Locale-specific regression coverage is ineffective and the architecture documentation contradicts the implemented title and caption localisation.

Review effort: Balanced
Findings: 2 Low severity

Open (2)
What changed in this PR

Localises recognised Doctor guidance and formula labels for Simplified and Traditional Chinese while preserving verbatim Homebrew output.

Changes:

  • Adds presentation-layer localisation for recognised Doctor titles, prose and captions.
  • Uses 配方 for Chinese formula labels and badges.
  • Preserves remediation captions separated from lists by blank lines.
File Description
Tests/​BrewRepositoriesTests/​DoctorBlankLineCaptionTests.swift Tests caption preservation.
Tests/​BrewFeatureDoctorTests/​DoctorMessageCopyTests.swift Tests Doctor copy boundaries.
Sources/​BrewUIComponents/​Resources/​Localizable.xcstrings Adds translated formula badge.
Sources/​BrewUIComponents/​Chrome/​PackageKindChrome.swift Localises formula badges.
Sources/​BrewRepositories/​DoctorOutputParser.swift Retains pending captions across blank lines.
Sources/​BrewFeatureInstalled/​Resources/​Localizable.xcstrings Translates installed formula labels.
Sources/​BrewFeatureDoctor/​Views/​DoctorView.swift Displays translated reassurance copy.
Sources/​BrewFeatureDoctor/​Views/​DoctorMessageCopy.swift Maps recognised Doctor wording to translations.
Sources/​BrewFeatureDoctor/​Views/​DoctorIssueRowView.swift Localises row titles.
Sources/​BrewFeatureDoctor/​Views/​DoctorIssueDetailView.swift Localises structured Doctor content.
Sources/​BrewFeatureDoctor/​Views/​DoctorCopy.swift Clarifies canonical wording usage.
Sources/​BrewFeatureDoctor/​ViewModels/​DoctorIssueItem.swift Localises accessibility titles.
Sources/​BrewFeatureDoctor/​Resources/​Localizable.xcstrings Adds Chinese Doctor translations.
Sources/​BrewFeatureDiscover/​Resources/​Localizable.xcstrings Translates Discover formula labels.
Sources/​BrewFeatureConsole/​Resources/​Localizable.xcstrings Translates refreshing status.
README.md Documents Doctor localisation boundaries.
ARCHITECTURE.md Documents verbatim and translated layers.
AGENTS.md Records contributor localisation guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ARCHITECTURE.md Outdated
Comment on lines +63 to +65
format changes rather than assuming a fixed transcript. Doctor keeps its findings and raw transcript
in Homebrew's wording; only recognised explanations in the structured feature view are translated.
Unknown findings fall back to the original text, while the console and copied report remain unchanged.
Comment on lines +12 to +15
#expect(DoctorMessageCopy.title("Some installed formulae are deprecated or disabled.") ==
"Some installed formulae are deprecated or disabled.")
#expect(DoctorMessageCopy.title("The following taps are not trusted:") ==
"The following taps are not trusted:")
Check recognised titles and captions against both Chinese catalogues so missing recognition cannot silently pass the tests. Keep normal bundle lookup unchanged and clarify the structured presentation and raw output boundary.
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.

2 participants