Making WordPress.org

Changeset 7023


Ignore:
Timestamp:
04/04/2018 01:02:29 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Plugin Directory: Make readme validator strings more i18n-friendly.

Fixes #3546.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php

    r7021 r7023  
    3232
    3333        if ( strtolower( substr( $url, -10 ) ) != 'readme.txt' ) {
    34             /* Translators: File name; */
     34            /* translators: %s: readme.txt */
    3535            $error = sprintf( __( 'URL must end in %s!', 'wporg-plugins' ), '<code>readme.txt</code>' );
    3636            return array(
     
    6464        // Fatal errors.
    6565        if ( empty( $readme->name ) ) {
    66             /* Translators: Plugin header tag; */
     66            /* translators: %s: 'Plugin Name' section title */
    6767            $errors[] = sprintf( __( 'No plugin name detected. Plugin names look like: %s', 'wporg-plugins' ), '<code>=== Plugin Name ===</code>' );
    6868        }
     
    7070        // Warnings.
    7171        if ( empty( $readme->requires ) ) {
    72             /* Translators: Plugin header tag; */
    73             $warnings[] = sprintf( __( '%s is missing.', 'wporg-plugins' ), '<code>Requires at least</code>' );
     72            /* translators: %s: plugin header tag */
     73            $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Requires at least</code>' );
    7474        }
    7575        if ( empty( $readme->tested ) ) {
    76             /* Translators: Plugin header tag; */
    77             $warnings[] = sprintf( __( '%s is missing.', 'wporg-plugins' ), '<code>Tested up to</code>' );
     76            /* translators: %s: plugin header tag */
     77            $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Tested up to</code>' );
    7878        }
    7979        if ( empty( $readme->requires_php ) ) {
    80             /* Translators: Plugin header tag; */
    81             $warnings[] = sprintf( __( '%s is missing.', 'wporg-plugins' ), '<code>Requires PHP</code>' );
     80            /* translators: %s: plugin header tag */
     81            $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Requires PHP</code>' );
    8282        }
    8383        if ( empty( $readme->stable_tag ) ) {
    84             /* Translators: 1: Plugin header tag; 2: SVN directory; 3: Plugin header tag; */
    85             $warnings[] = sprintf( __( '%1$s is missing.  Hint: If you treat %2$s as stable, put %3$s.', 'wporg-plugins' ), '<code>Stable tag</code>', '<code>/trunk/</code>', '<code>Stable tag: trunk</code>' );
     84            /* translators: 1: 'Stable tag', 2: /trunk/ SVN directory, 3: 'Stable tag: trunk' */
     85            $warnings[] = sprintf( __( '%1$s field is missing.  Hint: If you treat %2$s as stable, put %3$s.', 'wporg-plugins' ), '<code>Stable tag</code>', '<code>/trunk/</code>', '<code>Stable tag: trunk</code>' );
    8686        }
    8787        if ( ! count( $readme->contributors ) ) {
    88             /* Translators: Plugin header tag; */
    89             $warnings[] = sprintf( __( 'No %s listed.', 'wporg-plugins' ), '<code>Contributors</code>' );
     88            /* translators: %s: plugin header tag */
     89            $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Contributors</code>' );
    9090        }
    9191        if ( $readme->contributor_ignored ) {
    92             /* Translators: 1: Plugin header tag; */
    93             $warnings[] = sprintf( __( 'One or more %1$s listed were ignored. %1$s should only contain WordPress.org usernames.', 'wporg-plugins' ), '<code>Contributors</code>' );
     92            /* translators: %s: plugin header tag */
     93            $warnings[] = sprintf( __( 'One or more contributors listed were ignored. %s field should only contain WordPress.org usernames.', 'wporg-plugins' ), '<code>Contributors</code>' );
    9494        }
    9595
    9696        // Notes.
    9797        if ( empty( $readme->sections['faq'] ) ) {
    98             /* Translators: Plugin header tag; */
     98            /* translators: %s: section title */
    9999            $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Frequently Asked Questions ==</code>' );
    100100        }
    101101        if ( empty( $readme->sections['changelog'] ) ) {
    102             /* Translators: Plugin header tag; */
     102            /* translators: %s: section title */
    103103            $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Changelog ==</code>' );
    104104        }
    105105        if ( empty( $readme->upgrade_notice ) ) {
    106             /* Translators: Plugin header tag; */
     106            /* translators: %s: section title */
    107107            $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Upgrade Notice ==</code>' );
    108108        }
    109109        if ( empty( $readme->screenshots ) ) {
    110             /* Translators: Plugin header tag; */
     110            /* translators: %s: section title */
    111111            $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Screenshots ==</code>' );
    112112        }
Note: See TracChangeset for help on using the changeset viewer.