Making WordPress.org


Ignore:
Timestamp:
03/16/2019 09:35:34 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Plugin Directory, Readme Validator: Clean up some strings to be less confusing to non-native English speakers.

Props Ipstenu.
Fixes #4291.

File:
1 edited

Legend:

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

    r7874 r8469  
    3232
    3333                if ( strtolower( substr( $url, -10 ) ) != 'readme.txt' ) {
    34                         /* translators: %s: readme.txt */
    35                         $error = sprintf( __( 'URL must end in %s!', 'wporg-plugins' ), '<code>readme.txt</code>' );
     34                        $error = sprintf(
     35                                /* translators: %s: readme.txt */
     36                                __( 'URL must end in %s!', 'wporg-plugins' ),
     37                                '<code>readme.txt</code>'
     38                        );
    3639                        return array(
    3740                                'errors' => array( $error ),
    … …  
    6467                // Fatal errors.
    6568                if ( empty( $readme->name ) ) {
    66                         /* translators: 1: 'Plugin Name' section title, 2: 'Plugin Name' */
    67                         $errors[] = sprintf( __( 'No plugin name detected. Plugin names look like: %1$s. Please change %2$s to reflect the actual name of your plugin.', 'wporg-plugins' ), '<code>=== Plugin Name ===</code>', '<code>Plugin Name</code>' );
     69                        $errors[] = sprintf(
     70                                /* translators: 1: 'Plugin Name' section title, 2: 'Plugin Name' */
     71                                __( 'We cannot find a plugin name in your readme. Plugin names look like: %1$s. Please change %2$s to reflect the actual name of your plugin.', 'wporg-plugins' ),
     72                                '<code>=== Plugin Name ===</code>',
     73                                '<code>Plugin Name</code>'
     74                        );
    6875                }
    6976
    … …  
    7279                        $latest_wordpress_version = defined( 'WP_CORE_STABLE_BRANCH' ) ? WP_CORE_STABLE_BRANCH : '5.0';
    7380
    74                         /* translators: 1: plugin header tag; 2: Example version 5.0. 3: Example version 4.9. */
    7581                        $warnings[] = sprintf(
    76                                 __( 'The Requires at least field was ignored. %1$s field should only contain a valid WordPress version such as %2$s or %3$s.', 'wporg-plugins' ),
     82                                /* translators: 1: plugin header tag; 2: Example version 5.0. 3: Example version 4.9. */
     83                                __( 'The %1$s field was ignored. This field should only contain a valid WordPress version such as %2$s or %3$s.', 'wporg-plugins' ),
    7784                                '<code>Requires at least</code>',
    7885                                '<code>' . number_format( $latest_wordpress_version, 1 ) . '</code>',
    … …  
    8087                        );
    8188                } elseif ( empty( $readme->requires ) ) {
    82                         /* translators: %s: plugin header tag */
    83                         $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Requires at least</code>' );
     89                        $warnings[] = sprintf(
     90                                /* translators: %s: plugin header tag */
     91                                __( 'The %s field is missing.', 'wporg-plugins' ),
     92                                '<code>Requires at least</code>'
     93                        );
    8494                }
    8595
    … …  
    8797                        $latest_wordpress_version = defined( 'WP_CORE_STABLE_BRANCH' ) ? WP_CORE_STABLE_BRANCH : '5.0';
    8898
    89                         /* translators: 1: plugin header tag; 2: Example version 5.0. 3: Example version 5.1. */
    9099                        $warnings[] = sprintf(
    91                                 __( 'The Tested up to field was ignored. %1$s field should only contain a valid WordPress version such as %2$s or %3$s.', 'wporg-plugins' ),
     100                                /* translators: 1: plugin header tag; 2: Example version 5.0. 3: Example version 5.1. */
     101                                __( 'The %1$s field was ignored. This field should only contain a valid WordPress version such as %2$s or %3$s.', 'wporg-plugins' ),
    92102                                '<code>Tested up to</code>',
    93103                                '<code>' . number_format( $latest_wordpress_version, 1 ) . '</code>',
    … …  
    95105                        );
    96106                } elseif ( empty( $readme->tested ) ) {
    97                         /* translators: %s: plugin header tag */
    98                         $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Tested up to</code>' );
     107                        $warnings[] = sprintf(
     108                                /* translators: %s: plugin header tag */
     109                                __( 'The %s field is missing.', 'wporg-plugins' ),
     110                                '<code>Tested up to</code>'
     111                        );
    99112                }
    100113
    101114                if ( isset( $readme->warnings['requires_php_header_ignored'] ) ) {
    102                         /* translators: 1: plugin header tag; 2: Example version 5.2.4. 3: Example version 7.0. */
    103                         $warnings[] = sprintf( __( 'The Requires PHP field was ignored. %1$s field should only contain a PHP version such as %2$s or %3$s.', 'wporg-plugins' ), '<code>Requires PHP</code>', '<code>5.2.4</code>', '<code>7.0</code>' );
     115                        $warnings[] = sprintf(
     116                                /* translators: 1: plugin header tag; 2: Example version 5.2.4. 3: Example version 7.0. */
     117                                __( 'The %1$s field was ignored. This field should only contain a PHP version such as %2$s or %3$s.', 'wporg-plugins' ),
     118                                '<code>Requires PHP</code>',
     119                                '<code>5.2.4</code>',
     120                                '<code>7.0</code>'
     121                        );
    104122                } elseif ( empty( $readme->requires_php ) ) {
    105                         /* translators: %s: plugin header tag */
    106                         $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Requires PHP</code>' );
     123                        $warnings[] = sprintf(
     124                                /* translators: %s: plugin header tag */
     125                                __( 'The %s field is missing.', 'wporg-plugins' ),
     126                                '<code>Requires PHP</code>'
     127                        );
    107128                }
    108129                if ( empty( $readme->stable_tag ) ) {
    109                         /* translators: 1: 'Stable tag', 2: /trunk/ SVN directory, 3: 'Stable tag: trunk' */
    110                         $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>' );
     130                        $warnings[] = sprintf(
     131                                /* translators: 1: 'Stable tag', 2: /trunk/ SVN directory, 3: 'Stable tag: trunk' */
     132                                __( 'The %1$s field is missing.  Hint: If you treat %2$s as stable, put %3$s.', 'wporg-plugins' ),
     133                                '<code>Stable tag</code>',
     134                                '<code>/trunk/</code>',
     135                                '<code>Stable tag: trunk</code>'
     136                        );
    111137                }
    112138
    113139                if ( isset( $readme->warnings['contributor_ignored'] ) ) {
    114                         /* translators: %s: plugin header tag */
    115                         $warnings[] = sprintf( __( 'One or more contributors listed were ignored. %s field should only contain WordPress.org usernames.', 'wporg-plugins' ), '<code>Contributors</code>' );
     140                        $warnings[] = sprintf(
     141                                /* translators: %s: plugin header tag */
     142                                __( 'One or more contributors listed were ignored. The %s field should only contain WordPress.org usernames. Remember that usernames are case-sensitive.', 'wporg-plugins' ),
     143                                '<code>Contributors</code>'
     144                        );
    116145                } elseif ( ! count( $readme->contributors ) ) {
    117                         /* translators: %s: plugin header tag */
    118                         $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Contributors</code>' );
     146                        $warnings[] = sprintf(
     147                                /* translators: %s: plugin header tag */
     148                                __( 'The %s field is missing.', 'wporg-plugins' ),
     149                                '<code>Contributors</code>'
     150                        );
    119151                }
    120152
    121153                // Notes.
    122154                if ( empty( $readme->sections['faq'] ) ) {
    123                         /* translators: %s: section title */
    124                         $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Frequently Asked Questions ==</code>' );
     155                        $notes[] = sprintf(
     156                                /* translators: %s: section title */
     157                                __( 'No %s section was found', 'wporg-plugins' ),
     158                                '<code>== Frequently Asked Questions ==</code>'
     159                        );
    125160                }
    126161                if ( empty( $readme->sections['changelog'] ) ) {
    127                         /* translators: %s: section title */
    128                         $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Changelog ==</code>' );
     162                        $notes[] = sprintf(
     163                                /* translators: %s: section title */
     164                                __( 'No %s section was found', 'wporg-plugins' ),
     165                                '<code>== Changelog ==</code>'
     166                        );
    129167                }
    130168                if ( empty( $readme->upgrade_notice ) ) {
    131                         /* translators: %s: section title */
    132                         $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Upgrade Notice ==</code>' );
     169                        $notes[] = sprintf(
     170                                /* translators: %s: section title */
     171                                __( 'No %s section was found', 'wporg-plugins' ),
     172                                '<code>== Upgrade Notice ==</code>'
     173                        );
    133174                }
    134175                if ( empty( $readme->screenshots ) ) {
    135                         /* translators: %s: section title */
    136                         $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Screenshots ==</code>' );
     176                        $notes[] = sprintf(
     177                                /* translators: %s: section title */
     178                                __( 'No %s section was found', 'wporg-plugins' ),
     179                                '<code>== Screenshots ==</code>'
     180                        );
    137181                }
    138182                if ( empty( $readme->donate_link ) ) {
Note: See TracChangeset for help on using the changeset viewer.