-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Describe the bug
I might be wrong on this, but it looks to me as though the directional text used for accessibility purposes for block movers isn't correctly internationalized:
https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/block-mover/mover-description.js#L26-L39
The directional text 'left'
, 'right'
, 'up'
and 'down'
is just a plain string.
Internationalising using __( 'left' );
would be a quick fix, but I think it'd be preferable to avoid interpolating the string, and instead hardcode the direction in the full mover description string—that would make it much easier for translators.
e.g. Instead of the following:
__( 'Move %1$s block from position %2$d %3$s to position %4$d' )
there'd be separate if
cases for each of the following strings:
__( 'Move %1$s block from position %2$d left to position %3$d' )
__( 'Move %1$s block from position %2$d right to position %3$d' )
__( 'Move %1$s block from position %2$d up to position %3$d' )
__( 'Move %1$s block from position %2$d down to position %3$d' )
__( 'Block %1$s is at the beginning of the content and can’t be moved left' )
__( 'Block %1$s is at the beginning of the content and can’t be moved up' )
__( 'Block %1$s is at the end of the content and can’t be moved right' )
__( 'Block %1$s is at the end of the content and can’t be moved down' )
Related info
#19549 adds some unit tests for these descriptions, which might be useful for working on this task