Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataViews: Use i18n._x to clarify term "Duplicate" #57686

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading