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

Remove redundant translations #1867

Merged
merged 4 commits into from Sep 26, 2022
Merged

Conversation

IanDelMar
Copy link
Contributor

Description

This PR

  • deprecates 2 redundant translations: __( '1 Comment', 'understrap' ) and __( '% Comments', 'understrap' ).
  • adds screen reader text to one string: __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'understrap' ).
  • updates pot, po and mo files.

Motivation and Context

WP uses the exact same string and provides a translation with better accessibility. See https://github.com/WordPress/WordPress/blob/2f1cac50d34ea42286c89bed28c51ba0b81c17ca/wp-includes/comment-template.php#L1579-L1588. For accessibility reasons we should add a screen reader text to __( 'Leave a comment', 'understrap' ) as well.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I pulled my branch from develop.
  • I am submitting my pull request to develop.
  • I have resolved any conflicts merging this pull request would create.
  • I have checked that there aren't other open Pull Requests for the same update/change.
  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • (Optional) My change requires a change to the documentation.
  • (Optional) I have updated the documentation accordingly.
  • (Optional) My change requires a change to the translations.
  • (Optional) I have updated the translations accordingly.
  • composer cs:check has passed locally.
  • composer lint:php has passed locally.
  • I have read the CONTRIBUTING document.

Further comments

For the part with the screen reader text I used translation from WP 6.0.1 for the string "No Comments on %s". See here for Spanish. I also checked the "Leave a comment" part for consistency here.

@IanDelMar
Copy link
Contributor Author

For discussion:
I think we should also drop the "leave a comment". WP uses "No Comments on %s" if there are no comments. Which makes sense:

  • Otherwise you don't see any information on the number of existing comments if there are no comments. If there are comments it displays the number of comments and not "leave a comment".
  • Understrap uses the_excerpt(). Why would you want to "leave a comment" on a post you haven't even read at the time you see "leave a comment"?
  • If it does make sense to have "leave a comment" then it should be displayed as well if there is a non-zero number of comments.

Any other thoughts on this? @bacoords ?

@bacoords bacoords merged commit 6cc7fbc into understrap:develop Sep 26, 2022
@IanDelMar IanDelMar deleted the comment-trans branch September 27, 2022 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants