Make WordPress Core

Changeset 34344


Ignore:
Timestamp:
09/20/2015 03:00:57 AM (10 years ago)
Author:
wonderboymusic
Message:

Plugins Admin: Avoid using HTML tags in translation strings, add translator strings.

Props swissspidy, voldemortensen.
Fixes #32269.

File:
1 edited

Legend:

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

    r34018 r34344  
    373373'content'   =>
    374374    '<p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>' .
    375     '<p>' . sprintf(__('You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your <code>/wp-content/plugins</code> directory. Once a plugin has been installed, you can activate it here.'), 'plugin-install.php', 'https://wordpress.org/plugins/') . '</p>'
     375    '<p>' . sprintf(
     376        /* translators: 1: Plugin Browser/Installer URL, 2: WordPress Plugin Directory URL 3: local plugin directory */
     377        __( 'You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your %3$s directory. Once a plugin has been installed, you can activate it here.' ),
     378        'plugin-install.php',
     379        'https://wordpress.org/plugins/',
     380        '<code>/wp-content/plugins</code>'
     381    ) . '</p>'
    376382) );
    377383get_current_screen()->add_help_tab( array(
     
    380386'content'   =>
    381387    '<p>' . __('Most of the time, plugins play nicely with the core of WordPress and with other plugins. Sometimes, though, a plugin&#8217;s code will get in the way of another plugin, causing compatibility issues. If your site starts doing strange things, this may be the problem. Try deactivating all your plugins and re-activating them in various combinations until you isolate which one(s) caused the issue.') . '</p>' .
    382     '<p>' . sprintf( __('If something goes wrong with a plugin and you can&#8217;t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.'), WP_PLUGIN_DIR) . '</p>'
     388    '<p>' . sprintf(
     389        /* translators: WP_PLUGIN_DIR constant value */
     390        __( 'If something goes wrong with a plugin and you can&#8217;t use WordPress, delete or rename that file in the %s directory and it will be automatically deactivated.' ),
     391        '<code>' . WP_PLUGIN_DIR . '</code>'
     392    ) . '</p>'
    383393) );
    384394
     
    395405
    396406$invalid = validate_active_plugins();
    397 if ( !empty($invalid) )
    398     foreach ( $invalid as $plugin_file => $error )
    399         echo '<div id="message" class="error"><p>' . sprintf(__('The plugin <code>%s</code> has been <strong>deactivated</strong> due to an error: %s'), esc_html($plugin_file), $error->get_error_message()) . '</p></div>';
     407if ( ! empty( $invalid ) ) {
     408    foreach ( $invalid as $plugin_file => $error ) {
     409        echo '<div id="message" class="error"><p>';
     410        printf(
     411            /* translators: 1: plugin file 2: error message */
     412            __( 'The plugin %1$s has been <strong>deactivated</strong> due to an error: %2$s' ),
     413            '<code>' . esc_html( $plugin_file ) . '</code>',
     414            $error->get_error_message() );
     415        echo '</p></div>';
     416    }
     417}
    400418?>
    401419
Note: See TracChangeset for help on using the changeset viewer.