#36014 closed defect (bug) (fixed)
Move the aria-label text into a separate translation string
Reported by: | ramiy | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | has-patch |
Focuses: | accessibility | Cc: |
Description
Old string:
<a href="%1$s" aria-label="Logged in as %2$s. Edit your profile.">Logged in as %2$s</a>. <a href="%3$s">Log out?</a>
New string:
<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>
The text inside aria-label attribute was replaced with a %2$s placeholder.
This way the translation string is shorter and easier to translate.
BTW, in other string translations we do the same.
Attachments (2)
Change History (10)
#4
@
9 years ago
The new code:
sprintf( __( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ), get_edit_user_link(), esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) )
This ticket was mentioned in Slack in #core-i18n by ramiy. View the logs.
9 years ago
Note: See
TracTickets for help on using
tickets.
The new code: