Make WordPress Core


Ignore:
Timestamp:
07/17/2016 09:02:21 PM (8 years ago)
Author:
SergeyBiryukov
Message:

I18N: Remove non-translatable link attributes from translatable strings in wp_plugin_update_row(), wp_theme_update_row(), and get_theme_update_available().

The resulting strings are much easier to translate.

See #36048.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/theme.php

    r38074 r38082  
    172172        if ( !is_multisite() ) {
    173173            if ( ! current_user_can('update_themes') ) {
    174                 /* translators: 1: theme name, 2: theme details URL, 3: accessibility text, 4: version number */
    175                 $html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="%3$s">View version %4$s details</a>.' ) . '</strong></p>',
     174                /* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number */
     175                $html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ) . '</strong></p>',
    176176                    $theme_name,
    177177                    esc_url( $details_url ),
    178                     /* translators: 1: theme name, 2: version number */
    179                     esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) ),
     178                    sprintf( 'class="thickbox open-plugin-details-modal" aria-label="%s"',
     179                        /* translators: 1: theme name, 2: version number */
     180                        esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) )
     181                    ),
    180182                    $update['new_version']
    181183                );
    182184            } elseif ( empty( $update['package'] ) ) {
    183                 /* translators: 1: theme name, 2: theme details URL, 3: accessibility text, 4: version number */
    184                 $html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ) . '</strong></p>',
     185                /* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number */
     186                $html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ) . '</strong></p>',
    185187                    $theme_name,
    186188                    esc_url( $details_url ),
    187                     /* translators: 1: theme name, 2: version number */
    188                     esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) ),
     189                    sprintf( 'class="thickbox open-plugin-details-modal" aria-label="%s"',
     190                        /* translators: 1: theme name, 2: version number */
     191                        esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) )
     192                    ),
    189193                    $update['new_version']
    190194                );
    191195            } else {
    192                 /* translators: 1: theme name, 2: theme details URL, 3: accessibility text, 4: version number, 5: update URL, 6: accessibility text */
    193                 $html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="%3$s">View version %4$s details</a> or <a href="%5$s" aria-label="%6$s" id="update-theme" data-slug="%7$s">update now</a>.' ) . '</strong></p>',
     196                /* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
     197                $html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ) . '</strong></p>',
    194198                    $theme_name,
    195199                    esc_url( $details_url ),
    196                     /* translators: 1: theme name, 2: version number */
    197                     esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) ),
     200                    sprintf( 'class="thickbox open-plugin-details-modal" aria-label="%s"',
     201                        /* translators: 1: theme name, 2: version number */
     202                        esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) )
     203                    ),
    198204                    $update['new_version'],
    199205                    $update_url,
    200                     /* translators: %s: theme name */
    201                     esc_attr( sprintf( __( 'Update %s now' ), $theme_name ) ),
    202                     $stylesheet
     206                    sprintf( 'aria-label="%s" id="update-theme" data-slug="%s"',
     207                        /* translators: %s: theme name */
     208                        esc_attr( sprintf( __( 'Update %s now' ), $theme_name ) ),
     209                        $stylesheet
     210                    )
    203211                );
    204212            }
Note: See TracChangeset for help on using the changeset viewer.