Skip to content

Commit

Permalink
Use _x
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Nov 13, 2023
1 parent 68f7dac commit 6ad4a7a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
MenuItemsChoice,
ExternalLink,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';
import { Icon } from '@wordpress/icons';
import { useMemo, createInterpolateElement } from '@wordpress/element';

Expand Down Expand Up @@ -55,18 +55,24 @@ export function PatternsFilter( {

const patternSyncMenuOptions = useMemo(
() => [
// translators: Button label, when clicked it shows "All patterns".
{ value: SYNC_TYPES.all, label: __( 'All' ) },
{
value: SYNC_TYPES.all,
label: _x( 'All', 'Option that shows all patterns' ),
},
{
value: SYNC_TYPES.full,
// translators: Button label, when clicked it shows all "Synced patterns".
label: __( 'Synced' ),
label: _x(
'Synced',
'Option that shows all synchronized patterns'
),
disabled: shouldDisableSyncFilter,
},
{
value: SYNC_TYPES.unsynced,
// translators: Button label, when click it shows all "Not synced patterns".
label: __( 'Not synced' ),
label: _x(
'Not synced',
'Option that shows all patterns that are not synchronized'
),
disabled: shouldDisableSyncFilter,
},
],
Expand Down
17 changes: 10 additions & 7 deletions packages/edit-site/src/components/page-patterns/patterns-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
__experimentalHeading as Heading,
__experimentalText as Text,
} from '@wordpress/components';
import { __, isRTL } from '@wordpress/i18n';
import { __, _x, isRTL } from '@wordpress/i18n';
import { chevronLeft, chevronRight } from '@wordpress/icons';
import { privateApis as routerPrivateApis } from '@wordpress/router';
import { useAsyncList, useViewportMatch } from '@wordpress/compose';
Expand All @@ -33,12 +33,15 @@ import Pagination from './pagination';
const { useLocation, useHistory } = unlock( routerPrivateApis );

const SYNC_FILTERS = {
// translators: Button label, when clicked it shows "All patterns".
all: __( 'All' ),
// translators: Button label, when clicked it shows all "Synced patterns".
[ PATTERN_SYNC_TYPES.full ]: __( 'Synced' ),
// translators: Button label, when click it shows all "Not synced patterns".
[ PATTERN_SYNC_TYPES.unsynced ]: __( 'Not synced' ),
all: _x( 'All', 'Option that shows all patterns' ),
[ PATTERN_SYNC_TYPES.full ]: _x(
'Synced',
'Option that shows all synchronized patterns'
),
[ PATTERN_SYNC_TYPES.unsynced ]: _x(
'Not synced',
'Option that shows all patterns that are not synchronized'
),
};

const SYNC_DESCRIPTIONS = {
Expand Down
8 changes: 5 additions & 3 deletions packages/editor/src/components/post-sync-status/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { useSelect, useDispatch } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';
import {
PanelRow,
Modal,
Expand Down Expand Up @@ -109,8 +109,10 @@ export function PostSyncStatusModal() {
<VStack spacing="5">
<ReusableBlocksRenameHint />
<ToggleControl
// translators: Button label, when active makes an individual pattern "Synced".
label={ __( 'Synced' ) }
label={ _x(
'Synced',
'Option that makes an individual pattern synchronized'
) }
help={ __(
'Editing the pattern will update it anywhere it is used.'
) }
Expand Down
8 changes: 5 additions & 3 deletions packages/patterns/src/components/create-pattern-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
__experimentalVStack as VStack,
ToggleControl,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';
import { useState, useMemo } from '@wordpress/element';
import { useDispatch, useSelect } from '@wordpress/data';
import { store as noticesStore } from '@wordpress/notices';
Expand Down Expand Up @@ -179,8 +179,10 @@ export default function CreatePatternModal( {
categoryMap={ categoryMap }
/>
<ToggleControl
// translators: Button label, when active makes an individual pattern "Synced".
label={ __( 'Synced' ) }
label={ _x(
'Synced',
'Option that makes an individual pattern synchronized'
) }
help={ __(
'Editing the pattern will update it anywhere it is used.'
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '@wordpress/components';
import { symbol } from '@wordpress/icons';
import { useDispatch, useSelect } from '@wordpress/data';
import { __, sprintf } from '@wordpress/i18n';
import { __, _x, sprintf } from '@wordpress/i18n';
import { store as noticesStore } from '@wordpress/notices';
import { store as coreStore } from '@wordpress/core-data';

Expand Down Expand Up @@ -185,8 +185,10 @@ export default function ReusableBlockConvertButton( {
/>

<ToggleControl
// translators: Button label, when active makes an individual pattern "Synced".
label={ __( 'Synced' ) }
label={ _x(
'Synced',
'Option that makes an individual pattern synchronized'
) }
help={ __(
'Editing the pattern will update it anywhere it is used.'
) }
Expand Down

0 comments on commit 6ad4a7a

Please sign in to comment.