Repository navigation
fix(i18n): keep the macOS "Local Network" wording searchable in every locale - #10536
Conversation
… locale Settings search indexed the macOS privacy-toggle name as English-only aliases on the LAN keyword, so a Chinese user typing the term macOS System Settings actually shows them (本地网络) got no hit — zh's catalog value had been changed to 局域网 (LAN). Split the two wordings onto their own catalog keys so each locale carries both: 87620e6416 = LAN, fa3239cd42 = Local Network (its true content hash). Localized values come from the repo's own LAN title translations and from macOS 26's SecurityPrivacyExtension Localizable.loctable (LOCAL_NETWORK), so nothing is invented. ja/ko/es already matched macOS and are unchanged apart from gaining the LAN key.
📝 WalkthroughWalkthroughUpdates developer-permissions search indexing for LAN and macOS “Local Network” terminology, including localized catalog entries across English, Spanish, Japanese, Korean, and Chinese. The LAN search entry now uses localized keywords with a 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review-agent response to CodeRabbitCodeRabbit reported "No actionable comments" on the diff itself, and 0 inline comments. Its two failed pre-merge checks are addressed below — one actioned, one declined with reasoning. 1. Description check — ✅ ACTIONEDThe description was missing the template's Screenshots, AI Review Report, Security Audit, and Notes sections. The PR body has been updated to add all four, including the explicit macOS/Linux/Windows cross-platform confirmation the check asked for. 2. Docstring Coverage (0.00%, threshold 80.00%) — ❌ DECLINEDDeclined deliberately, for three reasons: It conflicts with this repo's own written style rule.
Adding docstrings to satisfy a percentage would produce exactly the "explain the obvious" comments AGENTS.md prohibits. The repo rule wins over a generic bot threshold. There is nothing here that warrants a docstring. The diff adds (a) two static string values to JSON catalogs, (b) one // Why: UI says LAN (aligned with mobile), but macOS System Settings still
// labels the privacy toggle "Local Network" — index both through the
// catalogs so every locale keeps the wording macOS actually shows it.That is the WHY-not-HOW comment the codebase asks for. A docstring restating "returns the LAN entry" would add zero information. It would expand the scope. This PR is deliberately one concern: keep the macOS Local Network wording searchable in every locale. Adding docstrings to hit a coverage bar is unrelated churn, and this PR is being held to a strict single-concern bar. No repo lint gate enforces docstring coverage — Independent verification performedBeyond CodeRabbit, this PR was verified against the two highest-risk claims rather than taken on trust:
|
… locale (stablyai#10536) Settings search indexed the macOS privacy-toggle name as English-only aliases on the LAN keyword, so a Chinese user typing the term macOS System Settings actually shows them (本地网络) got no hit — zh's catalog value had been changed to 局域网 (LAN). Split the two wordings onto their own catalog keys so each locale carries both: 87620e6416 = LAN, fa3239cd42 = Local Network (its true content hash). Localized values come from the repo's own LAN title translations and from macOS 26's SecurityPrivacyExtension Localizable.loctable (LOCAL_NETWORK), so nothing is invented. ja/ko/es already matched macOS and are unchanged apart from gaining the LAN key.
Problem
The Developer Permissions row is titled LAN, USB, and Bluetooth, but macOS System Settings labels the underlying privacy toggle Local Network. Search covered that mismatch with English-only aliases on the LAN keyword:
Those aliases are English.
zh.jsonhad the value for that key changed to局域网(LAN), so a Simplified-Chinese user who searches the wording macOS actually shows them —本地网络— got no hit.ja/ko/esstill happened to hold Local-Network wording and kept working.The key hash gives away how it drifted:
fa3239cd42issha1("…developer-permissions-search.ts:local network"). The key was minted for local network; the fallback was later reworded tolanin code and inen/zh, while the other locales kept the original translation.Fix
Carry both wordings in the catalogs instead of as English-only aliases in code, each on its own content-derived key:
87620e6416lan(new)fa3239cd42local networkOnly
zh'sfa3239cd42changes value; the other locales already matched macOS and just gain the LAN key.local-networkstays an English alias — it's a typing convenience, not a macOS string.No translated copy was invented. LAN terms are lifted from this repo's own translations of the row title (
3363889768:LAN, USB y Bluetooth/LAN、USB、Bluetooth/LAN, USB 및 블루투스/局域网、USB 和蓝牙). Local-Network terms are the literal values macOS 26.5.1 ships inSecurityPrivacyExtension.appex/Contents/Resources/Localizable.loctable, keyLOCAL_NETWORK:Tests
New
developer-permissions-search.test.tsdrives the realmatchesSettingsSearchpath against the real catalogs across all five locales.Revert-check (
git apply -Rof the source+catalog diff, test file kept):Restored:
Test Files 1 passed (1) / Tests 8 passed (8).Gates
npx vitest run --config config/vitest.config.tson the new file plussettings-search-keywords,settings-search,appearance-status-bar-search,accounts-search,src/renderer/src/i18n— 9 files, 37 tests, all passnpm run typecheck— cleannpm run lint— exit 0 (includesverify:localization-catalogandverify:localization-coverage; parity 11155 keys × 4 locales)Static + test verification only; not exercised in a running app.
Screenshots
No visual change. This PR only changes what the settings-search index matches on; no rendered copy, layout, or component changes. The row title (
3363889768, "LAN, USB, and Bluetooth") is untouched in all five locales.Testing
pnpm lint— exit 0 (includesverify:localization-catalog+verify:localization-coverage)pnpm typecheck— cleanpnpm test—settings/+i18n/scope: 113 files, 717 tests passAI Review Report
Reviewed with Claude Opus (reviewer subagents + independent verification). Risks checked and how they were resolved:
config/scripts/localize-renderer-strings.mjs:sha1(${filePath}:${text}).slice(0, 10). Recomputed independently:87620e6416==lan✅ andfa3239cd42==local network✅, with untouched pre-existing keys as controls (c4a4a02ea4==usb,e3fbc48083==bluetooth) proving the scheme. The re-key restores key/content integrity that drifted in Rename 'Local Network' to 'LAN' across mobile and settings UI #10216; it does not invent one.verify:localization-catalogreports parity at 11155 keys for es/ja/ko/zh and 10336 verified references./System/Library/ExtensionKit/Extensions/SecurityPrivacyExtension.appex/Contents/Resources/Localizable.loctable, keyLOCAL_NETWORK→ enLocal Network, zh_CN本地网络, jaローカルネットワーク, ko로컬 네트워크, esRed local— exact match. LAN terms match this repo's own title translations (3363889768).en— byte-identical:["lan","local network","local-network","usb",…]zh— gains本地网络(base had only局域网) → this is the fixes/ja/ko— each gainsLAN, lose nothingcreateLocalizedCatalogcaches per locale and invalidates only on language change, so entries are built once per locale, not per keystroke. One extra keyword on one entry; no measurable cost.Local Networkwording describes a macOS System Settings label, but indexing it is inert on Linux/Windows — it only ever adds a search term. Equally unaffected by SSH, folder-workspace vs git-worktree, and git-provider differences.Security Audit
No security-relevant surface. No input handling, command execution, path handling, auth, secrets, IPC, or dependency changes. The diff adds two static translation strings to JSON catalogs and one entry to an in-memory keyword array; all values are compile-time constants rendered as search text, never interpolated into a shell, path, or query. No follow-up needed.
Notes
fa3239cd42value inen/zhwhile its content hash still encodedlocal network, and leftja/ko/eson the original translation. This PR realigns keys to content so the two wordings can no longer drift apart.local-networkintentionally stays an English-only alias — it's a hyphen-typing convenience, not a string macOS ships, so it doesn't warrant a catalog key.