WordPress.org

Make WordPress Core

Opened 14 months ago

Closed 7 months ago

#48874 closed defect (bug) (fixed)

i18n: Use %s placeholders in wp-admin/edit-form-advanced.php

Reported by: ramiy Owned by: SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-screenshots has-patch
Focuses: administration Cc:

Description

This patch replaces <kbd>Alt + F10</kbd> with %s in the translation string.

Why? translators can mistakenly use wrong keyboard keys when translating the string. With %s placeholder we hardcode the keys, making sure there will be no mistakes.

Attachments (2)

48874.png (18.4 KB) - added by ramiy 14 months ago.
48874.patch (1.6 KB) - added by ramiy 14 months ago.

Download all attachments as: .zip

Change History (9)

@ramiy
14 months ago

@ramiy
14 months ago

#1 @ramiy
14 months ago

  • Keywords has-screenshots has-patch added

#2 follow-up: @tobifjellner
14 months ago

Are these keys always labelled ALT and F10 for all languages and scripts? (When I looked at Japanese, Korean and Arabic, they all seem to keep it this way, at least.)

Would RTL present these keys in the logical order if we do this change?

#3 @ramiy
14 months ago

@tobifjellner Thank you for your feedback.

This ticket don't change the logical order of the keys. The ticket only hard-code the keys, taking them out of the translation string.

#4 in reply to: ↑ 2 @ramiy
7 months ago

Replying to tobifjellner:

Would RTL present these keys in the logical order if we do this change?

In Hebrew (my language) it does not change the logical order. Browsers know how to handle bi-directional texts.

#5 @ramiy
7 months ago

@SergeyBiryukov in WordPress 5.4 we fixed many translation strings, using %s as placeholders. This patch didn't made it to 5.4. Can you assign it to Milestone 5.5 ?

#6 @SergeyBiryukov
7 months ago

  • Milestone changed from Awaiting Review to 5.5

Thanks for the patch! Looks like we've already moved some <kbd> tags out of translatable strings earlier in [41986], so it should be fine to do the same here for consistency.

If any locale does need to translate these tags, the translators can always create a new ticket.

#7 @SergeyBiryukov
7 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 48194:

I18N: Remove <kbd> tag from a translatable string on Edit Post screen.

Props ramiy, tobifjellner.
Fixes #48874.

Note: See TracTickets for help on using tickets.