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

Try/featured image improvements with alt text #7267

Conversation

anevins12
Copy link
Contributor

Description

Improved alternative text of featured images to describe the action of the button that wraps it, as well as identifies the featured image.

Branched off PR: #7200

How has this been tested?

  • Passes npm run test

Types of changes

  • JavaScript change

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@jasmussen
Copy link
Contributor

Thanks for working on this. Should we continue work in this branch, or should we get #7200 finished and merged first, then rebase this off that?

@anevins12
Copy link
Contributor Author

Yes let's get #7200 finished and merged first :)

@@ -41,7 +44,10 @@ function PostFeaturedImage( { featuredImageId, onUpdateImage, onRemoveImage, med
naturalWidth={ media.media_details.width }
naturalHeight={ media.media_details.height }
>
<img src={ media.source_url } alt={ __( 'Featured image' ) } />
<img
alt={ __( 'Replace featured image.' + featuredImageAltText( media.alt_text ) ) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work properly, you can't dynamically create a text that is passed to __() function. This probably should be rewritten to:

alt={ __( 'Replace featured image.' ) + ' ' + featuredImageAltText( media.alt_text ) }

gziolo
gziolo previously requested changes Jun 18, 2018
@@ -24,6 +24,9 @@ const DEFAULT_REMOVE_FEATURE_IMAGE_LABEL = __( 'Remove featured image' );

function PostFeaturedImage( { featuredImageId, onUpdateImage, onRemoveImage, media, postType } ) {
const postLabel = get( postType, [ 'labels' ], {} );
const featuredImageAltText = ( altText ) => {
return altText ? ' Current image: ' + altText : '';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text needs to be wrapped with the translation helper.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gziolo I think I've fixed this, can you check if I've missed something

@gziolo gziolo added the [Type] Enhancement A suggestion for improvement. label Jun 18, 2018
@jasmussen
Copy link
Contributor

@gziolo Thanks for the review, but I think we should get #7200 merged in first, as this PR is essentially an addition to that.

@gziolo
Copy link
Member

gziolo commented Oct 31, 2018

@jasmussen should we land it or close it?

@gziolo gziolo dismissed their stale review October 31, 2018 03:20

Translations look good now.

@jasmussen
Copy link
Contributor

So, this PR is now so old that I have a hard time compiling it. I tried and got a number of errors with my docker install.

The rephrasing could still make sense, but I think it might be good to see a GIF, or a fresh PR.

@gziolo
Copy link
Member

gziolo commented Oct 31, 2018

@anevins12 would you mind updating this PR with the latest changes from the master branch or open a new one as @jasmussen suggested?

@gziolo gziolo added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Oct 31, 2018
@gziolo
Copy link
Member

gziolo commented Nov 19, 2018

Let's close this one and start fresh as @jasmussen suggested.

@gziolo gziolo closed this Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants