Skip to content

Commit

Permalink
Remove most of the occurrences of the verb toggle. (#66371)
Browse files Browse the repository at this point in the history
* Remove most of the occurrences of the verb toggle.

* Remove term panel.

Co-authored-by: afercia <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: mcsf <[email protected]>
  • Loading branch information
4 people authored Oct 29, 2024
1 parent 7ca9567 commit 7c64d0a
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { fullscreen } from '@wordpress/icons';

function BlockFullHeightAlignmentControl( {
isActive,
label = __( 'Toggle full height' ),
label = __( 'Full height' ),
onToggle,
isDisabled,
} ) {
Expand Down
4 changes: 1 addition & 3 deletions packages/block-library/src/cover/test/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ describe( 'Cover block', () => {
'min-height: 100vh;'
);

await userEvent.click(
screen.getByLabelText( 'Toggle full height' )
);
await userEvent.click( screen.getByLabelText( 'Full height' ) );

expect( screen.getByLabelText( 'Block: Cover' ) ).toHaveStyle(
'min-height: 100vh;'
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/paragraph/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function DropCapControl( { clientId, attributes, setAttributes } ) {
} else if ( dropCap ) {
helpText = __( 'Showing large initial letter.' );
} else {
helpText = __( 'Toggle to show a large initial letter.' );
helpText = __( 'Show a large initial letter.' );
}

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/search/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export default function SearchEdit( {
<BlockControls>
<ToolbarGroup>
<ToolbarButton
title={ __( 'Toggle search label' ) }
title={ __( 'Show search label' ) }
icon={ toggleLabel }
onClick={ () => {
setAttributes( {
Expand Down
4 changes: 2 additions & 2 deletions packages/data/src/components/use-select/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ describe( 'useSelect', () => {
return (
<>
<div role="status">{ state }</div>
<button onClick={ toggle }>Toggle</button>
<button onClick={ toggle }>Open</button>
</>
);
} );
Expand All @@ -693,7 +693,7 @@ describe( 'useSelect', () => {
'count2:0'
);

act( () => screen.getByText( 'Toggle' ).click() );
act( () => screen.getByText( 'Open' ).click() );

expect( selectCount1 ).toHaveBeenCalledTimes( 1 );
expect( selectCount2 ).toHaveBeenCalledTimes( 1 );
Expand Down
4 changes: 2 additions & 2 deletions packages/dataviews/src/components/dataviews-filters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@wordpress/element';
import { __experimentalHStack as HStack, Button } from '@wordpress/components';
import { funnel } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -124,7 +124,7 @@ export function FilterVisibilityToggle( {
className="dataviews-filters__visibility-toggle"
size="compact"
icon={ funnel }
label={ __( 'Toggle filter display' ) }
label={ _x( 'Filter', 'verb' ) }
onClick={ () => {
if ( ! isShowingFilter ) {
setOpenedFilter( null );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function KeyboardShortcuts() {
registerShortcut( {
name: 'core/edit-post/toggle-fullscreen',
category: 'global',
description: __( 'Toggle fullscreen mode.' ),
description: __( 'Enable or disable fullscreen mode.' ),
keyCombination: {
modifier: 'secondary',
character: 'f',
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-site/src/components/post-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ export default function PostList( { postType } ) {
size="compact"
isPressed={ quickEdit }
icon={ drawerRight }
label={ __( 'Details panel' ) }
label={ __( 'Details' ) }
onClick={ () => {
history.push( {
...location.params,
Expand Down
14 changes: 8 additions & 6 deletions packages/editor/src/components/commands/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ function useEditorCommandLoader() {
commands.push( {
name: 'core/toggle-distraction-free',
label: isDistractionFree
? __( 'Exit Distraction Free' )
: __( 'Enter Distraction Free' ),
? __( 'Exit Distraction free' )
: __( 'Enter Distraction free' ),
callback: ( { close } ) => {
toggleDistractionFree();
close();
Expand All @@ -117,7 +117,9 @@ function useEditorCommandLoader() {

commands.push( {
name: 'core/toggle-spotlight-mode',
label: __( 'Toggle spotlight' ),
label: isFocusMode
? __( 'Exit Spotlight mode' )
: __( 'Enter Spotlight mode' ),
callback: ( { close } ) => {
toggle( 'core', 'focusMode' );
close();
Expand Down Expand Up @@ -160,7 +162,7 @@ function useEditorCommandLoader() {

commands.push( {
name: 'core/toggle-top-toolbar',
label: __( 'Toggle top toolbar' ),
label: __( 'Top toolbar' ),
callback: ( { close } ) => {
toggle( 'core', 'fixedToolbar' );
if ( isDistractionFree ) {
Expand Down Expand Up @@ -224,7 +226,7 @@ function useEditorCommandLoader() {

commands.push( {
name: 'core/open-settings-sidebar',
label: __( 'Toggle settings sidebar' ),
label: __( 'Show or hide the Settings panel.' ),
icon: isRTL() ? drawerLeft : drawerRight,
callback: ( { close } ) => {
const activeSidebar = getActiveComplementaryArea( 'core' );
Expand All @@ -239,7 +241,7 @@ function useEditorCommandLoader() {

commands.push( {
name: 'core/open-block-inspector',
label: __( 'Toggle block inspector' ),
label: __( 'Show or hide the Block settings panel' ),
icon: blockDefault,
callback: ( { close } ) => {
const activeSidebar = getActiveComplementaryArea( 'core' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function EditorKeyboardShortcutsRegister() {
registerShortcut( {
name: 'core/editor/toggle-list-view',
category: 'global',
description: __( 'Open the List View.' ),
description: __( 'Show or hide the List View.' ),
keyCombination: {
modifier: 'access',
character: 'o',
Expand All @@ -82,7 +82,7 @@ function EditorKeyboardShortcutsRegister() {
registerShortcut( {
name: 'core/editor/toggle-distraction-free',
category: 'global',
description: __( 'Toggle distraction free mode.' ),
description: __( 'Enter or exit distraction free mode.' ),
keyCombination: {
modifier: 'primaryShift',
character: '\\',
Expand All @@ -92,7 +92,7 @@ function EditorKeyboardShortcutsRegister() {
registerShortcut( {
name: 'core/editor/toggle-sidebar',
category: 'global',
description: __( 'Show or hide the Settings sidebar.' ),
description: __( 'Show or hide the Settings panel.' ),
keyCombination: {
modifier: 'primaryShift',
character: ',',
Expand Down
12 changes: 6 additions & 6 deletions packages/editor/src/components/post-sticky/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ function setupUseSelectMock( { hasStickyAction, postType } ) {
describe( 'PostSticky', () => {
it( 'should not render anything if the post type is not "post"', () => {
setupUseSelectMock( { hasStickyAction: true, postType: 'page' } );
render( <PostStickyCheck>Can Toggle Sticky</PostStickyCheck> );
render( <PostStickyCheck>Can Show Sticky</PostStickyCheck> );
expect(
screen.queryByText( 'Can Toggle Sticky' )
screen.queryByText( 'Can Show Sticky' )
).not.toBeInTheDocument();
} );

it( "should not render anything if post doesn't support stickying", () => {
setupUseSelectMock( { hasStickyAction: false, postType: 'post' } );
render( <PostStickyCheck>Can Toggle Sticky</PostStickyCheck> );
render( <PostStickyCheck>Can Show Sticky</PostStickyCheck> );
expect(
screen.queryByText( 'Can Toggle Sticky' )
screen.queryByText( 'Can Show Sticky' )
).not.toBeInTheDocument();
} );

it( 'should render if the post supports stickying', () => {
setupUseSelectMock( { hasStickyAction: true, postType: 'post' } );
render( <PostStickyCheck>Can Toggle Sticky</PostStickyCheck> );
expect( screen.getByText( 'Can Toggle Sticky' ) ).toBeVisible();
render( <PostStickyCheck>Can Show Sticky</PostStickyCheck> );
expect( screen.getByText( 'Can Show Sticky' ) ).toBeVisible();
} );
} );
4 changes: 2 additions & 2 deletions packages/editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,8 @@ export const toggleDistractionFree =
.dispatch( noticesStore )
.createInfoNotice(
isDistractionFree
? __( 'Distraction free off.' )
: __( 'Distraction free on.' ),
? __( 'Distraction free mode deactivated.' )
: __( 'Distraction free mode activated.' ),
{
id: 'core/editor/distraction-free-mode/notice',
type: 'snackbar',
Expand Down

0 comments on commit 7c64d0a

Please sign in to comment.