-
Notifications
You must be signed in to change notification settings - Fork 172
Description
There is a link to view all reviews in the sidebar of the theme/plugin page:
This link is generated here:
Lines 43 to 47 in 82d3f79
| return sprintf( | |
| '<a href="%s">%s</a>', | |
| esc_url( 'https://wordpress.org/support/plugin/' . $plugin_post->post_name . '/reviews/' ), | |
| __( 'See all<span class="screen-reader-text"> reviews</span>', 'wporg-themes' ) | |
| ); |
The generated HTML is as follows:
<a href="">See all<span class="screen-reader-text"> reviews</span></a>This sentence consists of the following words:
See: verbAll: adjectiveReviews: noun
The word reviews is invisible because of the CSS class for screen readers, so the visible sentence is See all, which consists of verb + adjective. In English, a sentence may be natural without a noun, but in other languages, this may not be the case.
In some languages, the sentence that represents verb + adjective may change if the noun is removed. Therefore, the current implementation makes it hard to provide a correct translated text for both the visible sentence and the sentence for screen readers. For this reason, I recommend not to hide a word from a sentence.
I recommend providing a consistent sentence "See all reviews", but if localization may cause conflicts with the "Add my review" text on the left, it may be good to add flex-wrap: wrap to the parent Group block.
P.S. We may be tempted to use the title attribute to solve this issue like the following example, but note that this is not recommended from an a11y perspective:
<a href="" title="See all reviews">See all</a>Ref: https://make.wordpress.org/accessibility/handbook/best-practices/quick-start-guide/#links
