Make WordPress Core

Changeset 43667


Ignore:
Timestamp:
10/02/2018 07:29:18 PM (6 years ago)
Author:
pento
Message:

Plugins: Pluralise the "unexpected output during activation" message.

When a plugin is activated, it can trigger a warning message if it outputs data at that time. This error message was being run through __(), instead of _n(), so it wasn't possible to correctly pluralise the message.

Props jamosova.
Fixes #42355.

File:
1 edited

Legend:

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

    r43571 r43667  
    480480        $errmsg = __( 'You cannot delete a plugin while it is active on the main site.' );
    481481    } elseif ( isset( $_GET['charsout'] ) ) {
    482         $errmsg = sprintf( __( 'The plugin generated %d characters of <strong>unexpected output</strong> during activation. If you notice &#8220;headers already sent&#8221; messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' ), $_GET['charsout'] );
     482        $errmsg  = sprintf(
     483            _n(
     484                'The plugin generated %d character of <strong>unexpected output</strong> during activation.',
     485                'The plugin generated %d characters of <strong>unexpected output</strong> during activation.',
     486                $_GET['charsout']
     487            ),
     488            $_GET['charsout']
     489        );
     490        $errmsg .= ' ' . __( 'If you notice &#8220;headers already sent&#8221; messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' );
    483491    } else {
    484492        $errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' );
Note: See TracChangeset for help on using the changeset viewer.