Set up i18n-text-domain rule and fix missing text domain (#33780)
* Set allowedTextDomain to only allow woocommmerce text domain * Set allowedTextDomain to only allow woocommerce text domain * Fix wrong or missing i18n text domain * Add changelog * Add changelog
This commit is contained in:
parent
c33212e612
commit
8952dac7c0
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Fix missing text domain
|
|
@ -25,9 +25,9 @@ class ImageUpload extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
const frame = wp.media( {
|
const frame = wp.media( {
|
||||||
title: __( 'Select or upload image' ),
|
title: __( 'Select or upload image', 'woocommerce' ),
|
||||||
button: {
|
button: {
|
||||||
text: __( 'Select' ),
|
text: __( 'Select', 'woocommerce' ),
|
||||||
},
|
},
|
||||||
library: {
|
library: {
|
||||||
type: 'image',
|
type: 'image',
|
||||||
|
|
|
@ -5,9 +5,9 @@ import { __ } from '@wordpress/i18n';
|
||||||
import { OrderStatus } from '@woocommerce/components';
|
import { OrderStatus } from '@woocommerce/components';
|
||||||
|
|
||||||
const orderStatusMap = {
|
const orderStatusMap = {
|
||||||
processing: __( 'Processing Order' ),
|
processing: __( 'Processing Order', 'woocommerce' ),
|
||||||
pending: __( 'Pending Order' ),
|
pending: __( 'Pending Order', 'woocommerce' ),
|
||||||
completed: __( 'Completed Order' ),
|
completed: __( 'Completed Order', 'woocommerce' ),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Basic = () => (
|
export const Basic = () => (
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: update
|
||||||
|
|
||||||
|
Update i18n-text-domain rule to only allow woocommerce text domain
|
|
@ -16,6 +16,12 @@ module.exports = {
|
||||||
yoda: [ 'error', 'never' ],
|
yoda: [ 'error', 'never' ],
|
||||||
// temporary conversion to warnings until the below are all handled.
|
// temporary conversion to warnings until the below are all handled.
|
||||||
'@wordpress/i18n-translator-comments': 'warn',
|
'@wordpress/i18n-translator-comments': 'warn',
|
||||||
|
'@wordpress/i18n-text-domain': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
allowedTextDomain: 'woocommerce',
|
||||||
|
},
|
||||||
|
],
|
||||||
'@wordpress/valid-sprintf': 'warn',
|
'@wordpress/valid-sprintf': 'warn',
|
||||||
'@wordpress/no-unsafe-wp-apis': 'warn',
|
'@wordpress/no-unsafe-wp-apis': 'warn',
|
||||||
'@wordpress/no-global-active-element': 'warn',
|
'@wordpress/no-global-active-element': 'warn',
|
||||||
|
|
|
@ -317,7 +317,7 @@ const ReportTable = ( props ) => {
|
||||||
label: (
|
label: (
|
||||||
<CheckboxControl
|
<CheckboxControl
|
||||||
onChange={ selectAllRows }
|
onChange={ selectAllRows }
|
||||||
aria-label={ __( 'Select All' ) }
|
aria-label={ __( 'Select All', 'woocommerce' ) }
|
||||||
checked={ isAllChecked }
|
checked={ isAllChecked }
|
||||||
disabled={ ! hasData }
|
disabled={ ! hasData }
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -132,7 +132,7 @@ class VariationsReportTable extends Component {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
display: deleted ? (
|
display: deleted ? (
|
||||||
name + ' ' + __( '(Deleted)', ' woocommerce-admin' )
|
name + ' ' + __( '(Deleted)', 'woocommerce' )
|
||||||
) : (
|
) : (
|
||||||
<Link href={ editPostLink } type="wp-admin">
|
<Link href={ editPostLink } type="wp-admin">
|
||||||
{ name }
|
{ name }
|
||||||
|
|
|
@ -56,7 +56,7 @@ class SectionControls extends Component {
|
||||||
<MenuItem isClickable onInvoke={ this.onMoveUp }>
|
<MenuItem isClickable onInvoke={ this.onMoveUp }>
|
||||||
<Icon
|
<Icon
|
||||||
icon={ <ChevronUpIcon /> }
|
icon={ <ChevronUpIcon /> }
|
||||||
label={ __( 'Move up' ) }
|
label={ __( 'Move up', 'woocommerce' ) }
|
||||||
size={ 20 }
|
size={ 20 }
|
||||||
className="icon-control"
|
className="icon-control"
|
||||||
/>
|
/>
|
||||||
|
@ -68,7 +68,7 @@ class SectionControls extends Component {
|
||||||
<Icon
|
<Icon
|
||||||
icon={ <ChevronDownIcon /> }
|
icon={ <ChevronDownIcon /> }
|
||||||
size={ 20 }
|
size={ 20 }
|
||||||
label={ __( 'Move down' ) }
|
label={ __( 'Move down', 'woocommerce' ) }
|
||||||
className="icon-control"
|
className="icon-control"
|
||||||
/>
|
/>
|
||||||
{ __( 'Move down', 'woocommerce' ) }
|
{ __( 'Move down', 'woocommerce' ) }
|
||||||
|
@ -78,7 +78,7 @@ class SectionControls extends Component {
|
||||||
<Icon
|
<Icon
|
||||||
icon={ trash }
|
icon={ trash }
|
||||||
size={ 20 }
|
size={ 20 }
|
||||||
label={ __( 'Remove block' ) }
|
label={ __( 'Remove block', 'woocommerce' ) }
|
||||||
className="icon-control"
|
className="icon-control"
|
||||||
/>
|
/>
|
||||||
{ __( 'Remove section', 'woocommerce' ) }
|
{ __( 'Remove section', 'woocommerce' ) }
|
||||||
|
|
|
@ -120,7 +120,11 @@ function Snackbar(
|
||||||
tabIndex="0"
|
tabIndex="0"
|
||||||
role={ ! explicitDismiss ? 'button' : '' }
|
role={ ! explicitDismiss ? 'button' : '' }
|
||||||
onKeyPress={ ! explicitDismiss ? dismissMe : noop }
|
onKeyPress={ ! explicitDismiss ? dismissMe : noop }
|
||||||
aria-label={ ! explicitDismiss ? __( 'Dismiss this notice' ) : '' }
|
aria-label={
|
||||||
|
! explicitDismiss
|
||||||
|
? __( 'Dismiss this notice', 'woocommerce' )
|
||||||
|
: ''
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<div className={ snackbarContentClassnames }>
|
<div className={ snackbarContentClassnames }>
|
||||||
{ icon && (
|
{ icon && (
|
||||||
|
|
|
@ -96,7 +96,9 @@ const Header = () => {
|
||||||
} );
|
} );
|
||||||
|
|
||||||
if ( siteIconUrl ) {
|
if ( siteIconUrl ) {
|
||||||
buttonIcon = <img alt={ __( 'Site Icon' ) } src={ siteIconUrl } />;
|
buttonIcon = (
|
||||||
|
<img alt={ __( 'Site Icon', 'woocommerce' ) } src={ siteIconUrl } />
|
||||||
|
);
|
||||||
} else if ( isRequestingSiteIcon ) {
|
} else if ( isRequestingSiteIcon ) {
|
||||||
buttonIcon = null;
|
buttonIcon = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ export const Plugin: React.FC< PluginProps > = ( {
|
||||||
onManage( slug );
|
onManage( slug );
|
||||||
} }
|
} }
|
||||||
>
|
>
|
||||||
{ __( 'Manage', 'woocommmerce-admin' ) }
|
{ __( 'Manage', 'woocommerce' ) }
|
||||||
</Button>
|
</Button>
|
||||||
) }
|
) }
|
||||||
{ isInstalled && ! isActive && (
|
{ isInstalled && ! isActive && (
|
||||||
|
@ -91,7 +91,7 @@ export const Plugin: React.FC< PluginProps > = ( {
|
||||||
isSecondary
|
isSecondary
|
||||||
onClick={ () => installAndActivate( slug ) }
|
onClick={ () => installAndActivate( slug ) }
|
||||||
>
|
>
|
||||||
{ __( 'Activate', 'woocommmerce-admin' ) }
|
{ __( 'Activate', 'woocommerce' ) }
|
||||||
</Button>
|
</Button>
|
||||||
) }
|
) }
|
||||||
{ ! isInstalled && (
|
{ ! isInstalled && (
|
||||||
|
@ -101,7 +101,7 @@ export const Plugin: React.FC< PluginProps > = ( {
|
||||||
isSecondary
|
isSecondary
|
||||||
onClick={ () => installAndActivate( slug ) }
|
onClick={ () => installAndActivate( slug ) }
|
||||||
>
|
>
|
||||||
{ __( 'Get started', 'woocommmerce-admin' ) }
|
{ __( 'Get started', 'woocommerce' ) }
|
||||||
</Button>
|
</Button>
|
||||||
) }
|
) }
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -21,10 +21,13 @@ const LoadSampleProductModal: React.FC = () => {
|
||||||
>
|
>
|
||||||
<Spinner color="#007cba" size={ 48 } />
|
<Spinner color="#007cba" size={ 48 } />
|
||||||
<Text className="woocommerce-load-sample-product-modal__title">
|
<Text className="woocommerce-load-sample-product-modal__title">
|
||||||
{ __( 'Loading sample products' ) }
|
{ __( 'Loading sample products', 'woocommerce' ) }
|
||||||
</Text>
|
</Text>
|
||||||
<Text className="woocommerce-load-sample-product-modal__description">
|
<Text className="woocommerce-load-sample-product-modal__description">
|
||||||
{ __( 'We are loading 9 sample products into your store' ) }
|
{ __(
|
||||||
|
'We are loading 9 sample products into your store',
|
||||||
|
'woocommerce'
|
||||||
|
) }
|
||||||
</Text>
|
</Text>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
|
|
|
@ -30,7 +30,8 @@ const CardLayout: React.FC< CardProps > = ( { items } ) => {
|
||||||
<Text className="woocommerce-products-card-layout__description">
|
<Text className="woocommerce-products-card-layout__description">
|
||||||
{ interpolateComponents( {
|
{ interpolateComponents( {
|
||||||
mixedString: __(
|
mixedString: __(
|
||||||
'{{sbLink}}Start blank{{/sbLink}} or select a product type:'
|
'{{sbLink}}Start blank{{/sbLink}} or select a product type:',
|
||||||
|
'woocommerce'
|
||||||
),
|
),
|
||||||
components: {
|
components: {
|
||||||
sbLink: (
|
sbLink: (
|
||||||
|
|
|
@ -76,7 +76,8 @@ export const LoadSampleProductType = {
|
||||||
key: 'load-sample-product' as const,
|
key: 'load-sample-product' as const,
|
||||||
title: __( 'can’t decide?', 'woocommerce' ),
|
title: __( 'can’t decide?', 'woocommerce' ),
|
||||||
content: __(
|
content: __(
|
||||||
'Load sample products and see what they look like in your store.'
|
'Load sample products and see what they look like in your store.',
|
||||||
|
'woocommerce'
|
||||||
),
|
),
|
||||||
before: <LightBulb />,
|
before: <LightBulb />,
|
||||||
after: <Icon icon={ chevronRight } />,
|
after: <Icon icon={ chevronRight } />,
|
||||||
|
|
|
@ -25,7 +25,8 @@ const Footer: React.FC = () => {
|
||||||
<Text className="woocommerce-products-footer__import-options">
|
<Text className="woocommerce-products-footer__import-options">
|
||||||
{ interpolateComponents( {
|
{ interpolateComponents( {
|
||||||
mixedString: __(
|
mixedString: __(
|
||||||
'{{importCSVLink}}Import your products from a CSV file{{/importCSVLink}} or {{_3rdLink}}use a 3rd party migration plugin{{/_3rdLink}}.'
|
'{{importCSVLink}}Import your products from a CSV file{{/importCSVLink}} or {{_3rdLink}}use a 3rd party migration plugin{{/_3rdLink}}.',
|
||||||
|
'woocommerce'
|
||||||
),
|
),
|
||||||
components: {
|
components: {
|
||||||
importCSVLink: (
|
importCSVLink: (
|
||||||
|
|
|
@ -159,7 +159,7 @@ export default function ProductTemplateModal( { onClose } ) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
title={ __( 'Start with a template' ) }
|
title={ __( 'Start with a template', 'woocommerce' ) }
|
||||||
isDismissible={ true }
|
isDismissible={ true }
|
||||||
onRequestClose={ () => onClose() }
|
onRequestClose={ () => onClose() }
|
||||||
className="woocommerce-product-template-modal"
|
className="woocommerce-product-template-modal"
|
||||||
|
@ -193,7 +193,7 @@ export default function ProductTemplateModal( { onClose } ) {
|
||||||
disabled={ ! selectedTemplate || isRedirecting }
|
disabled={ ! selectedTemplate || isRedirecting }
|
||||||
onClick={ createTemplate }
|
onClick={ createTemplate }
|
||||||
>
|
>
|
||||||
{ __( 'Go' ) }
|
{ __( 'Go', 'woocommerce' ) }
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -66,7 +66,7 @@ export const TaskListItem: React.FC< TaskListItemProps > = ( {
|
||||||
|
|
||||||
const onDismiss = useCallback( () => {
|
const onDismiss = useCallback( () => {
|
||||||
dismissTask( id );
|
dismissTask( id );
|
||||||
createNotice( 'success', __( 'Task dismissed' ), {
|
createNotice( 'success', __( 'Task dismissed', 'woocommerce' ), {
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
label: __( 'Undo', 'woocommerce' ),
|
label: __( 'Undo', 'woocommerce' ),
|
||||||
|
|
|
@ -89,7 +89,7 @@ const WoocommercePaymentsHeader = ( { task, trackClick } ) => {
|
||||||
</Button>
|
</Button>
|
||||||
<p className="woocommerce-task-header__timer">
|
<p className="woocommerce-task-header__timer">
|
||||||
<img src={ TimerImage } alt="Timer" />{ ' ' }
|
<img src={ TimerImage } alt="Timer" />{ ' ' }
|
||||||
<span>{ __( '2 minutes' ) }</span>
|
<span>{ __( '2 minutes', 'woocommerce' ) }</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -46,7 +46,7 @@ export const TaskListItemTwoColumn: React.FC< TaskListItemProps > = ( {
|
||||||
|
|
||||||
const onDismissTask = ( onDismiss?: () => void ) => {
|
const onDismissTask = ( onDismiss?: () => void ) => {
|
||||||
dismissTask( taskId );
|
dismissTask( taskId );
|
||||||
createNotice( 'success', __( 'Task dismissed' ), {
|
createNotice( 'success', __( 'Task dismissed', 'woocommerce' ), {
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
label: __( 'Undo', 'woocommerce' ),
|
label: __( 'Undo', 'woocommerce' ),
|
||||||
|
|
|
@ -97,7 +97,7 @@ export const TaskListItem: React.FC< TaskListItemProps > = ( {
|
||||||
|
|
||||||
const onDismiss = useCallback( () => {
|
const onDismiss = useCallback( () => {
|
||||||
dismissTask( task.id );
|
dismissTask( task.id );
|
||||||
createNotice( 'success', __( 'Task dismissed' ), {
|
createNotice( 'success', __( 'Task dismissed', 'woocommerce' ), {
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
label: __( 'Undo', 'woocommerce' ),
|
label: __( 'Undo', 'woocommerce' ),
|
||||||
|
|
|
@ -40,7 +40,10 @@ export function getAdminSetting(
|
||||||
) {
|
) {
|
||||||
if ( mutableSources.includes( name ) ) {
|
if ( mutableSources.includes( name ) ) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
__( 'Mutable settings should be accessed via data store.' )
|
__(
|
||||||
|
'Mutable settings should be accessed via data store.',
|
||||||
|
'woocommerce'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const value = ADMIN_SETTINGS_SOURCE.hasOwnProperty( name )
|
const value = ADMIN_SETTINGS_SOURCE.hasOwnProperty( name )
|
||||||
|
@ -75,7 +78,10 @@ export const ORDER_STATUSES = getAdminSetting( 'orderStatuses' );
|
||||||
export function setAdminSetting( name, value, filter = ( val ) => val ) {
|
export function setAdminSetting( name, value, filter = ( val ) => val ) {
|
||||||
if ( mutableSources.includes( name ) ) {
|
if ( mutableSources.includes( name ) ) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
__( 'Mutable settings should be mutated via data store.' )
|
__(
|
||||||
|
'Mutable settings should be mutated via data store.',
|
||||||
|
'woocommerce'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
ADMIN_SETTINGS_SOURCE[ name ] = filter( value );
|
ADMIN_SETTINGS_SOURCE[ name ] = filter( value );
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
domReady( () => {
|
domReady( () => {
|
||||||
dispatch( 'core/notices' ).createSuccessNotice(
|
dispatch( 'core/notices' ).createSuccessNotice(
|
||||||
__( 'Sample products added' ),
|
__( 'Sample products added', 'woocommerce' ),
|
||||||
{
|
{
|
||||||
id: 'WOOCOMMERCE_ONBOARDING_LOAD_SAMPLE_PRODUCTS_NOTICE',
|
id: 'WOOCOMMERCE_ONBOARDING_LOAD_SAMPLE_PRODUCTS_NOTICE',
|
||||||
actions: [
|
actions: [
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Fix missing text domain strings
|
Loading…
Reference in New Issue