Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved approach to translating bullet ARIA labels.
Browse files Browse the repository at this point in the history
jeffersonrabb committed Oct 1, 2019

Verified

This commit was signed with the committer’s verified signature.
snyk-bot Snyk bot
1 parent 15ab418 commit 9fcd5eb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions extensions/blocks/slideshow/slideshow.php
Original file line number Diff line number Diff line change
@@ -135,11 +135,15 @@ function( $id ) use ( $width, $height ) {
function jetpack_slideshow_block_bullets( $ids = array(), $block_ordinal = 0 ) {
$buttons = array_map(
function( $index ) {
$aria_label = sprintf(
/* translators: %d: Slide number. */
__( 'Go to slide %d', 'jetpack' ),
absint( $index + 1 )
);
return sprintf(
'<button option="%d" class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="%s %d" %s></button>',
'<button option="%d" class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="%s" %s></button>',
absint( $index ),
esc_attr__( 'Go to slide', 'jetpack' ),
absint( $index + 1 ),
esc_attr( $aria_label ),
0 === $index ? 'selected' : ''
);
},

0 comments on commit 9fcd5eb

Please sign in to comment.