Skip to content

Commit

Permalink
DataViews: Use i18n._x to clarify term "Duplicate" (#57686)
Browse files Browse the repository at this point in the history
These labels all refer to actions, where "duplicate" is meant as a verb.
For a translator, that context was not clear, as "duplicate" could have
been understood to be an adjective.
  • Loading branch information
mcsf authored Jan 9, 2024
1 parent 6a2fda1 commit 9019500
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { paramCase as kebabCase } from 'change-case';
*/
import { getQueryArgs } from '@wordpress/url';
import { downloadBlob } from '@wordpress/blob';
import { __, sprintf } from '@wordpress/i18n';
import { __, _x, sprintf } from '@wordpress/i18n';
import {
Button,
TextControl,
Expand Down Expand Up @@ -251,9 +251,9 @@ export const resetAction = {

export const duplicatePatternAction = {
id: 'duplicate-pattern',
label: __( 'Duplicate' ),
label: _x( 'Duplicate', 'action label' ),
isEligible: ( item ) => item.type !== TEMPLATE_PART_POST_TYPE,
modalHeader: __( 'Duplicate pattern' ),
modalHeader: _x( 'Duplicate pattern', 'action label' ),
RenderModal: ( { item, closeModal } ) => {
const { categoryId = PATTERN_DEFAULT_CATEGORY } = getQueryArgs(
window.location.href
Expand All @@ -276,7 +276,7 @@ export const duplicatePatternAction = {
return (
<CreatePatternModalContents
onClose={ closeModal }
confirmLabel={ __( 'Duplicate' ) }
confirmLabel={ _x( 'Duplicate', 'action label' ) }
{ ...duplicatedProps }
/>
);
Expand All @@ -285,9 +285,9 @@ export const duplicatePatternAction = {

export const duplicateTemplatePartAction = {
id: 'duplicate-template-part',
label: __( 'Duplicate' ),
label: _x( 'Duplicate', 'action label' ),
isEligible: ( item ) => item.type === TEMPLATE_PART_POST_TYPE,
modalHeader: __( 'Duplicate template part' ),
modalHeader: _x( 'Duplicate template part', 'action label' ),
RenderModal: ( { item, closeModal } ) => {
const { createSuccessNotice } = useDispatch( noticesStore );
const { categoryId = PATTERN_DEFAULT_CATEGORY } = getQueryArgs(
Expand Down Expand Up @@ -322,7 +322,7 @@ export const duplicateTemplatePartAction = {
) }
onCreate={ onTemplatePartSuccess }
onError={ closeModal }
confirmLabel={ __( 'Duplicate' ) }
confirmLabel={ _x( 'Duplicate', 'action label' ) }
/>
);
},
Expand Down

0 comments on commit 9019500

Please sign in to comment.