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-includes/functions.php

    r45917 r45926  
    25262526    $ifp = @fopen( $new_file, 'wb' );
    25272527    if ( ! $ifp ) {
    2528         return array( 'error' => sprintf( __( 'Could not write file %s' ), $new_file ) );
     2528        return array(
     2529            /* translators: %s: file name */
     2530            'error' => sprintf( __( 'Could not write file %s' ), $new_file ),
     2531        );
    25292532    }
    25302533
     
    46314634        if ( function_exists( '__' ) ) {
    46324635            if ( ! empty( $parent_class ) ) {
    4633                 /* translators: 1: PHP class name, 2: PHP parent class name, 3: version number, 4: __construct() method */
    46344636                trigger_error(
    46354637                    sprintf(
     4638                        /* translators: 1: PHP class name, 2: PHP parent class name, 3: version number, 4: __construct() method */
    46364639                        __( 'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.' ),
    46374640                        $class,
     
    46424645                );
    46434646            } else {
    4644                 /* translators: 1: PHP class name, 2: version number, 3: __construct() method */
    46454647                trigger_error(
    46464648                    sprintf(
     4649                        /* translators: 1: PHP class name, 2: version number, 3: __construct() method */
    46474650                        __( 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
    46484651                        $class,
     
    49024905                $version = sprintf( __( '(This message was added in version %s.)' ), $version );
    49034906            }
    4904             /* translators: %s: Documentation URL */
    49054907            $message .= ' ' . sprintf(
     4908                /* translators: %s: Documentation URL */
    49064909                __( 'Please see <a href="%s">Debugging in WordPress</a> for more information.' ),
    49074910                __( 'https://wordpress.org/support/article/debugging-in-wordpress/' )
     
    67576760        'headers' => '',
    67586761    );
     6762
    67596763    // get site name
    67606764    $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
Note: See TracChangeset for help on using the changeset viewer.