i18n: Make file reveal labels translatable (#20010)

Convert hardcoded "Reveal in Finder", "Reveal in File Explorer", and
"Open Containing Folder" labels to use i18n.translate() in three menu
components. Add corresponding English locale entries so these
platform-specific labels are now part of the translation system instead
of untranslated strings.

Co-authored-by: m4air <m4air@Mac.localdomain>
This commit is contained in:
OrcaWin
2026-09-10 21:42:05 -07:00
committed by GitHub
co-authored by m4air
parent 3b99a59ea7
commit 6c1580aeba
4 changed files with 57 additions and 21 deletions
@@ -20,11 +20,19 @@ const isMac = navigator.userAgent.includes('Mac')
const isLinux = navigator.userAgent.includes('Linux')
/** Platform-appropriate label: macOS -> Finder, Windows -> File Explorer, Linux -> Files */
const revealLabel = isMac
? 'Reveal in Finder'
: isLinux
? 'Open Containing Folder'
: 'Reveal in File Explorer'
function getRevealLabel(): string {
return isMac
? translate('auto.components.editor.EditorPanelHeader.revealInFinder', 'Reveal in Finder')
: isLinux
? translate(
'auto.components.editor.EditorPanelHeader.openContainingFolder',
'Open Containing Folder'
)
: translate(
'auto.components.editor.EditorPanelHeader.revealInFileExplorer',
'Reveal in File Explorer'
)
}
type EditorPanelHeaderPathProps = {
activeFile: OpenFile
@@ -196,7 +204,7 @@ export function EditorPanelHeaderPath({
{!isVirtualEditorTab && (
<DropdownMenuItem onSelect={onOpenContainingFolder}>
<ExternalLink className="w-3.5 h-3.5 mr-1.5" />
{revealLabel}
{getRevealLabel()}
</DropdownMenuItem>
)}
</DropdownMenuContent>
@@ -43,11 +43,19 @@ const isMac = navigator.userAgent.includes('Mac')
const isLinux = navigator.userAgent.includes('Linux')
/** Platform-appropriate label: macOS → Finder, Windows → File Explorer, Linux → Files */
const revealLabel = isMac
? 'Reveal in Finder'
: isLinux
? 'Open Containing Folder'
: 'Reveal in File Explorer'
function getRevealLabel(): string {
return isMac
? translate('auto.components.right.sidebar.FileExplorerRow.revealInFinder', 'Reveal in Finder')
: isLinux
? translate(
'auto.components.right.sidebar.FileExplorerRow.openContainingFolder',
'Open Containing Folder'
)
: translate(
'auto.components.right.sidebar.FileExplorerRow.revealInFileExplorer',
'Reveal in File Explorer'
)
}
function stopRightButtonMenuSelection(event: React.PointerEvent): void {
if (event.button !== 2) {
@@ -290,7 +298,7 @@ export function FileExplorerRowContextMenu({
}}
>
<ExternalLink />
{revealLabel}
{getRevealLabel()}
</ContextMenuItem>
<ContextMenuSeparator />
<ContextMenuItem onSelect={() => onStartRename(node)}>
@@ -32,11 +32,22 @@ const isMac = navigator.userAgent.includes('Mac')
const isLinux = navigator.userAgent.includes('Linux')
/** Platform-appropriate label: macOS → Finder, Windows → File Explorer, Linux → Files */
const revealLabel = isMac
? 'Reveal in Finder'
: isLinux
? 'Open Containing Folder'
: 'Reveal in File Explorer'
function getRevealLabel(): string {
return isMac
? translate(
'auto.components.tab.bar.EditorFileTabContextMenu.revealInFinder',
'Reveal in Finder'
)
: isLinux
? translate(
'auto.components.tab.bar.EditorFileTabContextMenu.openContainingFolder',
'Open Containing Folder'
)
: translate(
'auto.components.tab.bar.EditorFileTabContextMenu.revealInFileExplorer',
'Reveal in File Explorer'
)
}
type EditorFileTabContextMenuProps = {
open: boolean
@@ -251,7 +262,7 @@ export function EditorFileTabContextMenu({
}}
>
<ExternalLink className="size-3.5" />
{revealLabel}
{getRevealLabel()}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
+12 -3
View File
@@ -3368,7 +3368,10 @@
"1d04b1630b": "Split Down",
"6b3efb106e": "Split Up",
"fdd29eb669": "Pin Tab",
"8e9d603a09": "Unpin Tab"
"8e9d603a09": "Unpin Tab",
"revealInFinder": "Reveal in Finder",
"openContainingFolder": "Open Containing Folder",
"revealInFileExplorer": "Reveal in File Explorer"
},
"QuickLaunchButton": {
"348a04c1ad": "Agent settings…",
@@ -11976,7 +11979,10 @@
"3161c4e425": "folder",
"e887fa4b2e": "Open in Terminal",
"1d8e182c32": "View File",
"clipboardStagingUnavailable": "Could not copy the file because Orca's temporary storage is unavailable"
"clipboardStagingUnavailable": "Could not copy the file because Orca's temporary storage is unavailable",
"revealInFinder": "Reveal in Finder",
"openContainingFolder": "Open Containing Folder",
"revealInFileExplorer": "Reveal in File Explorer"
},
"FileExplorerToolbar": {
"d238264654": "Show Git Ignored Files",
@@ -14676,7 +14682,10 @@
"f0fd4174b5": "Open file tab to use rich markdown editing",
"a10d9b8337": "Open file",
"2076ecfc9c": "Previous change",
"631dab0df3": "Next change"
"631dab0df3": "Next change",
"revealInFinder": "Reveal in Finder",
"openContainingFolder": "Open Containing Folder",
"revealInFileExplorer": "Reveal in File Explorer"
},
"EditorPanelMarkdownActionsMenu": {
"3e0ce48c24": "Export as PDF",