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

Horizontal mover a11y description not correctly internationalized. #19550

Closed
talldan opened this issue Jan 10, 2020 · 0 comments
Closed

Horizontal mover a11y description not correctly internationalized. #19550

talldan opened this issue Jan 10, 2020 · 0 comments
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time Internationalization (i18n) Issues or PRs related to internationalization efforts

Comments

@talldan
Copy link
Contributor

talldan commented Jan 10, 2020

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

@talldan talldan added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time Internationalization (i18n) Issues or PRs related to internationalization efforts labels Jan 10, 2020
@talldan talldan mentioned this issue Jan 10, 2020
5 tasks
@momotofu momotofu self-assigned this Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time Internationalization (i18n) Issues or PRs related to internationalization efforts
Projects
None yet
Development

No branches or pull requests

2 participants