Localize tab context menu and alert strings#2422
Conversation
XCUIApplication.launch() blocks ~60s then fails on headless WarpBuild runners because foreground activation requires a GUI login session. Apply the same pre-launch strategy used for the display resolution test: - CI shell launches the app with env vars before running xcodebuild - Test detects pre-launched app via manifest, uses activate() instead of launch() to avoid killing and relaunching the app - Falls back to clicking the window for focus via accessibility framework Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit a540e2f.
Replace hardcoded English strings in tab rename/move alert dialogs with String(localized:defaultValue:) calls. Add 10 new localization keys to Localizable.xcstrings with translations for all 18 supported languages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address CodeRabbit review: localize remaining hardcoded strings in the move-failure alert dialog (Move Failed, error message, OK button). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…menu # Conflicts: # Resources/Localizable.xcstrings
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis pull request adds comprehensive localization support for tab management UI alerts and related prompts across multiple languages, updating the Localizable.xcstrings file with new string keys and wiring those keys into Workspace.swift alert dialogs. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis PR resolves merge conflicts from #1998 and lands the alert-dialog localization for tab rename and tab move operations in Key changes:
Confidence Score: 5/5Safe to merge — all 13 localization keys are correctly wired between Workspace.swift and Localizable.xcstrings, no logic changes, no missing or mismatched keys. All call-site keys have exact matches in xcstrings with correct default values. No logic is changed; only string literals are replaced with localized lookups. The single finding is a P2 naming-convention inconsistency (alert.* vs the pre-existing dialog.* prefix) that has no runtime impact. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant ContextMenu as Tab Context Menu
participant Workspace as Workspace.swift
participant Localizable as Localizable.xcstrings
User->>ContextMenu: Right-click tab → Rename
ContextMenu->>Workspace: promptRenamePanel(tabId:)
Workspace->>Localizable: String(localized: "alert.renameTab.title")
Workspace->>Localizable: String(localized: "alert.renameTab.message")
Workspace->>Localizable: String(localized: "alert.renameTab.placeholder")
Workspace->>Localizable: String(localized: "alert.renameTab.rename")
Workspace->>Localizable: String(localized: "alert.cancel")
Workspace-->>User: NSAlert (localized)
User->>ContextMenu: Right-click tab → Move to Workspace
ContextMenu->>Workspace: promptMovePanel(tabId:)
Workspace->>Localizable: String(localized: "alert.moveTab.title")
Workspace->>Localizable: String(localized: "alert.moveTab.message")
Workspace->>Localizable: String(localized: "alert.moveTab.newWorkspaceInCurrentWindow")
Workspace->>Localizable: String(localized: "alert.moveTab.selectedWorkspaceInNewWindow")
Workspace->>Localizable: String(localized: "alert.moveTab.move")
Workspace->>Localizable: String(localized: "alert.cancel")
Workspace-->>User: NSAlert with NSPopUpButton (localized)
User->>Workspace: Confirm Move
alt Move fails
Workspace->>Localizable: String(localized: "alert.moveTab.failed.title")
Workspace->>Localizable: String(localized: "alert.moveTab.failed.message")
Workspace->>Localizable: String(localized: "alert.ok")
Workspace-->>User: Failure NSAlert (localized)
end
Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
| alert.messageText = String(localized: "alert.renameTab.title", defaultValue: "Rename Tab") | ||
| alert.informativeText = String(localized: "alert.renameTab.message", defaultValue: "Enter a custom name for this tab.") | ||
| let currentTitle = panelCustomTitles[panelId] ?? panelTitles[panelId] ?? panel.displayTitle | ||
| let input = NSTextField(string: currentTitle) | ||
| input.placeholderString = "Tab name" | ||
| input.placeholderString = String(localized: "alert.renameTab.placeholder", defaultValue: "Tab name") | ||
| input.frame = NSRect(x: 0, y: 0, width: 240, height: 22) | ||
| alert.accessoryView = input | ||
| alert.addButton(withTitle: "Rename") | ||
| alert.addButton(withTitle: "Cancel") | ||
| alert.addButton(withTitle: String(localized: "alert.renameTab.rename", defaultValue: "Rename")) | ||
| alert.addButton(withTitle: String(localized: "alert.cancel", defaultValue: "Cancel")) |
There was a problem hiding this comment.
Inconsistent key prefix convention (
alert.* vs dialog.*)
The adjacent confirmClosePanel dialog already uses the dialog.closeTab.* prefix (e.g. dialog.closeTab.cancel, dialog.closeTab.close). This PR introduces a parallel alert.* namespace for the rename/move dialogs. The two families now coexist and both translate "Cancel" (alert.cancel vs dialog.closeTab.cancel), which makes it harder for translators to know which key to update when UI copy changes.
Consider using the dialog.* prefix here as well (e.g. dialog.renameTab.*, dialog.moveTab.*) to keep the namespace consistent, or document the intended distinction between alert.* and dialog.* in a comment.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Resolves merge conflicts from #1998 by @anthhub and merges with current main.
Original PR: #1998
Localizes all tab context menu items (Close, Rename, Move to Workspace, Open in New Window) and move/rename alert strings. Adds 13 new localization keys with translations for 13+ languages.
Summary by cubic
Localized the tab context menu and tab rename/move dialogs by replacing hardcoded strings with
String(localized:defaultValue:). Adds 13 new keys toResources/Localizable.xcstringswith translations across all supported languages, including move-failure alerts and workspace destination options.Written for commit 5663642. Summary will update on new commits.
Summary by CodeRabbit