Skip to content

Commit

Permalink
Improve hint text
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Oct 20, 2024
1 parent b82f350 commit 15f6256
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
14 changes: 10 additions & 4 deletions src/elements/table-placeholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { __ } from '@wordpress/i18n';
import { useState, createInterpolateElement } from '@wordpress/element';
import { BlockIcon } from '@wordpress/block-editor';
import { Button, Placeholder, TextControl, ToggleControl } from '@wordpress/components';
import { isAppleOS } from '@wordpress/keycodes';

/**
* Internal dependencies
Expand Down Expand Up @@ -97,10 +98,15 @@ export default function TablePlaceholder( { setAttributes }: Props ) {
>
<legend className="components-placeholder__instructions">
{ createInterpolateElement(
__(
'Hint: Hold <code>Ctrl</code> key to select multiple cells. Hold <code>Shift</code> key to select the range.',
'flexible-table-block'
),
isAppleOS()
? __(
'Hint: Hold <code>Command</code> key to select multiple cells. Hold <code>Shift</code> key to select the range.',
'flexible-table-block'
)
: __(
'Hint: Hold <code>Ctrl</code> key to select multiple cells. Hold <code>Shift</code> key to select the range.',
'flexible-table-block'
),
{ code: <code /> }
) }
</legend>
Expand Down
14 changes: 10 additions & 4 deletions src/settings/global-settings/help-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
__experimentalText as Text,
__experimentalHeading as Heading,
} from '@wordpress/components';
import { isAppleOS } from '@wordpress/keycodes';

type Props = {
setIsHelpModalOpen: Dispatch< SetStateAction< boolean > >;
Expand Down Expand Up @@ -43,10 +44,15 @@ export default function HelpModal( { setIsHelpModalOpen }: Props ) {
<Heading level={ 5 }>{ __( 'Select multiple cells', 'flexible-table-block' ) }</Heading>
<Text as="p">
{ createInterpolateElement(
__(
'Hold <code>Ctrl</code> key to select multiple cells or hold <code>Shift</code> key to select the range. Selecting multiple cells is used to merge cells or to change styles of multiple cells.',
'flexible-table-block'
),
isAppleOS()
? __(
'Hold <code>Command</code> key to select multiple cells. Hold <code>Shift</code> key to select the range. Selecting multiple cells is used to merge cells or to change styles of multiple cells.',
'flexible-table-block'
)
: __(
'Hold <code>Ctrl</code> key to select multiple cells. Hold <code>Shift</code> key to select the range. Selecting multiple cells is used to merge cells or to change styles of multiple cells.',
'flexible-table-block'
),
{ code: <code /> }
) }
</Text>
Expand Down

0 comments on commit 15f6256

Please sign in to comment.