Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Directory: Use the block's title for alt text on block directory plugin items. #19263

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { Button } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { __, sprintf } from '@wordpress/i18n';

/**
* Internal dependencies
Expand All @@ -15,7 +15,8 @@ function DownloadableBlockHeader( { icon, title, rating, ratingCount, onClick }
<div className="block-directory-downloadable-block-header__row">
{
icon.match( /\.(jpeg|jpg|gif|png)$/ ) !== null ?
<img src={ icon } alt="block icon" /> :
// translators: %s: Name of the plugin e.g: "Akismet".
<img src={ icon } alt={ sprintf( __( '%s block icon' ), title ) } /> :
MarcoZehe marked this conversation as resolved.
Show resolved Hide resolved
<span >
<BlockIcon icon={ icon } showColors />
</span>
Expand Down