Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
className="jetpack-instant-search__result-title"
>
{ strip( this.props.result.fields.title_html ) || 'Unknown Title' }
{' '}
<div>
{ strip( this.props.result.fields.author ) }{' '}
<span>
{ strip( this.props.result.fields.date ).split( ' ' )[ 0 ] }
</span>
</div>
<div>
{ strip( this.props.result.fields.excerpt_html ) }
</div>
<div>
{ sprintf(
_n( '%d comment', '%d comments', this.props.result.fields.comment_count, 'jetpack' ),
this.props.result.fields.comment_count
) }
</div>
);
}
}
announce( filteredOptions ) {
const { debouncedSpeak } = this.props;
if ( ! debouncedSpeak ) {
return;
}
if ( filteredOptions.length ) {
debouncedSpeak(
sprintf(
_n(
'%d result found, use up and down arrow keys to navigate.',
'%d results found, use up and down arrow keys to navigate.',
filteredOptions.length,
'jetpack',
'jetpack'
),
filteredOptions.length
),
'assertive'
);
} else {
debouncedSpeak( __( 'No results.', 'jetpack' ), 'assertive' );
}
}
render() {
{ getInteractionIcon( isSelected ) }
<span>
<span>
</span>
{ variationsCount ? (
<span>
{ sprintf(
_n(
'%d variation',
'%d variations',
variationsCount,
'woocommerce'
),
variationsCount
) }
</span>
) : null }
,
expandedProduct === item.id &&
variationsCount > 0 &&
variationsLoading && (
</span>
);
} );
}, [] );
if ( error ) {
return <div>{ error }</div>;
}
const { date, content, bugFixes = [], features = [] } = parseReleaseHeader( releaseData );
const bugFixesAmountString = sprintf(
_n( '%d bug', '%d bugs', bugFixes.length, 'newspack' ),
bugFixes.length
);
const featuresAmountString = sprintf(
_n( '%d new feature', '%d new features', features.length, 'newspack' ),
features.length
);
const infoStrings = [
...( bugFixes.length ? [ `${ __( 'fixing', 'newspack' ) } ${ bugFixesAmountString }` ] : [] ),
...( features.length ? [ `${ __( 'adding', 'newspack' ) } ${ featuresAmountString }` ] : [] ),
];
return releaseData ? (
<details>
<summary>
<div>
</div>
<span>
<strong>{ repoName }</strong> { __( 'was released', 'newspack' ) }{' '}</span></summary></details>
selected: ( n ) =>
sprintf(
_n(
'%d tag selected',
'%d tags selected',
n,
'woo-gutenberg-products-block'
),
n
),
updated: __(
getSearchTitle() {
const { total = 0, corrected_query = false } = this.props.response;
const hasQuery = this.props.query !== '';
const hasCorrectedQuery = corrected_query !== false;
const num = new Intl.NumberFormat().format( total );
if ( hasQuery && hasCorrectedQuery ) {
return sprintf(
_n( 'Showing %s result for "%s"', 'Showing %s results for "%s"', total, 'jetpack' ),
num,
corrected_query
);
} else if ( hasQuery ) {
return sprintf(
_n( '%s result for "%s"', '%s results for "%s"', total, 'jetpack' ),
num,
this.props.query
);
}
return sprintf( _n( '%s result', '%s results', total, 'jetpack' ), num );
}
const renderProductControlItem = ( args ) => {
const { item = 0 } = args;
return (
reusableItems,
itemsPerCategory,
openPanels: this.filterOpenPanels(
filterValue,
itemsPerCategory,
filteredItems,
reusableItems
),
} );
const resultCount = Object.keys( itemsPerCategory ).reduce( ( accumulator, currentCategorySlug ) => {
return accumulator + itemsPerCategory[ currentCategorySlug ].length;
}, 0 );
const resultsFoundMessage = sprintf(
_n( '%d result found.', '%d results found.', resultCount ),
resultCount
);
debouncedSpeak( resultsFoundMessage );
}
announce( filteredOptions ) {
const { debouncedSpeak } = this.props;
if ( ! debouncedSpeak ) {
return;
}
if ( !! filteredOptions.length ) {
debouncedSpeak(
sprintf(
_n(
'%d result found, use up and down arrow keys to navigate.',
'%d results found, use up and down arrow keys to navigate.',
filteredOptions.length,
'jetpack'
),
filteredOptions.length
),
'assertive'
);
} else {
debouncedSpeak( __( 'No results.', 'jetpack' ), 'assertive' );
}
}
render() {
function transformDurationsToStrings( { days, hours, minutes } ) {
const strings = [];
if ( days !== 0 ) {
strings.push( sprintf( _n( "%d day", "%d days", days, "wordpress-seo" ), days ) );
}
if ( hours !== 0 ) {
strings.push( sprintf( _n( "%d hour", "%d hours", hours, "wordpress-seo" ), hours ) );
}
if ( minutes !== 0 ) {
strings.push( sprintf( _n( "%d minute", "%d minutes", minutes, "wordpress-seo" ), minutes ) );
}
return strings;
}