I18N: Move the `aria-label` text in `get_theme_update_available()` to a separate string for easier translation.

Add translator comments.

Props ramiy.
Fixes #36048.

git-svn-id: https://develop.svn.wordpress.org/trunk@36845 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2016-03-04 11:11:03 +00:00
parent 9c39e27fde
commit d8f72707d2
1 changed files with 27 additions and 9 deletions

View File

@ -166,17 +166,35 @@ function get_theme_update_available( $theme ) {
if ( !is_multisite() ) { if ( !is_multisite() ) {
if ( ! current_user_can('update_themes') ) { if ( ! current_user_can('update_themes') ) {
/* translators: 1: theme name, 2: theme details URL, 3: theme version number */ /* translators: 1: theme name, 2: theme details URL, 3: accessibility text, 4: version number */
$html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox">View version %3$s details</a>.' ) . '</strong></p>', $html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>.' ) . '</strong></p>',
$theme_name, esc_url( $details_url ), $update['new_version'] ); $theme_name,
esc_url( $details_url ),
/* translators: 1: theme name, 2: version number */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) ),
$update['new_version']
);
} elseif ( empty( $update['package'] ) ) { } elseif ( empty( $update['package'] ) ) {
/* translators: 1: theme name, 2: theme details URL, 3: theme version number */ /* translators: 1: theme name, 2: theme details URL, 3: accessibility text, 4: version number */
$html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox">View version %3$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ) . '</strong></p>', $html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ) . '</strong></p>',
$theme_name, esc_url( $details_url ), $update['new_version'] ); $theme_name,
esc_url( $details_url ),
/* translators: 1: theme name, 2: version number */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) ),
$update['new_version']
);
} else { } else {
/* translators: 1: theme name, 2: theme details URL, 3: theme version number, 4: theme update URL */ /* translators: 1: theme name, 2: theme details URL, 3: accessibility text, 4: version number, 5: update URL, 6: accessibility text */
$html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox">View version %3$s details</a> or <a href="%4$s">update now</a>.' ) . '</strong></p>', $html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a> or <a href="%5$s" aria-label="%6$s">update now</a>.' ) . '</strong></p>',
$theme_name, esc_url( $details_url ), $update['new_version'], $update_url ); $theme_name,
esc_url( $details_url ),
/* translators: 1: theme name, 2: version number */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) ),
$update['new_version'],
$update_url,
/* translators: %s: theme name */
esc_attr( sprintf( __( 'Update %s now' ), $theme_name ) )
);
} }
} }
} }