Skip to content

Commit

Permalink
Add context for translators to any unclear usage of "synced" (#55935)
Browse files Browse the repository at this point in the history
* Add context for translators to any unclear usage of synced

* Remove toggle in translator comment

* Use _x
  • Loading branch information
talldan authored and mikachan committed Nov 13, 2023
1 parent 6f2a988 commit 3c1c897
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 14 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 @@ -70,15 +70,24 @@ export function BlockPatternsSyncFilter( {

const patternSyncMenuOptions = useMemo(
() => [
{ value: SYNC_TYPES.all, label: __( 'All' ) },
{
value: SYNC_TYPES.all,
label: _x( 'All', 'Option that shows all patterns' ),
},
{
value: SYNC_TYPES.full,
label: __( 'Synced' ),
label: _x(
'Synced',
'Option that shows all synchronized patterns'
),
disabled: shouldDisableSyncFilter,
},
{
value: SYNC_TYPES.unsynced,
label: __( 'Not synced' ),
label: _x(
'Not synced',
'Option that shows all patterns that are not synchronized'
),
disabled: shouldDisableSyncFilter,
},
],
Expand Down
14 changes: 10 additions & 4 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,9 +33,15 @@ import Pagination from './pagination';
const { useLocation, useHistory } = unlock( routerPrivateApis );

const SYNC_FILTERS = {
all: __( 'All' ),
[ PATTERN_SYNC_TYPES.full ]: __( 'Synced' ),
[ 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
7 changes: 5 additions & 2 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,7 +109,10 @@ export function PostSyncStatusModal() {
<VStack spacing="5">
<ReusableBlocksRenameHint />
<ToggleControl
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
7 changes: 5 additions & 2 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 @@ -173,7 +173,10 @@ export default function CreatePatternModal( {
categoryMap={ categoryMap }
/>
<ToggleControl
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 @@ -184,7 +184,10 @@ export default function ReusableBlockConvertButton( {
/>

<ToggleControl
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 3c1c897

Please sign in to comment.