Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions apps/studio/src/components/content-tab-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import { ArrowIcon } from 'src/components/arrow-icon';
import { ButtonsSection, ButtonsSectionProps } from 'src/components/buttons-section';
import { useSiteDetails } from 'src/hooks/use-site-details';
import { useThemeDetails } from 'src/hooks/use-theme-details';
import { isWindows } from 'src/lib/app-globals';
import { cx } from 'src/lib/cx';
import { getFileManagerLabel } from 'src/lib/file-manager';
import { getIpcApi } from 'src/lib/get-ipc-api';
import { supportedEditorConfig } from 'src/modules/user-settings/lib/editor';
import { getTerminalName } from 'src/modules/user-settings/lib/terminal';
Expand Down Expand Up @@ -140,11 +140,7 @@ function ShortcutsSection( { selectedSite }: Pick< ContentTabOverviewProps, 'sel

const buttonsArray: ButtonsSectionProps[ 'buttonsArray' ] = [
{
label: isWindows()
? // translators: name of app used to navigate files and folders on Windows
__( 'File Explorer' )
: // translators: name of app used to navigate files and folders on macOS
__( 'Finder' ),
label: getFileManagerLabel(),
className: 'text-nowrap',
icon: archive,
onClick: () => {
Expand Down
5 changes: 3 additions & 2 deletions apps/studio/src/components/site-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import { useContentTabs } from 'src/hooks/use-content-tabs';
import { useDeleteSite } from 'src/hooks/use-delete-site';
import { useImportExport } from 'src/hooks/use-import-export';
import { useSiteDetails } from 'src/hooks/use-site-details';
import { isMac, isWindows } from 'src/lib/app-globals';
import { isMac } from 'src/lib/app-globals';
import { cx } from 'src/lib/cx';
import { getFileManagerLabel } from 'src/lib/file-manager';
import { getIpcApi } from 'src/lib/get-ipc-api';
import { supportedEditorConfig } from 'src/modules/user-settings/lib/editor';
import { getTerminalName } from 'src/modules/user-settings/lib/terminal';
Expand Down Expand Up @@ -188,7 +189,7 @@ function SiteItem( {
const isLoading = loadingServer[ site.id ] || false;
const isAddingSite = site.isAddingSite || false;
const isAnySiteAdding = sites.some( ( s ) => s.isAddingSite );
const finderLabel = isWindows() ? __( 'File Explorer' ) : __( 'Finder' );
const finderLabel = getFileManagerLabel();
const editorLabel =
editor && supportedEditorConfig[ editor ] ? supportedEditorConfig[ editor ].label : null;
Comment thread
ivan-ottinger marked this conversation as resolved.
const terminalLabel = getTerminalName( terminal );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ vi.mock( 'src/lib/app-globals', () => ( {
platform: 'darwin',
} ) ),
} ) );
vi.mock( 'src/lib/file-manager', () => ( {
getFileManagerLabel: vi.fn().mockReturnValue( 'Finder' ),
} ) );

const selectedSite: StartedSiteDetails = {
name: 'Test Site',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ vi.mock( 'src/lib/app-globals', () => ( {
isLinux: vi.fn().mockReturnValue( false ),
getAppGlobals: vi.fn( () => ( { platform: 'darwin' } ) ),
} ) );
vi.mock( 'src/lib/file-manager', () => ( {
getFileManagerLabel: vi.fn().mockReturnValue( 'Finder' ),
} ) );
vi.mock( 'src/hooks/use-site-details' );
vi.mock( 'src/hooks/use-theme-details' );
vi.mock( 'src/lib/get-ipc-api', () => ( {
Expand Down
15 changes: 15 additions & 0 deletions apps/studio/src/lib/file-manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { __ } from '@wordpress/i18n';
import { isLinux, isWindows } from 'src/lib/app-globals';

export function getFileManagerLabel(): string {
if ( isWindows() ) {
// translators: name of app used to navigate files and folders on Windows
return __( 'File Explorer' );
}
Comment thread
ivan-ottinger marked this conversation as resolved.
if ( isLinux() ) {
// translators: generic name of the app used to navigate files and folders on Linux
return __( 'File Manager' );
}
// translators: name of app used to navigate files and folders on macOS
return __( 'Finder' );
}