IE11: Move placeholders from config files to components and add span around title

This commit is contained in:
Tiago Noronha 2019-02-14 01:35:47 +00:00
parent 3495ec74dd
commit 9d8ed29ea3
7 changed files with 40 additions and 22 deletions

View File

@ -39,7 +39,7 @@ export const advancedFilters = {
remove: __( 'Remove customer name filter', 'wc-admin' ),
rule: __( 'Select a customer name filter match', 'wc-admin' ),
/* translators: A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cCsm3GeXJbE */
title: __( 'Name {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Name', 'wc-admin' ),
filter: __( 'Select customer name', 'wc-admin' ),
},
rules: [
@ -70,7 +70,7 @@ export const advancedFilters = {
remove: __( 'Remove country filter', 'wc-admin' ),
rule: __( 'Select a country filter match', 'wc-admin' ),
/* translators: A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cCsm3GeXJbE */
title: __( 'Country {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Country', 'wc-admin' ),
filter: __( 'Select country', 'wc-admin' ),
},
rules: [
@ -111,7 +111,7 @@ export const advancedFilters = {
remove: __( 'Remove customer username filter', 'wc-admin' ),
rule: __( 'Select a customer username filter match', 'wc-admin' ),
/* translators: A sentence describing a customer username filter. See screen shot for context: https://cloudup.com/cCsm3GeXJbE */
title: __( 'Username {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Username', 'wc-admin' ),
filter: __( 'Select customer username', 'wc-admin' ),
},
rules: [
@ -139,7 +139,7 @@ export const advancedFilters = {
remove: __( 'Remove customer email filter', 'wc-admin' ),
rule: __( 'Select a customer email filter match', 'wc-admin' ),
/* translators: A sentence describing a customer email filter. See screen shot for context: https://cloudup.com/cCsm3GeXJbE */
title: __( 'Email {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Email', 'wc-admin' ),
filter: __( 'Select customer email', 'wc-admin' ),
},
rules: [
@ -168,7 +168,7 @@ export const advancedFilters = {
add: __( 'No. of Orders', 'wc-admin' ),
remove: __( 'Remove order filter', 'wc-admin' ),
rule: __( 'Select an order count filter match', 'wc-admin' ),
title: __( 'No. of Orders {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'No. of Orders', 'wc-admin' ),
},
rules: [
{
@ -196,7 +196,7 @@ export const advancedFilters = {
add: __( 'Total Spend', 'wc-admin' ),
remove: __( 'Remove total spend filter', 'wc-admin' ),
rule: __( 'Select a total spend filter match', 'wc-admin' ),
title: __( 'Total Spend {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Total Spend', 'wc-admin' ),
},
rules: [
{
@ -224,7 +224,7 @@ export const advancedFilters = {
add: __( 'AOV', 'wc-admin' ),
remove: __( 'Remove average older value filter', 'wc-admin' ),
rule: __( 'Select an average order value filter match', 'wc-admin' ),
title: __( 'AOV {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'AOV', 'wc-admin' ),
},
rules: [
{
@ -254,7 +254,7 @@ export const advancedFilters = {
remove: __( 'Remove registered filter', 'wc-admin' ),
rule: __( 'Select a registered filter match', 'wc-admin' ),
/* translators: A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cCsm3GeXJbE */
title: __( 'Registered {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Registered', 'wc-admin' ),
filter: __( 'Select registered date', 'wc-admin' ),
},
rules: [
@ -284,7 +284,7 @@ export const advancedFilters = {
remove: __( 'Remove last active filter', 'wc-admin' ),
rule: __( 'Select a last active filter match', 'wc-admin' ),
/* translators: A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cCsm3GeXJbE */
title: __( 'Last active {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Last active', 'wc-admin' ),
filter: __( 'Select registered date', 'wc-admin' ),
},
rules: [

View File

@ -45,7 +45,7 @@ export const advancedFilters = {
remove: __( 'Remove product filter', 'wc-admin' ),
rule: __( 'Select a product filter match', 'wc-admin' ),
/* translators: A sentence describing a Product filter. See screen shot for context: https://cloudup.com/ccxhyH2mEDg */
title: __( 'Product {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Product', 'wc-admin' ),
filter: __( 'Select product', 'wc-admin' ),
},
rules: [
@ -73,7 +73,7 @@ export const advancedFilters = {
remove: __( 'Remove customer username filter', 'wc-admin' ),
rule: __( 'Select a customer username filter match', 'wc-admin' ),
/* translators: A sentence describing a customer username filter. See screen shot for context: https://cloudup.com/ccxhyH2mEDg */
title: __( 'Username {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Username', 'wc-admin' ),
filter: __( 'Select customer username', 'wc-admin' ),
},
rules: [
@ -101,7 +101,7 @@ export const advancedFilters = {
remove: __( 'Remove order number filter', 'wc-admin' ),
rule: __( 'Select a order number filter match', 'wc-admin' ),
/* translators: A sentence describing a order number filter. See screen shot for context: https://cloudup.com/ccxhyH2mEDg */
title: __( 'Order number {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Order number', 'wc-admin' ),
filter: __( 'Select order number', 'wc-admin' ),
},
rules: [
@ -135,7 +135,7 @@ export const advancedFilters = {
remove: __( 'Remove IP address filter', 'wc-admin' ),
rule: __( 'Select an IP address filter match', 'wc-admin' ),
/* translators: A sentence describing a order number filter. See screen shot for context: https://cloudup.com/ccxhyH2mEDg */
title: __( 'IP Address {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'IP Address', 'wc-admin' ),
filter: __( 'Select IP address', 'wc-admin' ),
},
rules: [

View File

@ -61,7 +61,7 @@ export const advancedFilters = {
remove: __( 'Remove order status filter', 'wc-admin' ),
rule: __( 'Select an order status filter match', 'wc-admin' ),
/* translators: A sentence describing an Order Status filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ */
title: __( 'Order Status {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Order Status', 'wc-admin' ),
filter: __( 'Select an order status', 'wc-admin' ),
},
rules: [
@ -91,7 +91,7 @@ export const advancedFilters = {
remove: __( 'Remove products filter', 'wc-admin' ),
rule: __( 'Select a product filter match', 'wc-admin' ),
/* translators: A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ */
title: __( 'Product {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Product', 'wc-admin' ),
filter: __( 'Select products', 'wc-admin' ),
},
rules: [
@ -119,7 +119,7 @@ export const advancedFilters = {
remove: __( 'Remove coupon filter', 'wc-admin' ),
rule: __( 'Select a coupon filter match', 'wc-admin' ),
/* translators: A sentence describing a Coupon filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ */
title: __( 'Coupon Code {{rule /}} {{filter /}}', 'wc-admin' ),
title: __( 'Coupon Code', 'wc-admin' ),
filter: __( 'Select coupon codes', 'wc-admin' ),
},
rules: [
@ -146,7 +146,7 @@ export const advancedFilters = {
remove: __( 'Remove customer filter', 'wc-admin' ),
rule: __( 'Select a customer filter match', 'wc-admin' ),
/* translators: A sentence describing a Customer filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ */
title: __( 'Customer is {{filter /}}', 'wc-admin' ),
title: __( 'Customer is', 'wc-admin' ),
filter: __( 'Select a customer type', 'wc-admin' ),
},
input: {

View File

@ -7,7 +7,7 @@ import interpolateComponents from 'interpolate-components';
import { SelectControl } from '@wordpress/components';
import { find, partial } from 'lodash';
import classnames from 'classnames';
import { __, _x } from '@wordpress/i18n';
import { sprintf, __, _x } from '@wordpress/i18n';
/**
* WooCommerce dependencies
@ -191,8 +191,12 @@ class DateFilter extends Component {
const { labels, rules } = config;
const screenReaderText = this.getScreenReaderText( filter, config );
const children = interpolateComponents( {
mixedString: labels.title,
mixedString: sprintf(
'{{title}}%s{{/title}} {{rule /}} {{filter /}}',
labels.title
),
components: {
title: <span className={ className } />,
rule: (
<SelectControl
className={ classnames( className, 'woocommerce-filters-advanced__rule' ) }

View File

@ -190,8 +190,12 @@ class NumberFilter extends Component {
const { labels, rules } = config;
const children = interpolateComponents( {
mixedString: labels.title,
mixedString: sprintf(
'{{title}}%s{{/title}} {{rule /}} {{filter /}}',
labels.title
),
components: {
title: <span className={ className } />,
rule: (
<SelectControl
className={ classnames( className, 'woocommerce-filters-advanced__rule' ) }

View File

@ -8,6 +8,7 @@ import { find, isEqual, partial } from 'lodash';
import PropTypes from 'prop-types';
import interpolateComponents from 'interpolate-components';
import classnames from 'classnames';
import { sprintf } from '@wordpress/i18n';
/**
* Internal dependencies
@ -77,8 +78,12 @@ class SearchFilter extends Component {
const { key, rule } = filter;
const { input, labels, rules } = config;
const children = interpolateComponents( {
mixedString: labels.title,
mixedString: sprintf(
'{{title}}%s{{/title}} {{rule /}} {{filter /}}',
labels.title
),
components: {
title: <span className={ className } />,
rule: (
<SelectControl
className={ classnames( className, 'woocommerce-filters-advanced__rule' ) }

View File

@ -8,6 +8,7 @@ import { find, partial } from 'lodash';
import PropTypes from 'prop-types';
import interpolateComponents from 'interpolate-components';
import classnames from 'classnames';
import { sprintf } from '@wordpress/i18n';
/**
* Internal dependencies
@ -69,8 +70,12 @@ class SelectFilter extends Component {
const { key, rule, value } = filter;
const { labels, rules } = config;
const children = interpolateComponents( {
mixedString: labels.title,
mixedString: sprintf(
'{{title}}%s{{/title}} {{rule /}} {{filter /}}',
labels.title
),
components: {
title: <span className={ className } />,
rule: (
<SelectControl
className={ classnames( className, 'woocommerce-filters-advanced__rule' ) }