Skip to content

Commit

Permalink
i18n: Patterns: Disambiguate singular & plural uses of 'Synced' & 'Un…
Browse files Browse the repository at this point in the history
…synced' (#62375)

* i18n: Patterns: Disambiguate singular & plural uses of 'Synced' & 'Unsynced'

* Logical refactor: `A[x] || B[x]` <=> `(A || B)[x]`
  • Loading branch information
mcsf authored and ellatrix committed Jun 11, 2024
1 parent 6f7ff01 commit 14b5fdf
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ export default function InitPatternModal() {
/>
<ReusableBlocksRenameHint />
<ToggleControl
label={ _x(
'Synced',
'Option that makes an individual pattern synchronized'
) }
label={ _x( 'Synced', 'pattern (singular)' ) }
help={ __(
'Sync this pattern across multiple locations.'
) }
Expand Down
27 changes: 15 additions & 12 deletions packages/edit-site/src/components/page-patterns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,12 @@ const DEFAULT_VIEW = {
const SYNC_FILTERS = [
{
value: PATTERN_SYNC_TYPES.full,
label: _x( 'Synced', 'Option that shows all synchronized patterns' ),
label: _x( 'Synced', 'pattern (singular)' ),
description: __( 'Patterns that are kept in sync across the site.' ),
},
{
value: PATTERN_SYNC_TYPES.unsynced,
label: _x(
'Not synced',
'Option that shows all patterns that are not synchronized'
),
label: _x( 'Not synced', 'pattern (singular)' ),
description: __(
'Patterns that can be changed freely without affecting the site.'
),
Expand Down Expand Up @@ -298,13 +295,19 @@ export default function DataviewsPatterns() {
<span
className={ `edit-site-patterns__field-sync-status-${ item.syncStatus }` }
>
{ SYNC_FILTERS.find(
( { value } ) => value === item.syncStatus
)?.label ||
SYNC_FILTERS.find(
( { value } ) =>
value === PATTERN_SYNC_TYPES.unsynced
).label }
{
(
SYNC_FILTERS.find(
( { value } ) =>
value === item.syncStatus
) ||
SYNC_FILTERS.find(
( { value } ) =>
value ===
PATTERN_SYNC_TYPES.unsynced
)
).label
}
</span>
);
},
Expand Down
10 changes: 2 additions & 8 deletions packages/editor/src/components/post-sync-status/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,8 @@ export default function PostSyncStatus() {
<PostPanelRow label={ __( 'Sync status' ) }>
<div className="editor-post-sync-status__value">
{ syncStatus === 'unsynced'
? _x(
'Not synced',
'Text that indicates that the pattern is not synchronized'
)
: _x(
'Synced',
'Text that indicates that the pattern is synchronized'
) }
? _x( 'Not synced', 'pattern (singular)' )
: _x( 'Synced', 'pattern (singular)' ) }
</div>
</PostPanelRow>
);
Expand Down
5 changes: 1 addition & 4 deletions packages/patterns/src/components/create-pattern-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,7 @@ export function CreatePatternModalContents( {
categoryMap={ categoryMap }
/>
<ToggleControl
label={ _x(
'Synced',
'Option that makes an individual pattern synchronized'
) }
label={ _x( 'Synced', 'pattern (singular)' ) }
help={ __(
'Sync this pattern across multiple locations.'
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,7 @@ export default function ReusableBlockConvertButton( {
placeholder={ __( 'My pattern' ) }
/>
<ToggleControl
label={ _x(
'Synced',
'Option that makes an individual pattern synchronized'
) }
label={ _x( 'Synced', 'pattern (singular)' ) }
help={ __(
'Sync this pattern across multiple locations.'
) }
Expand Down

0 comments on commit 14b5fdf

Please sign in to comment.