diff --git a/plugins/woocommerce-admin/client/components/search/index.js b/plugins/woocommerce-admin/client/components/search/index.js index dd5d8a06ca7..72534a00ee5 100644 --- a/plugins/woocommerce-admin/client/components/search/index.js +++ b/plugins/woocommerce-admin/client/components/search/index.js @@ -95,7 +95,6 @@ class Search extends Component { id={ item.id } label={ item.label } remove={ this.removeResult } - removeLabel={ __( 'Remove product', 'wc-admin' ) } screenReaderLabel={ screenReaderLabel } /> ); diff --git a/plugins/woocommerce-admin/client/components/tag/index.js b/plugins/woocommerce-admin/client/components/tag/index.js index c5b424552f0..7dcc8081416 100644 --- a/plugins/woocommerce-admin/client/components/tag/index.js +++ b/plugins/woocommerce-admin/client/components/tag/index.js @@ -2,7 +2,7 @@ /** * External dependencies */ -import { __ } from '@wordpress/i18n'; +import { __, sprintf } from '@wordpress/i18n'; import { Fragment } from '@wordpress/element'; import classnames from 'classnames'; import { Button, Dashicon, IconButton, Popover } from '@wordpress/components'; @@ -27,7 +27,6 @@ const Tag = ( { label, popoverContents, remove, - removeLabel, screenReaderLabel, setState, className, @@ -76,7 +75,7 @@ const Tag = ( { className="woocommerce-tag__remove" icon={ } onClick={ remove( id ) } - label={ removeLabel } + label={ sprintf( __( 'Remove %s', 'wc-admin' ), label ) } aria-describedby={ labelId } /> ) } @@ -101,20 +100,12 @@ Tag.propTypes = { * A function called when the remove X is clicked. If not used, no X icon will display. */ remove: PropTypes.func, - /** - * The label for removing this item (shown when hovering on X, or read to screen reader users). Defaults to "Remove tag". - */ - removeLabel: PropTypes.string, /** * A more descriptive label for screen reader users. Defaults to the `name` prop. */ screenReaderLabel: PropTypes.string, }; -Tag.defaultProps = { - removeLabel: __( 'Remove tag', 'wc-admin' ), -}; - export default withState( { isVisible: false, } )( withInstanceId( Tag ) );