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/file.php

    r45674 r45926  
    8888        $template_data = implode( '', file( $file_path ) );
    8989        if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) ) {
     90            /* translators: %s: template name */
    9091            return sprintf( __( '%s Page Template' ), _cleanup_header_comment( $name[1] ) );
    9192        }
     
    872873                $error_path = basename( $uploads['basedir'] ) . $uploads['subdir'];
    873874            }
    874             return $upload_error_handler( $file, sprintf( __( 'The uploaded file could not be moved to %s.' ), $error_path ) );
     875            return $upload_error_handler(
     876                $file,
     877                sprintf(
     878                    /* translators: %s: destination file path */
     879                    __( 'The uploaded file could not be moved to %s.' ),
     880                    $error_path
     881                )
     882            );
    875883        }
    876884    }
     
    11551163    }
    11561164
    1157     return new WP_Error( 'md5_mismatch', sprintf( __( 'The checksum of the file (%1$s) does not match the expected checksum value (%2$s).' ), bin2hex( $file_md5 ), bin2hex( $expected_raw_md5 ) ) );
     1165    return new WP_Error(
     1166        'md5_mismatch',
     1167        sprintf(
     1168            /* translators: 1: file checksum, 2: expected checksum value */
     1169            __( 'The checksum of the file (%1$s) does not match the expected checksum value (%2$s).' ),
     1170            bin2hex( $file_md5 ),
     1171            bin2hex( $expected_raw_md5 )
     1172        )
     1173    );
    11581174}
    11591175
Note: See TracChangeset for help on using the changeset viewer.