WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/01/2019 05:12:43 PM (7 weeks ago)
Author:
SergeyBiryukov
Message:

I18N: Improve translator comments.

  • Add missing translator comments.
  • Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various .pot file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.

Includes minor code layout fixes.

Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!

Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-plugin-installer-skin.php

    r43598 r45926  
    4343    public function before() {
    4444        if ( ! empty( $this->api ) ) {
    45             /* translators: 1: name of API, 2: version of API */
    46             $this->upgrader->strings['process_success'] = sprintf( __( 'Successfully installed the plugin <strong>%1$s %2$s</strong>.' ), $this->api->name, $this->api->version );
     45            $this->upgrader->strings['process_success'] = sprintf(
     46                /* translators: 1: plugin name, 2: plugin version */
     47                __( 'Successfully installed the plugin <strong>%1$s %2$s</strong>.' ),
     48                $this->api->name,
     49                $this->api->version
     50            );
    4751        }
    4852    }
     
    5862
    5963        if ( 'import' == $from ) {
    60             $install_actions['activate_plugin'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&amp;from=import&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Activate Plugin &amp; Run Importer' ) . '</a>';
     64            $install_actions['activate_plugin'] = sprintf(
     65                '<a class="button button-primary" href="%s" target="_parent">%s</a>',
     66                wp_nonce_url( 'plugins.php?action=activate&amp;from=import&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),
     67                __( 'Activate Plugin &amp; Run Importer' )
     68            );
    6169        } elseif ( 'press-this' == $from ) {
    62             $install_actions['activate_plugin'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&amp;from=press-this&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Activate Plugin &amp; Return to Press This' ) . '</a>';
     70            $install_actions['activate_plugin'] = sprintf(
     71                '<a class="button button-primary" href="%s" target="_parent">%s</a>',
     72                wp_nonce_url( 'plugins.php?action=activate&amp;from=press-this&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),
     73                __( 'Activate Plugin &amp; Return to Press This' )
     74            );
    6375        } else {
    64             $install_actions['activate_plugin'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Activate Plugin' ) . '</a>';
     76            $install_actions['activate_plugin'] = sprintf(
     77                '<a class="button button-primary" href="%s" target="_parent">%s</a>',
     78                wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),
     79                __( 'Activate Plugin' )
     80            );
    6581        }
    6682
    6783        if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) {
    68             $install_actions['network_activate'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Network Activate' ) . '</a>';
     84            $install_actions['network_activate'] = sprintf(
     85                '<a class="button button-primary" href="%s" target="_parent">%s</a>',
     86                wp_nonce_url( 'plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),
     87                __( 'Network Activate' )
     88            );
    6989            unset( $install_actions['activate_plugin'] );
    7090        }
    7191
    7292        if ( 'import' == $from ) {
    73             $install_actions['importers_page'] = '<a href="' . admin_url( 'import.php' ) . '" target="_parent">' . __( 'Return to Importers' ) . '</a>';
     93            $install_actions['importers_page'] = sprintf(
     94                '<a href="%s" target="_parent">%s</a>',
     95                admin_url( 'import.php' ),
     96                __( 'Return to Importers' )
     97            );
    7498        } elseif ( $this->type == 'web' ) {
    75             $install_actions['plugins_page'] = '<a href="' . self_admin_url( 'plugin-install.php' ) . '" target="_parent">' . __( 'Return to Plugin Installer' ) . '</a>';
     99            $install_actions['plugins_page'] = sprintf(
     100                '<a href="%s" target="_parent">%s</a>',
     101                self_admin_url( 'plugin-install.php' ),
     102                __( 'Return to Plugin Installer' )
     103            );
    76104        } elseif ( 'upload' == $this->type && 'plugins' == $from ) {
    77             $install_actions['plugins_page'] = '<a href="' . self_admin_url( 'plugin-install.php' ) . '">' . __( 'Return to Plugin Installer' ) . '</a>';
     105            $install_actions['plugins_page'] = sprintf(
     106                '<a href="%s">%s</a>',
     107                self_admin_url( 'plugin-install.php' ),
     108                __( 'Return to Plugin Installer' )
     109            );
    78110        } else {
    79             $install_actions['plugins_page'] = '<a href="' . self_admin_url( 'plugins.php' ) . '" target="_parent">' . __( 'Return to Plugins page' ) . '</a>';
     111            $install_actions['plugins_page'] = sprintf(
     112                '<a href="%s" target="_parent">%s</a>',
     113                self_admin_url( 'plugins.php' ),
     114                __( 'Return to Plugins page' )
     115            );
    80116        }
    81117
Note: See TracChangeset for help on using the changeset viewer.