Skip to content

Horizontal mover a11y description not correctly internationalized. #19550

@talldan

Description

@talldan

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

Metadata

Metadata

Assignees

Labels

Good First IssueAn issue that's suitable for someone looking to contribute for the first timeInternationalization (i18n)Issues or PRs related to internationalization efforts[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions