update text domain in plugins/woocommerce-blocks (#42717)

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
This commit is contained in:
Ron Rennick 2023-12-12 18:12:36 -04:00 committed by GitHub
parent a2812bdb59
commit 4fddface47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
319 changed files with 1227 additions and 1223 deletions

View File

@ -56,7 +56,7 @@ const Edit = ( props: BlockEditProps< Attributes > ) => {
>
{ __(
'Add to cart',
'woo-gutenberg-products-block'
'woocommerce'
) }
</button>
</Disabled>

View File

@ -5,11 +5,11 @@ import { __ } from '@wordpress/i18n';
import { cart } from '@woocommerce/icons';
import { Icon } from '@wordpress/icons';
export const BLOCK_TITLE = __( 'Add to Cart', 'woo-gutenberg-products-block' );
export const BLOCK_TITLE = __( 'Add to Cart', 'woocommerce' );
export const BLOCK_ICON = (
<Icon icon={ cart } className="wc-block-editor-components-block-icon" />
);
export const BLOCK_DESCRIPTION = __(
'Displays an add to cart button. Optionally displays other add to cart form elements.',
'woo-gutenberg-products-block'
'woocommerce'
);

View File

@ -44,17 +44,17 @@ const Edit = ( { attributes, setAttributes }: EditProps ) => {
<EditProductLink productId={ product.id } />
<InspectorControls>
<PanelBody
title={ __( 'Layout', 'woo-gutenberg-products-block' ) }
title={ __( 'Layout', 'woocommerce' ) }
>
{ productSupportsAddToCartForm( product ) ? (
<ToggleControl
label={ __(
'Display form elements',
'woo-gutenberg-products-block'
'woocommerce'
) }
help={ __(
'Depending on product type, allow customers to select a quantity, variations etc.',
'woo-gutenberg-products-block'
'woocommerce'
) }
checked={ showFormElements }
onChange={ () =>
@ -71,7 +71,7 @@ const Edit = ( { attributes, setAttributes }: EditProps ) => {
>
{ __(
'This product does not support the block based add to cart form. A link to the product page will be shown instead.',
'woo-gutenberg-products-block'
'woocommerce'
) }
</Notice>
) }
@ -89,6 +89,6 @@ export default withProductSelector( {
label: BLOCK_TITLE,
description: __(
'Choose a product to display its add to cart form.',
'woo-gutenberg-products-block'
'woocommerce'
),
} )( Edit );

View File

@ -33,7 +33,7 @@ const Simple = () => {
<ProductUnavailable
reason={ __(
'This product is currently out of stock and cannot be purchased.',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
);

View File

@ -38,7 +38,7 @@ const Variable = () => {
<ProductUnavailable
reason={ __(
'This product is currently out of stock and cannot be purchased.',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
);

View File

@ -19,7 +19,7 @@ interface Props extends SelectControlType.Props< string > {
// Default option for select boxes.
const selectAnOption = {
value: '',
label: __( 'Select an option', 'woo-gutenberg-products-block' ),
label: __( 'Select an option', 'woocommerce' ),
};
/**
@ -32,7 +32,7 @@ const AttributeSelectControl = ( {
onChange = () => void 0,
errorMessage = __(
'Please select a value.',
'woo-gutenberg-products-block'
'woocommerce'
),
}: Props ) => {
const errorId = attributeName;

View File

@ -75,11 +75,11 @@ const ButtonComponent = ( {
'%d in cart',
'%d in cart',
quantityInCart,
'woo-gutenberg-products-block'
'woocommerce'
),
quantityInCart
)
: __( 'Add to cart', 'woo-gutenberg-products-block' ) }
: __( 'Add to cart', 'woocommerce' ) }
{ !! isDone && <Icon icon={ check } /> }
</Button>
);
@ -166,7 +166,7 @@ const AddToCartButton = () => {
href={ addToCartButtonData.url }
text={
addToCartButtonData.text ||
__( 'View Product', 'woo-gutenberg-products-block' )
__( 'View Product', 'woocommerce' )
}
onClick={ () => {
dispatchStoreEvent( 'product-view-link', {

View File

@ -6,7 +6,7 @@ import { __ } from '@wordpress/i18n';
const ProductUnavailable = ( {
reason = __(
'Sorry, this product cannot be purchased.',
'woo-gutenberg-products-block'
'woocommerce'
),
} ) => {
return (

View File

@ -29,7 +29,7 @@ export const Block = ( props: ProductAverageRatingProps ): JSX.Element => {
<div className={ className } style={ styleProps.style }>
{ Number( product.average_rating ) > 0
? product.average_rating
: __( 'No ratings', 'woo-gutenberg-products-block' ) }
: __( 'No ratings', 'woocommerce' ) }
</div>
);
};

View File

@ -55,13 +55,13 @@ const AddToCartButton = ( {
'%d in cart',
'%d in cart',
cartQuantity,
'woo-gutenberg-products-block'
'woocommerce'
),
cartQuantity
)
: decodeEntities(
productCartDetails?.text ||
__( 'Add to cart', 'woo-gutenberg-products-block' )
__( 'Add to cart', 'woocommerce' )
);
const ButtonTag = allowAddToCart ? 'button' : 'a';

View File

@ -42,12 +42,12 @@ function WidthPanel( {
return (
<PanelBody
title={ __( 'Width settings', 'woo-gutenberg-products-block' ) }
title={ __( 'Width settings', 'woocommerce' ) }
>
<ButtonGroup
aria-label={ __(
'Button width',
'woo-gutenberg-products-block'
'woocommerce'
) }
>
{ [ 25, 50, 75, 100 ].map( ( widthValue ) => {

View File

@ -135,7 +135,7 @@ export const Block = ( props: Props ): JSX.Element | null => {
const ParentComponent = showProductLink ? 'a' : Fragment;
const anchorLabel = sprintf(
/* translators: %s is referring to the product name */
__( 'Link to %s', 'woo-gutenberg-products-block' ),
__( 'Link to %s', 'woocommerce' ),
product.name
);
const anchorProps = {

View File

@ -6,12 +6,12 @@ import { image, Icon } from '@wordpress/icons';
export const BLOCK_TITLE: string = __(
'Product Image',
'woo-gutenberg-products-block'
'woocommerce'
);
export const BLOCK_ICON: JSX.Element = (
<Icon icon={ image } className="wc-block-editor-components-block-icon" />
);
export const BLOCK_DESCRIPTION: string = __(
'Display the main product image.',
'woo-gutenberg-products-block'
'woocommerce'
);

View File

@ -74,16 +74,16 @@ const Edit = ( {
setAttributes={ setAttributes }
/>
<PanelBody
title={ __( 'Content', 'woo-gutenberg-products-block' ) }
title={ __( 'Content', 'woocommerce' ) }
>
<ToggleControl
label={ __(
'Link to Product Page',
'woo-gutenberg-products-block'
'woocommerce'
) }
help={ __(
'Links the image to the single product listing.',
'woo-gutenberg-products-block'
'woocommerce'
) }
checked={ showProductLink }
onChange={ () =>
@ -95,11 +95,11 @@ const Edit = ( {
<ToggleControl
label={ __(
'Show On-Sale Badge',
'woo-gutenberg-products-block'
'woocommerce'
) }
help={ __(
'Display a “sale” badge if the product is on-sale.',
'woo-gutenberg-products-block'
'woocommerce'
) }
checked={ showSaleBadge }
onChange={ () =>
@ -112,7 +112,7 @@ const Edit = ( {
<ToggleGroupControl
label={ __(
'Sale Badge Alignment',
'woo-gutenberg-products-block'
'woocommerce'
) }
value={ saleBadgeAlign }
onChange={ ( value: SaleBadgeAlignProps ) =>
@ -123,21 +123,21 @@ const Edit = ( {
value="left"
label={ __(
'Left',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
<ToggleGroupControlOption
value="center"
label={ __(
'Center',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
<ToggleGroupControlOption
value="right"
label={ __(
'Right',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
</ToggleGroupControl>
@ -146,12 +146,12 @@ const Edit = ( {
<ToggleGroupControl
label={ __(
'Image Sizing',
'woo-gutenberg-products-block'
'woocommerce'
) }
help={ createInterpolateElement(
__(
'Product image cropping can be modified in the <a>Customizer</a>.',
'woo-gutenberg-products-block'
'woocommerce'
),
{
a: (
@ -175,14 +175,14 @@ const Edit = ( {
value={ ImageSizing.SINGLE }
label={ __(
'Full Size',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
<ToggleGroupControlOption
value={ ImageSizing.THUMBNAIL }
label={ __(
'Cropped',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
</ToggleGroupControl>

View File

@ -31,15 +31,15 @@ interface ImageSizeSettingProps {
const scaleHelp: Record< string, string > = {
cover: __(
'Image is scaled and cropped to fill the entire space without being distorted.',
'woo-gutenberg-products-block'
'woocommerce'
),
contain: __(
'Image is scaled to fill the space without clipping nor distorting.',
'woo-gutenberg-products-block'
'woocommerce'
),
fill: __(
'Image will be stretched and distorted to completely fill the space.',
'woo-gutenberg-products-block'
'woocommerce'
),
};
@ -52,10 +52,10 @@ export const ImageSizeSettings = ( {
return (
<ToolsPanel
className="wc-block-product-image__tools-panel"
label={ __( 'Image size', 'woo-gutenberg-products-block' ) }
label={ __( 'Image size', 'woocommerce' ) }
>
<UnitControl
label={ __( 'Height', 'woo-gutenberg-products-block' ) }
label={ __( 'Height', 'woocommerce' ) }
onChange={ ( value: string ) => {
setAttributes( { height: value } );
} }
@ -68,7 +68,7 @@ export const ImageSizeSettings = ( {
] }
/>
<UnitControl
label={ __( 'Width', 'woo-gutenberg-products-block' ) }
label={ __( 'Width', 'woocommerce' ) }
onChange={ ( value: string ) => {
setAttributes( { width: value } );
} }
@ -83,10 +83,10 @@ export const ImageSizeSettings = ( {
{ height && (
<ToolsPanelItem
hasValue={ () => true }
label={ __( 'Scale', 'woo-gutenberg-products-block' ) }
label={ __( 'Scale', 'woocommerce' ) }
>
<ToggleGroupControl
label={ __( 'Scale', 'woo-gutenberg-products-block' ) }
label={ __( 'Scale', 'woocommerce' ) }
value={ scale }
help={ scaleHelp[ scale ] }
onChange={ ( value: string ) =>
@ -101,21 +101,21 @@ export const ImageSizeSettings = ( {
value="cover"
label={ __(
'Cover',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
<ToggleGroupControlOption
value="contain"
label={ __(
'Contain',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
<ToggleGroupControlOption
value="fill"
label={ __(
'Fill',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
</>

View File

@ -33,7 +33,7 @@ const blockConfig: BlockConfiguration = {
'core/post-template',
'woocommerce/product-template',
],
textdomain: 'woo-gutenberg-products-block',
textdomain: 'woocommerce',
attributes,
supports,
edit,

View File

@ -6,7 +6,7 @@ import { currencyDollar, Icon } from '@wordpress/icons';
export const BLOCK_TITLE: string = __(
'Product Price',
'woo-gutenberg-products-block'
'woocommerce'
);
export const BLOCK_ICON: JSX.Element = (
<Icon
@ -16,5 +16,5 @@ export const BLOCK_ICON: JSX.Element = (
);
export const BLOCK_DESCRIPTION: string = __(
'Display the price of a product.',
'woo-gutenberg-products-block'
'woocommerce'
);

View File

@ -56,7 +56,7 @@ export const SingleProductDetails = () => {
active: true,
content: __(
'This block lists description, attributes and reviews for a single product.',
'woo-gutenberg-products-block'
'woocommerce'
),
},
{

View File

@ -31,7 +31,7 @@ const Edit = () => {
{
prefix: __(
'Category: ',
'woo-gutenberg-products-block'
'woocommerce'
),
term: 'product_cat',
},
@ -39,7 +39,7 @@ const Edit = () => {
[
'core/post-terms',
{
prefix: __( 'Tags: ', 'woo-gutenberg-products-block' ),
prefix: __( 'Tags: ', 'woocommerce' ),
term: 'product_tag',
},
],

View File

@ -22,27 +22,27 @@ export const ProductReviews = () => {
<p>
{ __(
'The products reviews and the form to add a new review will be displayed here according to your theme. The look you see here is not representative of what is going to look like, this is just a placeholder.',
'woo-gutenberg-products-block'
'woocommerce'
) }
</p>
</Notice>
<h2>
{ __(
'3 reviews for this product',
'woo-gutenberg-products-block'
'woocommerce'
) }
</h2>
<img
src={ `${ WC_BLOCKS_IMAGE_URL }block-placeholders/product-reviews.svg` }
alt="Placeholder"
/>
<h3>{ __( 'Add a review', 'woo-gutenberg-products-block' ) }</h3>
<h3>{ __( 'Add a review', 'woocommerce' ) }</h3>
<div className="wp-block-woocommerce-product-reviews__editor__form-container">
<div className="wp-block-woocommerce-product-reviews__editor__row">
<span>
{ __(
'Your rating *',
'woo-gutenberg-products-block'
'woocommerce'
) }
</span>
<p className="wp-block-woocommerce-product-reviews__editor__stars"></p>
@ -51,7 +51,7 @@ export const ProductReviews = () => {
<span>
{ __(
'Your review *',
'woo-gutenberg-products-block'
'woocommerce'
) }
</span>
<textarea />
@ -59,7 +59,7 @@ export const ProductReviews = () => {
<input
type="submit"
className="submit wp-block-button__link wp-element-button"
value={ __( 'Submit', 'woo-gutenberg-products-block' ) }
value={ __( 'Submit', 'woocommerce' ) }
/>
</div>
</div>

View File

@ -30,11 +30,11 @@ const ReviewsCount = ( props: { reviews: number } ): JSX.Element => {
'(%s customer review)',
'(%s customer reviews)',
reviews,
'woo-gutenberg-products-block'
'woocommerce'
),
reviews
)
: __( '(X customer reviews)', 'woo-gutenberg-products-block' );
: __( '(X customer reviews)', 'woocommerce' );
return (
<span className="wc-block-components-product-rating-counter__reviews_count">

View File

@ -62,7 +62,7 @@ const NoRating = ( { parentClassName }: { parentClassName: string } ) => {
>
<span style={ starStyle } />
</div>
<span>{ __( 'No Reviews', 'woo-gutenberg-products-block' ) }</span>
<span>{ __( 'No Reviews', 'woocommerce' ) }</span>
</div>
);
};
@ -74,7 +74,7 @@ const Rating = ( props: RatingProps ): JSX.Element => {
const ratingText = sprintf(
/* translators: %f is referring to the average rating value */
__( 'Rated %f out of 5', 'woo-gutenberg-products-block' ),
__( 'Rated %f out of 5', 'woocommerce' ),
rating
);
@ -85,7 +85,7 @@ const Rating = ( props: RatingProps ): JSX.Element => {
'Rated %1$s out of 5 based on %2$s customer rating',
'Rated %1$s out of 5 based on %2$s customer ratings',
reviews,
'woo-gutenberg-products-block'
'woocommerce'
),
sprintf( '<strong class="rating">%f</strong>', rating ),
sprintf( '<span class="rating">%d</span>', reviews )

View File

@ -60,7 +60,7 @@ const NoRating = ( { parentClassName }: { parentClassName: string } ) => {
>
<span style={ starStyle } />
</div>
<span>{ __( 'No Reviews', 'woo-gutenberg-products-block' ) }</span>
<span>{ __( 'No Reviews', 'woocommerce' ) }</span>
</div>
);
};
@ -72,7 +72,7 @@ const Rating = ( props: RatingProps ): JSX.Element => {
const ratingText = sprintf(
/* translators: %f is referring to the average rating value */
__( 'Rated %f out of 5', 'woo-gutenberg-products-block' ),
__( 'Rated %f out of 5', 'woocommerce' ),
rating
);
@ -83,7 +83,7 @@ const Rating = ( props: RatingProps ): JSX.Element => {
'Rated %1$s out of 5 based on %2$s customer rating',
'Rated %1$s out of 5 based on %2$s customer ratings',
reviews,
'woo-gutenberg-products-block'
'woocommerce'
),
sprintf( '<strong class="rating">%f</strong>', rating ),
sprintf( '<span class="rating">%d</span>', reviews )
@ -112,7 +112,7 @@ const ReviewsCount = ( props: { reviews: number } ): JSX.Element => {
'(%s customer review)',
'(%s customer reviews)',
reviews,
'woo-gutenberg-products-block'
'woocommerce'
),
reviews
);

View File

@ -6,7 +6,7 @@ import { starEmpty, Icon } from '@wordpress/icons';
export const BLOCK_TITLE: string = __(
'Product Rating',
'woo-gutenberg-products-block'
'woocommerce'
);
export const BLOCK_ICON: JSX.Element = (
<Icon
@ -16,5 +16,5 @@ export const BLOCK_ICON: JSX.Element = (
);
export const BLOCK_DESCRIPTION: string = __(
'Display the average rating of a product.',
'woo-gutenberg-products-block'
'woocommerce'
);

View File

@ -36,7 +36,7 @@ const Edit = () => {
<p>
{ __(
'These products will vary depending on the main product in the page',
'woo-gutenberg-products-block'
'woocommerce'
) }
</p>
</Notice>

View File

@ -52,10 +52,10 @@ export const Block = ( props: Props ): JSX.Element | null => {
style={ styleProps.style }
>
<Label
label={ __( 'Sale', 'woo-gutenberg-products-block' ) }
label={ __( 'Sale', 'woocommerce' ) }
screenReaderLabel={ __(
'Product on sale',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
</div>

View File

@ -6,12 +6,12 @@ import { percent, Icon } from '@wordpress/icons';
export const BLOCK_TITLE: string = __(
'On-Sale Badge',
'woo-gutenberg-products-block'
'woocommerce'
);
export const BLOCK_ICON: JSX.Element = (
<Icon icon={ percent } className="wc-block-editor-components-block-icon" />
);
export const BLOCK_DESCRIPTION: string = __(
'Displays an on-sale badge if the product is on-sale.',
'woo-gutenberg-products-block'
'woocommerce'
);

View File

@ -16,7 +16,7 @@ import save from '../save';
*/
const sharedConfig: Omit< BlockConfiguration, 'attributes' | 'title' > = {
category: 'woocommerce-product-elements',
keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
icon: {
src: (
<Icon

View File

@ -51,7 +51,7 @@ export const ProductSelector = ( {
setIsEditing( false );
} }
>
{ __( 'Done', 'woo-gutenberg-products-block' ) }
{ __( 'Done', 'woocommerce' ) }
</Button>
</div>
</Placeholder>
@ -64,7 +64,7 @@ export const ProductSelector = ( {
>
{ __(
'Switch product…',
'woo-gutenberg-products-block'
'woocommerce'
) }
</TextToolbarButton>
</ToolbarGroup>

View File

@ -36,7 +36,7 @@ const Preview = ( {
} ) }
style={ style }
>
{ __( 'SKU:', 'woo-gutenberg-products-block' ) }{ ' ' }
{ __( 'SKU:', 'woocommerce' ) }{ ' ' }
<strong>{ sku }</strong>
</div>
);

View File

@ -7,12 +7,12 @@ import { Icon } from '@wordpress/icons';
export const BLOCK_TITLE: string = __(
'Product SKU',
'woo-gutenberg-products-block'
'woocommerce'
);
export const BLOCK_ICON: JSX.Element = (
<Icon icon={ barcode } className="wc-block-editor-components-block-icon" />
);
export const BLOCK_DESCRIPTION: string = __(
'Display the SKU of a product.',
'woo-gutenberg-products-block'
'woocommerce'
);

View File

@ -45,15 +45,15 @@ const getTextBasedOnStock = ( {
if ( isLowStock && lowStockAmount !== null ) {
return sprintf(
/* translators: %d stock amount (number of items in stock for product) */
__( '%d left in stock', 'woo-gutenberg-products-block' ),
__( '%d left in stock', 'woocommerce' ),
lowStockAmount
);
} else if ( isOnBackorder ) {
return __( 'Available on backorder', 'woo-gutenberg-products-block' );
return __( 'Available on backorder', 'woocommerce' );
} else if ( isInStock ) {
return __( 'In stock', 'woo-gutenberg-products-block' );
return __( 'In stock', 'woocommerce' );
}
return __( 'Out of stock', 'woo-gutenberg-products-block' );
return __( 'Out of stock', 'woocommerce' );
};
type Props = BlockAttributes & HTMLAttributes< HTMLDivElement >;

View File

@ -6,12 +6,12 @@ import { box, Icon } from '@wordpress/icons';
export const BLOCK_TITLE: string = __(
'Product Stock Indicator',
'woo-gutenberg-products-block'
'woocommerce'
);
export const BLOCK_ICON: JSX.Element = (
<Icon icon={ box } className="wc-block-editor-components-block-icon" />
);
export const BLOCK_DESCRIPTION: string = __(
'Display product stock status.',
'woo-gutenberg-products-block'
'woocommerce'
);

View File

@ -6,12 +6,12 @@ import { page, Icon } from '@wordpress/icons';
export const BLOCK_TITLE: string = __(
'Product Summary',
'woo-gutenberg-products-block'
'woocommerce'
);
export const BLOCK_ICON: JSX.Element = (
<Icon icon={ page } className="wc-block-editor-components-block-icon" />
);
export const BLOCK_DESCRIPTION: string = __(
'Display a short description about a product.',
'woo-gutenberg-products-block'
'woocommerce'
);

View File

@ -6,12 +6,12 @@ import { heading, Icon } from '@wordpress/icons';
export const BLOCK_TITLE: string = __(
'Product Title',
'woo-gutenberg-products-block'
'woocommerce'
);
export const BLOCK_ICON: JSX.Element = (
<Icon icon={ heading } className="wc-block-editor-components-block-icon" />
);
export const BLOCK_DESCRIPTION: string = __(
'Display the title of a product.',
'woo-gutenberg-products-block'
'woocommerce'
);

View File

@ -55,13 +55,13 @@ const TitleEdit = ( { attributes, setAttributes }: Props ): JSX.Element => {
<PanelBody
title={ __(
'Link settings',
'woo-gutenberg-products-block'
'woocommerce'
) }
>
<ToggleControl
label={ __(
'Make title a link',
'woo-gutenberg-products-block'
'woocommerce'
) }
checked={ showProductLink }
onChange={ () =>
@ -75,7 +75,7 @@ const TitleEdit = ( { attributes, setAttributes }: Props ): JSX.Element => {
<ToggleControl
label={ __(
'Open in new tab',
'woo-gutenberg-products-block'
'woocommerce'
) }
onChange={ ( value ) =>
setAttributes( {
@ -102,7 +102,7 @@ const Title = isFeaturePluginBuild()
label: BLOCK_TITLE,
description: __(
'Choose a product to display its title.',
'woo-gutenberg-products-block'
'woocommerce'
),
} ),
] )( TitleEdit )

View File

@ -11,13 +11,13 @@ import type { BlockErrorProps } from './types';
const BlockError = ( {
imageUrl = `${ WC_BLOCKS_IMAGE_URL }/block-error.svg`,
header = __( 'Oops!', 'woo-gutenberg-products-block' ),
header = __( 'Oops!', 'woocommerce' ),
text = __(
'There was an error loading the content.',
'woo-gutenberg-products-block'
'woocommerce'
),
errorMessage,
errorMessagePrefix = __( 'Error:', 'woo-gutenberg-products-block' ),
errorMessagePrefix = __( 'Error:', 'woocommerce' ),
button,
showErrorBlock = true,
}: BlockErrorProps ): JSX.Element | null => {

View File

@ -30,7 +30,7 @@ const customValidationHandler = (
inputObject.setCustomValidity(
__(
'Please enter a valid postcode',
'woo-gutenberg-products-block'
'woocommerce'
)
);
return false;

View File

@ -43,7 +43,7 @@ const getSupportedCoreLocaleProps = (
if ( localeField.label !== undefined && ! localeField.optionalLabel ) {
fields.optionalLabel = sprintf(
/* translators: %s Field label. */
__( '%s (optional)', 'woo-gutenberg-products-block' ),
__( '%s (optional)', 'woocommerce' ),
localeField.label
);
}

View File

@ -25,7 +25,7 @@ const validateShippingCountry = ( values: ShippingAddress ): void => {
[ validationErrorId ]: {
message: __(
'Please select your country',
'woo-gutenberg-products-block'
'woocommerce'
),
hidden: false,
},

View File

@ -314,7 +314,7 @@ const CartLineItemRow: React.ForwardRefExoticComponent<
/* translators: %s refers to the item's name in the cart. */
__(
'Remove %s from cart',
'woo-gutenberg-products-block'
'woocommerce'
),
name
) }
@ -333,7 +333,7 @@ const CartLineItemRow: React.ForwardRefExoticComponent<
/* translators: %s refers to the item name in the cart. */
__(
'%s has been removed from your cart.',
'woo-gutenberg-products-block'
'woocommerce'
),
name
)
@ -343,7 +343,7 @@ const CartLineItemRow: React.ForwardRefExoticComponent<
>
{ __(
'Remove item',
'woo-gutenberg-products-block'
'woocommerce'
) }
</button>
) }

View File

@ -80,17 +80,17 @@ const CartLineItemsTable = ( {
<tr className="wc-block-cart-items__header">
<th className="wc-block-cart-items__header-image">
<span>
{ __( 'Product', 'woo-gutenberg-products-block' ) }
{ __( 'Product', 'woocommerce' ) }
</span>
</th>
<th className="wc-block-cart-items__header-product">
<span>
{ __( 'Details', 'woo-gutenberg-products-block' ) }
{ __( 'Details', 'woocommerce' ) }
</span>
</th>
<th className="wc-block-cart-items__header-total">
<span>
{ __( 'Total', 'woo-gutenberg-products-block' ) }
{ __( 'Total', 'woocommerce' ) }
</span>
</th>
</tr>

View File

@ -32,7 +32,7 @@ const OrderSummary = ( {
hasBorder={ false }
title={
<span className="wc-block-components-order-summary__button-text">
{ __( 'Order summary', 'woo-gutenberg-products-block' ) }
{ __( 'Order summary', 'woocommerce' ) }
</span>
}
>

View File

@ -139,7 +139,7 @@ const OrderSummaryItem = ( { cartItem }: OrderSummaryProps ): JSX.Element => {
'%d item',
'%d items',
quantity,
'woo-gutenberg-products-block'
'woocommerce'
),
quantity
) }
@ -188,7 +188,7 @@ const OrderSummaryItem = ( { cartItem }: OrderSummaryProps ): JSX.Element => {
'Total price for %1$d %2$s item: %3$s',
'Total price for %1$d %2$s items: %3$s',
quantity,
'woo-gutenberg-products-block'
'woocommerce'
),
quantity,
name,

View File

@ -60,7 +60,7 @@ const PickupLocation = (): JSX.Element | null => {
<span className="wc-block-components-shipping-address">
{ sprintf(
/* translators: %s: shipping method name, e.g. "Amazon Locker" */
__( 'Collection from %s', 'woo-gutenberg-products-block' ),
__( 'Collection from %s', 'woocommerce' ),
pickupAddress
) + ' ' }
</span>

View File

@ -29,7 +29,7 @@ const Policies = (): JSX.Element => {
? decodeEntities( PRIVACY_PAGE_NAME )
: __(
'Privacy Policy',
'woo-gutenberg-products-block'
'woocommerce'
) }
</a>
</li>
@ -45,7 +45,7 @@ const Policies = (): JSX.Element => {
? decodeEntities( TERMS_PAGE_NAME )
: __(
'Terms and Conditions',
'woo-gutenberg-products-block'
'woocommerce'
) }
</a>
</li>

View File

@ -14,7 +14,7 @@ import ProductBadge from '../product-badge';
const ProductBackorderBadge = (): JSX.Element => {
return (
<ProductBadge className="wc-block-components-product-backorder-badge">
{ __( 'Available on backorder', 'woo-gutenberg-products-block' ) }
{ __( 'Available on backorder', 'woocommerce' ) }
</ProductBadge>
);
};

View File

@ -28,7 +28,7 @@ const ProductLowStockBadge = ( {
<ProductBadge className="wc-block-components-product-low-stock-badge">
{ sprintf(
/* translators: %d stock amount (number of items in stock for product) */
__( '%d left in stock', 'woo-gutenberg-products-block' ),
__( '%d left in stock', 'woocommerce' ),
lowStockRemaining
) }
</ProductBadge>

View File

@ -41,7 +41,7 @@ const ProductSaleBadge = ( {
const formattedMessage = sprintf(
/* translators: %s will be replaced by the discount amount */
__( `Save %s`, 'woo-gutenberg-products-block' ),
__( `Save %s`, 'woocommerce' ),
format
);

View File

@ -27,7 +27,7 @@ const ReturnToCartButton = ( {
className="wc-block-components-checkout-return-to-cart-button"
>
<Icon icon={ arrowLeft } />
{ __( 'Return to Cart', 'woo-gutenberg-products-block' ) }
{ __( 'Return to Cart', 'woocommerce' ) }
</a>
);
};

View File

@ -75,7 +75,7 @@ const ShippingCalculatorAddress = ( {
} }
type="submit"
>
{ __( 'Update', 'woo-gutenberg-products-block' ) }
{ __( 'Update', 'woocommerce' ) }
</Button>
</form>
);

View File

@ -19,7 +19,7 @@ const ShippingLocation = ( {
<span className="wc-block-components-shipping-address">
{ sprintf(
/* translators: %s location. */
__( 'Shipping to %s', 'woo-gutenberg-products-block' ),
__( 'Shipping to %s', 'woocommerce' ),
formattedLocation
) + ' ' }
</span>

View File

@ -72,7 +72,7 @@ export const ShippingRatesControlPackage = ( {
'%1$s (%2$d unit)',
'%1$s (%2$d units)',
quantity,
'woo-gutenberg-products-block'
'woocommerce'
),
name,
quantity

View File

@ -111,7 +111,7 @@ const ShippingRatesControl = ( {
isLoading={ isLoadingRates }
screenReaderLabel={ __(
'Loading shipping rates…',
'woo-gutenberg-products-block'
'woocommerce'
) }
showSpinner={ true }
>
@ -127,7 +127,7 @@ const ShippingRatesControl = ( {
>
{ __(
'Multiple shipments must have the same pickup location',
'woo-gutenberg-products-block'
'woocommerce'
) }
</NoticeBanner>
) }

View File

@ -16,7 +16,7 @@ export const speakFoundShippingOptions = (
'%d shipping option was found.',
'%d shipping options were found.',
rateCount,
'woo-gutenberg-products-block'
'woocommerce'
),
rateCount
)
@ -29,7 +29,7 @@ export const speakFoundShippingOptions = (
'Shipping option searched for %d package.',
'Shipping options searched for %d packages.',
packageCount,
'woo-gutenberg-products-block'
'woocommerce'
),
packageCount
) +
@ -40,7 +40,7 @@ export const speakFoundShippingOptions = (
'%d shipping option was found',
'%d shipping options were found',
rateCount,
'woo-gutenberg-products-block'
'woocommerce'
),
rateCount
)

View File

@ -94,17 +94,17 @@ export const TotalsCoupon = ( {
className="wc-block-components-totals-coupon-link"
aria-label={ __(
'Add a coupon',
'woo-gutenberg-products-block'
'woocommerce'
) }
onClick={ handleCouponAnchorClick }
>
{ __( 'Add a coupon', 'woo-gutenberg-products-block' ) }
{ __( 'Add a coupon', 'woocommerce' ) }
</a>
) : (
<LoadingMask
screenReaderLabel={ __(
'Applying coupon…',
'woo-gutenberg-products-block'
'woocommerce'
) }
isLoading={ isLoading }
showSpinner={ false }
@ -120,7 +120,7 @@ export const TotalsCoupon = ( {
className="wc-block-components-totals-coupon__input"
label={ __(
'Enter code',
'woo-gutenberg-products-block'
'woocommerce'
) }
value={ couponValue }
ariaDescribedBy={ validationErrorId }
@ -140,7 +140,7 @@ export const TotalsCoupon = ( {
>
{ __(
'Apply',
'woo-gutenberg-products-block'
'woocommerce'
) }
</Button>
</form>

View File

@ -76,7 +76,7 @@ const TotalsDiscount = ( {
<LoadingMask
screenReaderLabel={ __(
'Removing coupon…',
'woo-gutenberg-products-block'
'woocommerce'
) }
isLoading={ isRemovingCoupon }
showSpinner={ false }
@ -92,7 +92,7 @@ const TotalsDiscount = ( {
/* translators: %s Coupon code. */
__(
'Coupon: %s',
'woo-gutenberg-products-block'
'woocommerce'
),
cartCoupon.label
) }
@ -105,7 +105,7 @@ const TotalsDiscount = ( {
/* translators: %s is a coupon code. */
__(
'Remove coupon "%s"',
'woo-gutenberg-products-block'
'woocommerce'
),
cartCoupon.label
) }
@ -118,8 +118,8 @@ const TotalsDiscount = ( {
}
label={
!! discountTotalValue
? __( 'Discount', 'woo-gutenberg-products-block' )
: __( 'Coupons', 'woo-gutenberg-products-block' )
? __( 'Discount', 'woocommerce' )
: __( 'Coupons', 'woocommerce' )
}
value={ discountTotalValue ? discountTotalValue * -1 : '-' }
/>

View File

@ -66,7 +66,7 @@ const TotalsFooterItem = ( {
const { receiveCart, ...cart } = useStoreCart();
const label = applyCheckoutFilter( {
filterName: 'totalLabel',
defaultValue: __( 'Total', 'woo-gutenberg-products-block' ),
defaultValue: __( 'Total', 'woocommerce' ),
extensions: cart.extensions,
arg: { cart },
} );
@ -76,7 +76,7 @@ const TotalsFooterItem = ( {
taxLines && taxLines.length > 0
? sprintf(
/* translators: %s is a list of tax rates */
__( 'Including %s', 'woo-gutenberg-products-block' ),
__( 'Including %s', 'woocommerce' ),
taxLines
.map( ( { name, price } ) => {
return `${ formatPrice(
@ -88,7 +88,7 @@ const TotalsFooterItem = ( {
)
: __(
'Including <TaxAmount/> in taxes',
'woo-gutenberg-products-block'
'woocommerce'
);
return (

View File

@ -10,7 +10,7 @@ export interface CalculatorButtonProps {
}
export const CalculatorButton = ( {
label = __( 'Calculate', 'woo-gutenberg-products-block' ),
label = __( 'Calculate', 'woocommerce' ),
isShippingCalculatorOpen,
setIsShippingCalculatorOpen,
}: CalculatorButtonProps ): JSX.Element => {

View File

@ -93,7 +93,7 @@ export const TotalsShipping = ( {
) }
>
<TotalsItem
label={ __( 'Shipping', 'woo-gutenberg-products-block' ) }
label={ __( 'Shipping', 'woocommerce' ) }
value={
! shippingMethodsMissing && cartHasCalculatedShipping
? // if address is not complete, display the link to add an address.

View File

@ -53,7 +53,7 @@ export const ShippingAddress = ( {
<CalculatorButton
label={ __(
'Change address',
'woo-gutenberg-products-block'
'woocommerce'
) }
isShippingCalculatorOpen={ isShippingCalculatorOpen }
setIsShippingCalculatorOpen={ setIsShippingCalculatorOpen }

View File

@ -27,11 +27,11 @@ export const ShippingPlaceholder = ( {
{ isCheckout
? __(
'No shipping options available',
'woo-gutenberg-products-block'
'woocommerce'
)
: __(
'Calculated during checkout',
'woo-gutenberg-products-block'
'woocommerce'
) }
</em>
);
@ -41,7 +41,7 @@ export const ShippingPlaceholder = ( {
<CalculatorButton
label={ __(
'Add an address for shipping options',
'woo-gutenberg-products-block'
'woocommerce'
) }
isShippingCalculatorOpen={ isShippingCalculatorOpen }
setIsShippingCalculatorOpen={ setIsShippingCalculatorOpen }

View File

@ -24,8 +24,8 @@ export const ShippingRateSelector = ( {
isAddressComplete,
}: ShippingRateSelectorProps ): JSX.Element => {
const legend = hasRates
? __( 'Shipping options', 'woo-gutenberg-products-block' )
: __( 'Choose a shipping option', 'woo-gutenberg-products-block' );
? __( 'Shipping options', 'woocommerce' )
: __( 'Choose a shipping option', 'woocommerce' );
return (
<fieldset className="wc-block-components-totals-shipping__fieldset">
<legend className="screen-reader-text">{ legend }</legend>
@ -41,7 +41,7 @@ export const ShippingRateSelector = ( {
>
{ __(
'There are no shipping options available. Please check your shipping address.',
'woo-gutenberg-products-block'
'woocommerce'
) }
</NoticeBanner>
) }

View File

@ -48,7 +48,7 @@ const Combobox = ( {
required = false,
errorMessage = __(
'Please select a value.',
'woo-gutenberg-products-block'
'woocommerce'
),
errorId: incomingErrorId,
instanceId = '0',

View File

@ -25,7 +25,7 @@ export const CountryInput = ( {
errorId,
errorMessage = __(
'Please select a country',
'woo-gutenberg-products-block'
'woocommerce'
),
}: CountryInputWithCountriesProps ): JSX.Element => {
const options = useMemo(

View File

@ -58,7 +58,7 @@ const CloseButtonPortal = ( {
className="wc-block-components-drawer__close"
icon={ close }
onClick={ onClick }
label={ __( 'Close', 'woo-gutenberg-products-block' ) }
label={ __( 'Close', 'woocommerce' ) }
showTooltip={ false }
/>,
closeButtonWrapper

View File

@ -36,7 +36,7 @@ const FilterElementLabel = ( {
'%s product',
'%s products',
count,
'woo-gutenberg-products-block'
'woocommerce'
),
count
) }

View File

@ -20,9 +20,9 @@ interface FilterResetButtonProps {
const FilterResetButton = ( {
className,
/* translators: Reset button text for filters. */
label = __( 'Reset', 'woo-gutenberg-products-block' ),
label = __( 'Reset', 'woocommerce' ),
onClick,
screenReaderLabel = __( 'Reset filter', 'woo-gutenberg-products-block' ),
screenReaderLabel = __( 'Reset filter', 'woocommerce' ),
}: FilterResetButtonProps ): JSX.Element => {
return (
<button

View File

@ -24,9 +24,9 @@ const FilterSubmitButton = ( {
isLoading,
disabled,
/* translators: Submit button text for filters. */
label = __( 'Apply', 'woo-gutenberg-products-block' ),
label = __( 'Apply', 'woocommerce' ),
onClick,
screenReaderLabel = __( 'Apply filter', 'woo-gutenberg-products-block' ),
screenReaderLabel = __( 'Apply filter', 'woocommerce' ),
}: FilterSubmitButtonProps ): JSX.Element => {
return (
<button

View File

@ -18,8 +18,8 @@ interface LoadMoreButtonProps {
export const LoadMoreButton = ( {
onClick,
label = __( 'Load more', 'woo-gutenberg-products-block' ),
screenReaderLabel = __( 'Load more', 'woo-gutenberg-products-block' ),
label = __( 'Load more', 'woocommerce' ),
screenReaderLabel = __( 'Load more', 'woocommerce' ),
}: LoadMoreButtonProps ): JSX.Element => {
return (
<div className="wp-block-button wc-block-load-more wc-block-components-load-more">

View File

@ -43,7 +43,7 @@ const LoadingMask = ( {
{ isLoading && (
<span className="screen-reader-text">
{ screenReaderLabel ||
__( 'Loading…', 'woo-gutenberg-products-block' ) }
__( 'Loading…', 'woocommerce' ) }
</span>
) }
</div>

View File

@ -77,7 +77,7 @@ const NoticeBanner = ( {
icon={ close }
label={ __(
'Dismiss this notice',
'woo-gutenberg-products-block'
'woocommerce'
) }
onClick={ dismiss }
showTooltip={ false }

View File

@ -83,7 +83,7 @@ const Pagination = ( {
<Label
screenReaderLabel={ __(
'Navigate to another page',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
{ displayNextAndPreviousArrows && (
@ -92,7 +92,7 @@ const Pagination = ( {
onClick={ () => onPageChange( currentPage - 1 ) }
title={ __(
'Previous page',
'woo-gutenberg-products-block'
'woocommerce'
) }
disabled={ currentPage <= 1 }
>
@ -100,7 +100,7 @@ const Pagination = ( {
label="&larr;"
screenReaderLabel={ __(
'Previous page',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
</button>
@ -124,7 +124,7 @@ const Pagination = ( {
label={ '1' }
screenReaderLabel={ sprintf(
/* translators: %d is the page number (1, 2, 3...). */
__( 'Page %d', 'woo-gutenberg-products-block' ),
__( 'Page %d', 'woocommerce' ),
1
) }
/>
@ -135,7 +135,7 @@ const Pagination = ( {
className="wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis"
aria-hidden="true"
>
{ __( '…', 'woo-gutenberg-products-block' ) }
{ __( '…', 'woocommerce' ) }
</span>
) }
{ pages.map( ( page ) => {
@ -163,7 +163,7 @@ const Pagination = ( {
label={ page.toString() }
screenReaderLabel={ sprintf(
/* translators: %d is the page number (1, 2, 3...). */
__( 'Page %d', 'woo-gutenberg-products-block' ),
__( 'Page %d', 'woocommerce' ),
page
) }
/>
@ -175,7 +175,7 @@ const Pagination = ( {
className="wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis"
aria-hidden="true"
>
{ __( '…', 'woo-gutenberg-products-block' ) }
{ __( '…', 'woocommerce' ) }
</span>
) }
{ showLastPage && (
@ -197,7 +197,7 @@ const Pagination = ( {
label={ totalPages.toString() }
screenReaderLabel={ sprintf(
/* translators: %d is the page number (1, 2, 3...). */
__( 'Page %d', 'woo-gutenberg-products-block' ),
__( 'Page %d', 'woocommerce' ),
totalPages
) }
/>
@ -207,14 +207,14 @@ const Pagination = ( {
<button
className="wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow"
onClick={ () => onPageChange( currentPage + 1 ) }
title={ __( 'Next page', 'woo-gutenberg-products-block' ) }
title={ __( 'Next page', 'woocommerce' ) }
disabled={ currentPage >= totalPages }
>
<Label
label="&rarr;"
screenReaderLabel={ __(
'Next page',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
</button>

View File

@ -351,7 +351,7 @@ const PriceSlider = ( {
className="wc-block-price-filter__range-input wc-block-price-filter__range-input--min wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--min"
aria-label={ __(
'Filter products by minimum price',
'woo-gutenberg-products-block'
'woocommerce'
) }
aria-valuetext={ ariaReadableMinPrice }
value={
@ -372,7 +372,7 @@ const PriceSlider = ( {
className="wc-block-price-filter__range-input wc-block-price-filter__range-input--max wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--max"
aria-label={ __(
'Filter products by maximum price',
'woo-gutenberg-products-block'
'woocommerce'
) }
aria-valuetext={ ariaReadableMaxPrice }
value={
@ -420,7 +420,7 @@ const PriceSlider = ( {
className={ getInputClassName( 'min' ) }
aria-label={ __(
'Filter products by minimum price',
'woo-gutenberg-products-block'
'woocommerce'
) }
isAllowed={ isValidMinValue( {
minConstraint,
@ -445,7 +445,7 @@ const PriceSlider = ( {
className={ getInputClassName( 'max' ) }
aria-label={ __(
'Filter products by maximum price',
'woo-gutenberg-products-block'
'woocommerce'
) }
isAllowed={ isValidMaxValue( {
maxConstraint,
@ -493,7 +493,7 @@ const PriceSlider = ( {
} }
screenReaderLabel={ __(
'Reset price filter',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
) }
@ -505,7 +505,7 @@ const PriceSlider = ( {
onClick={ onSubmit }
screenReaderLabel={ __(
'Apply price filter',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
) }

View File

@ -22,16 +22,16 @@ const NoMatchingProducts = ( {
size={ 100 }
/>
<strong className={ `${ parentClassName }__no-products-title` }>
{ __( 'No products found', 'woo-gutenberg-products-block' ) }
{ __( 'No products found', 'woocommerce' ) }
</strong>
<p className={ `${ parentClassName }__no-products-description` }>
{ __(
'We were unable to find any results based on your search.',
'woo-gutenberg-products-block'
'woocommerce'
) }
</p>
<button onClick={ resetCallback }>
{ __( 'Reset Search', 'woo-gutenberg-products-block' ) }
{ __( 'Reset Search', 'woocommerce' ) }
</button>
</div>
);

View File

@ -15,12 +15,12 @@ const NoProducts = (): JSX.Element => {
size={ 100 }
/>
<strong className={ `${ parentClassName }__no-products-title` }>
{ __( 'No products', 'woo-gutenberg-products-block' ) }
{ __( 'No products', 'woocommerce' ) }
</strong>
<p className={ `${ parentClassName }__no-products-description` }>
{ __(
'There are currently no products available to display.',
'woo-gutenberg-products-block'
'woocommerce'
) }
</p>
</div>

View File

@ -93,7 +93,7 @@ const announceLoadingCompletion = ( totalProducts: number ): void => {
}
if ( totalProducts === 0 ) {
speak( __( 'No products found', 'woo-gutenberg-products-block' ) );
speak( __( 'No products found', 'woocommerce' ) );
} else {
speak(
sprintf(
@ -102,7 +102,7 @@ const announceLoadingCompletion = ( totalProducts: number ): void => {
'%d product found',
'%d products found',
totalProducts,
'woo-gutenberg-products-block'
'woocommerce'
),
totalProducts
)

View File

@ -23,42 +23,42 @@ const ProductSortSelect = ( {
key: 'menu_order',
label: __(
'Default sorting',
'woo-gutenberg-products-block'
'woocommerce'
),
},
{
key: 'popularity',
label: __( 'Popularity', 'woo-gutenberg-products-block' ),
label: __( 'Popularity', 'woocommerce' ),
},
{
key: 'rating',
label: __(
'Average rating',
'woo-gutenberg-products-block'
'woocommerce'
),
},
{
key: 'date',
label: __( 'Latest', 'woo-gutenberg-products-block' ),
label: __( 'Latest', 'woocommerce' ),
},
{
key: 'price',
label: __(
'Price: low to high',
'woo-gutenberg-products-block'
'woocommerce'
),
},
{
key: 'price-desc',
label: __(
'Price: high to low',
'woo-gutenberg-products-block'
'woocommerce'
),
},
] }
screenReaderLabel={ __(
'Order products by',
'woo-gutenberg-products-block'
'woocommerce'
) }
value={ value }
/>

View File

@ -54,7 +54,7 @@ const PriceRange = ( {
/* translators: %1$s min price, %2$s max price */
__(
'Price between %1$s and %2$s',
'woo-gutenberg-products-block'
'woocommerce'
),
formatPrice( minPrice ),
formatPrice( maxPrice )
@ -136,7 +136,7 @@ const SalePrice = ( {
return (
<>
<span className="screen-reader-text">
{ __( 'Previous price:', 'woo-gutenberg-products-block' ) }
{ __( 'Previous price:', 'woocommerce' ) }
</span>
<FormattedMonetaryAmount
currency={ currency }
@ -154,7 +154,7 @@ const SalePrice = ( {
value={ regularPrice }
/>
<span className="screen-reader-text">
{ __( 'Discounted price:', 'woo-gutenberg-products-block' ) }
{ __( 'Discounted price:', 'woocommerce' ) }
</span>
<FormattedMonetaryAmount
currency={ currency }

View File

@ -25,14 +25,14 @@ const Rating = ( {
const ratingText = sprintf(
/* translators: %f is referring to the average rating value */
__( 'Rated %f out of 5', 'woo-gutenberg-products-block' ),
__( 'Rated %f out of 5', 'woocommerce' ),
rating
);
const ratingHTML = {
__html: sprintf(
/* translators: %s is the rating value wrapped in HTML strong tags. */
__( 'Rated %s out of 5', 'woo-gutenberg-products-block' ),
__( 'Rated %s out of 5', 'woocommerce' ),
sprintf( '<strong class="rating">%f</strong>', rating )
),
};

View File

@ -185,7 +185,7 @@ const QuantitySelector = ( {
/* translators: %s refers to the item name in the cart. */
__(
'Quantity of %s in your cart.',
'woo-gutenberg-products-block'
'woocommerce'
),
itemName
) }
@ -196,7 +196,7 @@ const QuantitySelector = ( {
/* translators: %s refers to the item name in the cart. */
__(
'Reduce quantity of %s',
'woo-gutenberg-products-block'
'woocommerce'
),
itemName
) }
@ -210,7 +210,7 @@ const QuantitySelector = ( {
/* translators: %s refers to the item's new quantity in the cart. */
__(
'Quantity reduced to %s.',
'woo-gutenberg-products-block'
'woocommerce'
),
newQuantity
)
@ -226,7 +226,7 @@ const QuantitySelector = ( {
/* translators: %s refers to the item's name in the cart. */
__(
'Increase quantity of %s',
'woo-gutenberg-products-block'
'woocommerce'
),
itemName
) }
@ -240,7 +240,7 @@ const QuantitySelector = ( {
/* translators: %s refers to the item's new quantity in the cart. */
__(
'Quantity increased to %s.',
'woo-gutenberg-products-block'
'woocommerce'
),
newQuantity
)

View File

@ -67,9 +67,9 @@ interface ReadMoreState {
export const defaultProps = {
className: 'read-more-content',
ellipsis: '&hellip;',
lessText: __( 'Read less', 'woo-gutenberg-products-block' ),
lessText: __( 'Read less', 'woocommerce' ),
maxLines: 3,
moreText: __( 'Read more', 'woo-gutenberg-products-block' ),
moreText: __( 'Read more', 'woocommerce' ),
};
/**

View File

@ -46,10 +46,10 @@ function getReviewImage(
className="wc-block-review-list-item__verified wc-block-components-review-list-item__verified"
title={ __(
'Verified buyer',
'woo-gutenberg-products-block'
'woocommerce'
) }
>
{ __( 'Verified buyer', 'woo-gutenberg-products-block' ) }
{ __( 'Verified buyer', 'woocommerce' ) }
</div>
) }
</div>
@ -62,11 +62,11 @@ function getReviewContent( review: Review ): JSX.Element {
maxLines={ 10 }
moreText={ __(
'Read full review',
'woo-gutenberg-products-block'
'woocommerce'
) }
lessText={ __(
'Hide full review',
'woo-gutenberg-products-block'
'woocommerce'
) }
className="wc-block-review-list-item__text wc-block-components-review-list-item__text"
>
@ -129,13 +129,13 @@ function getReviewRating( review: Review ): JSX.Element {
};
const ratingText = sprintf(
/* translators: %f is referring to the average rating value */
__( 'Rated %f out of 5', 'woo-gutenberg-products-block' ),
__( 'Rated %f out of 5', 'woocommerce' ),
rating
);
const ratingHTML = {
__html: sprintf(
/* translators: %s is referring to the average rating value */
__( 'Rated %s out of 5', 'woo-gutenberg-products-block' ),
__( 'Rated %s out of 5', 'woocommerce' ),
sprintf( '<strong class="rating">%f</strong>', rating )
),
};

View File

@ -24,32 +24,32 @@ const ReviewSortSelect = ( {
return (
<SortSelect
className="wc-block-review-sort-select wc-block-components-review-sort-select"
label={ __( 'Order by', 'woo-gutenberg-products-block' ) }
label={ __( 'Order by', 'woocommerce' ) }
onChange={ onChange }
options={ [
{
key: 'most-recent',
label: __( 'Most recent', 'woo-gutenberg-products-block' ),
label: __( 'Most recent', 'woocommerce' ),
},
{
key: 'highest-rating',
label: __(
'Highest rating',
'woo-gutenberg-products-block'
'woocommerce'
),
},
{
key: 'lowest-rating',
label: __(
'Lowest rating',
'woo-gutenberg-products-block'
'woocommerce'
),
},
] }
readOnly={ readOnly }
screenReaderLabel={ __(
'Order reviews by',
'woo-gutenberg-products-block'
'woocommerce'
) }
value={ value }
/>

View File

@ -103,7 +103,7 @@ const StateInput = ( {
value={ value }
errorMessage={ __(
'Please select a state.',
'woo-gutenberg-products-block'
'woocommerce'
) }
errorId={ errorId }
required={ required }

View File

@ -59,7 +59,7 @@ export const __TabsWithoutInstanceId = ( {
tabs,
activeClass = 'is-active',
initialTabName,
ariaLabel = __( 'Tabbed Content', 'woo-gutenberg-products-block' ),
ariaLabel = __( 'Tabbed Content', 'woocommerce' ),
instanceId,
id,
}: TabsProps ): JSX.Element | null => {

View File

@ -58,7 +58,7 @@ export const useStoreCartCoupons = ( context = '' ): StoreCartCoupon => {
/* translators: %s coupon code. */
__(
'Coupon code "%s" has been applied to your cart.',
'woo-gutenberg-products-block'
'woocommerce'
),
couponCode
),
@ -98,7 +98,7 @@ export const useStoreCartCoupons = ( context = '' ): StoreCartCoupon => {
/* translators: %s coupon code. */
__(
'Coupon code "%s" has been removed from your cart.',
'woo-gutenberg-products-block'
'woocommerce'
),
couponCode
),

View File

@ -142,7 +142,7 @@ export const usePaymentMethodInterface = (): PaymentMethodInterface => {
prepareTotalItems( cartTotals, needsShipping )
);
const currentCartTotal = useRef( {
label: __( 'Total', 'woo-gutenberg-products-block' ),
label: __( 'Total', 'woocommerce' ),
value: parseInt( cartTotals.total_price, 10 ),
} );
@ -152,7 +152,7 @@ export const usePaymentMethodInterface = (): PaymentMethodInterface => {
needsShipping
);
currentCartTotal.current = {
label: __( 'Total', 'woo-gutenberg-products-block' ),
label: __( 'Total', 'woocommerce' ),
value: parseInt( cartTotals.total_price, 10 ),
};
}, [ cartTotals, needsShipping ] );

View File

@ -49,25 +49,25 @@ export const prepareTotalItems = (
newTotals.push(
factory(
__( 'Subtotal:', 'woo-gutenberg-products-block' ),
__( 'Subtotal:', 'woocommerce' ),
'total_items'
)
);
newTotals.push(
factory( __( 'Fees:', 'woo-gutenberg-products-block' ), 'total_fees' )
factory( __( 'Fees:', 'woocommerce' ), 'total_fees' )
);
newTotals.push(
factory(
__( 'Discount:', 'woo-gutenberg-products-block' ),
__( 'Discount:', 'woocommerce' ),
'total_discount'
)
);
newTotals.push( {
key: 'total_tax',
label: __( 'Taxes:', 'woo-gutenberg-products-block' ),
label: __( 'Taxes:', 'woocommerce' ),
value: parseInt( totals.total_tax, 10 ),
valueWithTax: parseInt( totals.total_tax, 10 ),
} );
@ -75,7 +75,7 @@ export const prepareTotalItems = (
if ( needsShipping ) {
newTotals.push(
factory(
__( 'Shipping:', 'woo-gutenberg-products-block' ),
__( 'Shipping:', 'woocommerce' ),
'total_shipping'
)
);

View File

@ -79,7 +79,7 @@ export const useShowShippingTotalWarning = () => {
createInfoNotice(
__(
'Totals will be recalculated when a valid shipping method is selected.',
'woo-gutenberg-products-block'
'woocommerce'
),
{
id: 'wc-blocks-totals-shipping-warning',

View File

@ -171,7 +171,7 @@ const CheckoutProcessor = () => {
return {
errorMessage: __(
'Sorry, this order requires a shipping option.',
'woo-gutenberg-products-block'
'woocommerce'
),
};
}
@ -181,7 +181,7 @@ const CheckoutProcessor = () => {
return {
errorMessage: __(
'There was a problem with your payment option.',
'woo-gutenberg-products-block'
'woocommerce'
),
context: 'wc/checkout/payments',
};
@ -190,7 +190,7 @@ const CheckoutProcessor = () => {
return {
errorMessage: __(
'There was a problem with your shipping option.',
'woo-gutenberg-products-block'
'woocommerce'
),
context: 'wc/checkout/shipping-methods',
};
@ -297,13 +297,13 @@ const CheckoutProcessor = () => {
} catch {
let errorMessage = __(
'Something went wrong when placing the order. Check your email for order updates before retrying.',
'woo-gutenberg-products-block'
'woocommerce'
);
if ( customerId !== 0 ) {
errorMessage = __(
"Something went wrong when placing the order. Check your account's order history or your email for order updates before retrying.",
'woo-gutenberg-products-block'
'woocommerce'
);
}
processErrorResponse( {

View File

@ -12,7 +12,7 @@ import { noticeContexts } from '../context/event-emit/utils';
export const DEFAULT_ERROR_MESSAGE = __(
'Something went wrong. Please contact us to get assistance.',
'woo-gutenberg-products-block'
'woocommerce'
);
/**

View File

@ -99,7 +99,7 @@ const ActiveAttributeFilters = ( {
if ( index > 0 && operator === 'and' ) {
prefix = (
<span className="wc-block-active-filters__list-item-operator">
{ __( 'All', 'woo-gutenberg-products-block' ) }
{ __( 'All', 'woocommerce' ) }
</span>
);
}

View File

@ -6,6 +6,6 @@ import { __ } from '@wordpress/i18n';
export const blockAttributes = {
heading: {
type: 'string',
default: __( 'Active filters', 'woo-gutenberg-products-block' ),
default: __( 'Active filters', 'woocommerce' ),
},
};

View File

@ -98,7 +98,7 @@ const ActiveFiltersBlock = ( {
const stockStatusLabel = __(
'Stock Status',
'woo-gutenberg-products-block'
'woocommerce'
);
return (
@ -149,7 +149,7 @@ const ActiveFiltersBlock = ( {
return null;
}
return renderRemovableListItem( {
type: __( 'Price', 'woo-gutenberg-products-block' ),
type: __( 'Price', 'woocommerce' ),
name: formatPriceRange( minPrice, maxPrice ),
removeCallback: () => {
removeArgsFromFilterUrl( 'max_price', 'min_price' );
@ -245,7 +245,7 @@ const ActiveFiltersBlock = ( {
return null;
}
const ratingLabel = __( 'Rating', 'woo-gutenberg-products-block' );
const ratingLabel = __( 'Rating', 'woocommerce' );
return (
<li>
@ -260,7 +260,7 @@ const ActiveFiltersBlock = ( {
/* translators: %s is referring to the average rating value */
__(
'Rated %s out of 5',
'woo-gutenberg-products-block'
'woocommerce'
),
slug
),
@ -351,22 +351,22 @@ const ActiveFiltersBlock = ( {
{ renderRemovableListItem( {
type: __(
'Size',
'woo-gutenberg-products-block'
'woocommerce'
),
name: __(
'Small',
'woo-gutenberg-products-block'
'woocommerce'
),
displayStyle: blockAttributes.displayStyle,
} ) }
{ renderRemovableListItem( {
type: __(
'Color',
'woo-gutenberg-products-block'
'woocommerce'
),
name: __(
'Blue',
'woo-gutenberg-products-block'
'woocommerce'
),
displayStyle: blockAttributes.displayStyle,
} ) }
@ -403,11 +403,11 @@ const ActiveFiltersBlock = ( {
<Label
label={ __(
'Clear All',
'woo-gutenberg-products-block'
'woocommerce'
) }
screenReaderLabel={ __(
'Clear All Filters',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
</button>

View File

@ -40,13 +40,13 @@ const Edit = ( {
<PanelBody
title={ __(
'Display Settings',
'woo-gutenberg-products-block'
'woocommerce'
) }
>
<ToggleGroupControl
label={ __(
'Display Style',
'woo-gutenberg-products-block'
'woocommerce'
) }
value={ displayStyle }
onChange={ ( value: Attributes[ 'displayStyle' ] ) =>
@ -60,14 +60,14 @@ const Edit = ( {
value="list"
label={ __(
'List',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
<ToggleGroupControlOption
value="chips"
label={ __(
'Chips',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
</ToggleGroupControl>

View File

@ -24,7 +24,7 @@ export const formatPriceRange = ( minPrice: number, maxPrice: number ) => {
if ( Number.isFinite( minPrice ) && Number.isFinite( maxPrice ) ) {
return sprintf(
/* translators: %1$s min price, %2$s max price */
__( 'Between %1$s and %2$s', 'woo-gutenberg-products-block' ),
__( 'Between %1$s and %2$s', 'woocommerce' ),
formatPrice( minPrice ),
formatPrice( maxPrice )
);
@ -33,14 +33,14 @@ export const formatPriceRange = ( minPrice: number, maxPrice: number ) => {
if ( Number.isFinite( minPrice ) ) {
return sprintf(
/* translators: %s min price */
__( 'From %s', 'woo-gutenberg-products-block' ),
__( 'From %s', 'woocommerce' ),
formatPrice( minPrice )
);
}
return sprintf(
/* translators: %s max price */
__( 'Up to %s', 'woo-gutenberg-products-block' ),
__( 'Up to %s', 'woocommerce' ),
formatPrice( maxPrice )
);
};
@ -86,7 +86,7 @@ export const renderRemovableListItem = ( {
);
const removeText = sprintf(
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
__( 'Remove %s filter', 'woo-gutenberg-products-block' ),
__( 'Remove %s filter', 'woocommerce' ),
name
);

View File

@ -6,6 +6,6 @@ import { __ } from '@wordpress/i18n';
export const blockAttributes = {
heading: {
type: 'string',
default: __( 'Filter by attribute', 'woo-gutenberg-products-block' ),
default: __( 'Filter by attribute', 'woocommerce' ),
},
};

View File

@ -557,7 +557,7 @@ const AttributeFilterBlock = ( {
/* translators: %s attribute name. */
__(
'Select %s',
'woo-gutenberg-products-block'
'woocommerce'
),
attributeObject.label
) }
@ -611,7 +611,7 @@ const AttributeFilterBlock = ( {
/* translators: %s is the attribute label. */
__(
'%s filter added.',
'woo-gutenberg-products-block'
'woocommerce'
),
attributeObject.label
),
@ -619,7 +619,7 @@ const AttributeFilterBlock = ( {
/* translators: %s is the attribute label. */
__(
'%s filter removed.',
'woo-gutenberg-products-block'
'woocommerce'
),
attributeObject.label
),
@ -627,7 +627,7 @@ const AttributeFilterBlock = ( {
/* translators: %s is the attribute label. */
__(
'Remove %s filter.',
'woo-gutenberg-products-block'
'woocommerce'
),
attributeObject.label.toLocaleLowerCase()
),
@ -635,7 +635,7 @@ const AttributeFilterBlock = ( {
/* translators: %s is the attribute label. */
__(
'Invalid %s filter.',
'woo-gutenberg-products-block'
'woocommerce'
),
attributeObject.label.toLocaleLowerCase()
),
@ -668,7 +668,7 @@ const AttributeFilterBlock = ( {
} }
screenReaderLabel={ __(
'Reset attribute filter',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
) }

View File

@ -44,11 +44,11 @@ const ATTRIBUTES = getSetting< AttributeSetting[] >( 'attributes', [] );
const noticeContent = {
noAttributes: __(
'Please select an attribute to use this filter!',
'woo-gutenberg-products-block'
'woocommerce'
),
noProducts: __(
'There are no products with the selected attributes.',
'woo-gutenberg-products-block'
'woocommerce'
),
};
@ -92,7 +92,7 @@ const Edit = ( {
controls={ [
{
icon: 'edit',
title: __( 'Edit', 'woo-gutenberg-products-block' ),
title: __( 'Edit', 'woocommerce' ),
onClick: () => setIsEditing( ! isEditing ),
isActive: isEditing,
},
@ -129,16 +129,16 @@ const Edit = ( {
const messages = {
clear: __(
'Clear selected attribute',
'woo-gutenberg-products-block'
'woocommerce'
),
list: __( 'Product Attributes', 'woo-gutenberg-products-block' ),
list: __( 'Product Attributes', 'woocommerce' ),
noItems: __(
"Your store doesn't have any product attributes.",
'woo-gutenberg-products-block'
'woocommerce'
),
search: __(
'Search for a product attribute:',
'woo-gutenberg-products-block'
'woocommerce'
),
selected: ( n: number ) =>
sprintf(
@ -147,13 +147,13 @@ const Edit = ( {
'%d attribute selected',
'%d attributes selected',
n,
'woo-gutenberg-products-block'
'woocommerce'
),
n
),
updated: __(
'Product attribute search results updated.',
'woo-gutenberg-products-block'
'woocommerce'
),
};
@ -185,13 +185,13 @@ const Edit = ( {
<PanelBody
title={ __(
'Display Settings',
'woo-gutenberg-products-block'
'woocommerce'
) }
>
<ToggleControl
label={ __(
'Display product count',
'woo-gutenberg-products-block'
'woocommerce'
) }
checked={ showCounts }
onChange={ () =>
@ -203,7 +203,7 @@ const Edit = ( {
<ToggleGroupControl
label={ __(
'Allow selecting multiple options?',
'woo-gutenberg-products-block'
'woocommerce'
) }
value={ selectType || 'multiple' }
onChange={ ( value: string ) =>
@ -217,14 +217,14 @@ const Edit = ( {
value="multiple"
label={ __(
'Multiple',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
<ToggleGroupControlOption
value="single"
label={ __(
'Single',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
</ToggleGroupControl>
@ -232,17 +232,17 @@ const Edit = ( {
<ToggleGroupControl
label={ __(
'Filter Conditions',
'woo-gutenberg-products-block'
'woocommerce'
) }
help={
queryType === 'and'
? __(
'Choose to return filter results for all of the attributes selected.',
'woo-gutenberg-products-block'
'woocommerce'
)
: __(
'Choose to return filter results for any of the attributes selected.',
'woo-gutenberg-products-block'
'woocommerce'
)
}
value={ queryType }
@ -257,14 +257,14 @@ const Edit = ( {
value="and"
label={ __(
'All',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
<ToggleGroupControlOption
value="or"
label={ __(
'Any',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
</ToggleGroupControl>
@ -272,7 +272,7 @@ const Edit = ( {
<ToggleGroupControl
label={ __(
'Display Style',
'woo-gutenberg-products-block'
'woocommerce'
) }
value={ displayStyle }
onChange={ ( value: string ) =>
@ -286,25 +286,25 @@ const Edit = ( {
value="list"
label={ __(
'List',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
<ToggleGroupControlOption
value="dropdown"
label={ __(
'Dropdown',
'woo-gutenberg-products-block'
'woocommerce'
) }
/>
</ToggleGroupControl>
<ToggleControl
label={ __(
"Show 'Apply filters' button",
'woo-gutenberg-products-block'
'woocommerce'
) }
help={ __(
'Products will update when the button is clicked.',
'woo-gutenberg-products-block'
'woocommerce'
) }
checked={ showFilterButton }
onChange={ ( value ) =>
@ -317,7 +317,7 @@ const Edit = ( {
<PanelBody
title={ __(
'Content Settings',
'woo-gutenberg-products-block'
'woocommerce'
) }
initialOpen={ false }
>
@ -333,17 +333,17 @@ const Edit = ( {
icon={ <Icon icon={ category } /> }
label={ __(
'Filter by Attribute',
'woo-gutenberg-products-block'
'woocommerce'
) }
instructions={ __(
'Display a list of filters based on the selected attributes.',
'woo-gutenberg-products-block'
'woocommerce'
) }
>
<p>
{ __(
"Attributes are needed for filtering your products. You haven't created any attributes yet.",
'woo-gutenberg-products-block'
'woocommerce'
) }
</p>
<Button
@ -354,7 +354,7 @@ const Edit = ( {
) }
target="_top"
>
{ __( 'Add new attribute', 'woo-gutenberg-products-block' ) +
{ __( 'Add new attribute', 'woocommerce' ) +
' ' }
<Icon icon={ external } />
</Button>
@ -364,7 +364,7 @@ const Edit = ( {
href="https://docs.woocommerce.com/document/managing-product-taxonomies/"
target="_blank"
>
{ __( 'Learn more', 'woo-gutenberg-products-block' ) }
{ __( 'Learn more', 'woocommerce' ) }
</Button>
</Placeholder>
);
@ -374,7 +374,7 @@ const Edit = ( {
debouncedSpeak(
__(
'Now displaying a preview of the Filter Products by Attribute block.',
'woo-gutenberg-products-block'
'woocommerce'
)
);
};
@ -386,19 +386,19 @@ const Edit = ( {
icon={ <Icon icon={ category } /> }
label={ __(
'Filter by Attribute',
'woo-gutenberg-products-block'
'woocommerce'
) }
>
<div className="wc-block-attribute-filter__instructions">
{ __(
'Display a list of filters based on the selected attributes.',
'woo-gutenberg-products-block'
'woocommerce'
) }
</div>
<div className="wc-block-attribute-filter__selection">
{ renderAttributeControl( { isCompact: false } ) }
<Button variant="primary" onClick={ onDone }>
{ __( 'Done', 'woo-gutenberg-products-block' ) }
{ __( 'Done', 'woocommerce' ) }
</Button>
</div>
</Placeholder>

Some files were not shown because too many files have changed in this diff Show More