Make WordPress Core

Changeset 38082


Ignore:
Timestamp:
07/17/2016 09:02:21 PM (10 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.

Location:
trunk/src/wp-admin/includes
Files:
2 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                        }
  • trunk/src/wp-admin/includes/update.php

    r38057 r38082  
    369369
    370370                if ( ! current_user_can( 'update_plugins' ) ) {
    371                         /* translators: 1: plugin name, 2: details URL, 3: accessibility text, 4: version number */
    372                         printf( __( '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>.' ),
     371                        /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */
     372                        printf( __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ),
    373373                                $plugin_name,
    374374                                esc_url( $details_url ),
    375                                 /* translators: 1: plugin name, 2: version number */
    376                                 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ),
     375                                sprintf( 'class="thickbox open-plugin-details-modal" aria-label="%s"',
     376                                        /* translators: 1: plugin name, 2: version number */
     377                                        esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
     378                                ),
    377379                                $response->new_version
    378380                        );
    379381                } elseif ( empty( $response->package ) ) {
    380                         /* translators: 1: plugin name, 2: details URL, 3: accessibility text, 4: version number */
    381                         printf( __( '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 plugin.</em>' ),
     382                        /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */
     383                        printf( __( '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 plugin.</em>' ),
    382384                                $plugin_name,
    383385                                esc_url( $details_url ),
    384                                 /* translators: 1: plugin name, 2: version number */
    385                                 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ),
     386                                sprintf( 'class="thickbox open-plugin-details-modal" aria-label="%s"',
     387                                        /* translators: 1: plugin name, 2: version number */
     388                                        esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
     389                                ),
    386390                                $response->new_version
    387391                        );
    388392                } else {
    389                         /* translators: 1: plugin name, 2: details URL, 3: accessibility text, 4: version number, 5: update URL, 6: accessibility text */
    390                         printf( __( '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" class="update-link" aria-label="%6$s">update now</a>.' ),
     393                        /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
     394                        printf( __( '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>.' ),
    391395                                $plugin_name,
    392396                                esc_url( $details_url ),
    393                                 /* translators: 1: plugin name, 2: version number */
    394                                 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ),
     397                                sprintf( 'class="thickbox open-plugin-details-modal" aria-label="%s"',
     398                                        /* translators: 1: plugin name, 2: version number */
     399                                        esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
     400                                ),
    395401                                $response->new_version,
    396402                                wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ),
    397                                 /* translators: %s: plugin name */
    398                                 esc_attr( sprintf( __( 'Update %s now' ), $plugin_name ) )
     403                                sprintf( 'class="update-link" aria-label="%s"',
     404                                        /* translators: %s: plugin name */
     405                                        esc_attr( sprintf( __( 'Update %s now' ), $plugin_name ) )
     406                                )
    399407                        );
    400408                }
     
    506514        echo '<tr class="plugin-update-tr' . $active . '" id="' . esc_attr( $theme->get_stylesheet() . '-update' ) . '" data-slug="' . esc_attr( $theme->get_stylesheet() ) . '"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message notice inline notice-warning notice-alt"><p>';
    507515        if ( ! current_user_can( 'update_themes' ) ) {
    508                 /* translators: 1: theme name, 2: details URL, 3: accessibility text, 4: version number */
    509                 printf( __( '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>.'),
     516                /* translators: 1: theme name, 2: details URL, 3: additional link attributes, 4: version number */
     517                printf( __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.'),
    510518                        $theme['Name'],
    511519                        esc_url( $details_url ),
    512                         /* translators: 1: theme name, 2: version number */
    513                         esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) ),
     520                        sprintf( 'class="thickbox open-plugin-details-modal" aria-label="%s"',
     521                                /* translators: 1: theme name, 2: version number */
     522                                esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )
     523                        ),
    514524                        $response['new_version']
    515525                );
    516526        } elseif ( empty( $response['package'] ) ) {
    517                 /* translators: 1: theme name, 2: details URL, 3: accessibility text, 4: version number */
    518                 printf( __( '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>' ),
     527                /* translators: 1: theme name, 2: details URL, 3: additional link attributes, 4: version number */
     528                printf( __( '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>' ),
    519529                        $theme['Name'],
    520530                        esc_url( $details_url ),
    521                         /* translators: 1: theme name, 2: version number */
    522                         esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) ),
     531                        sprintf( 'class="thickbox open-plugin-details-modal" aria-label="%s"',
     532                                /* translators: 1: theme name, 2: version number */
     533                                esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )
     534                        ),
    523535                        $response['new_version']
    524536                );
    525537        } else {
    526                 /* translators: 1: theme name, 2: details URL, 3: accessibility text, 4: version number, 5: update URL, 6: accessibility text */
    527                 printf( __( '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" class="update-link" aria-label="%6$s">update now</a>.' ),
     538                /* translators: 1: theme name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
     539                printf( __( '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>.' ),
    528540                        $theme['Name'],
    529541                        esc_url( $details_url ),
    530                         /* translators: 1: theme name, 2: version number */
    531                         esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) ),
     542                        sprintf( 'class="thickbox open-plugin-details-modal" aria-label="%s"',
     543                                /* translators: 1: theme name, 2: version number */
     544                                esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )
     545                        ),
    532546                        $response['new_version'],
    533547                        wp_nonce_url( self_admin_url( 'update.php?action=upgrade-theme&theme=' ) . $theme_key, 'upgrade-theme_' . $theme_key ),
    534                         /* translators: %s: theme name */
    535                         esc_attr( sprintf( __( 'Update %s now' ), $theme['Name'] ) )
     548                        sprintf( 'class="update-link" aria-label="%s"',
     549                                /* translators: %s: theme name */
     550                                esc_attr( sprintf( __( 'Update %s now' ), $theme['Name'] ) )
     551                        )
    536552                );
    537553        }
Note: See TracChangeset for help on using the changeset viewer.