WordPress.org

Making WordPress.org

Changeset 3413


Ignore:
Timestamp:
06/17/2016 12:52:47 PM (3 years ago)
Author:
obenland
Message:

Plugin Directory: Don't make readme tags available for i18n.

See #1571.

File:
1 edited

Legend:

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

    r3383 r3413  
    7777
    7878            if ( strtolower( substr( $url, - 10, 10 ) ) != 'readme.txt' ) {
    79                 add_settings_error( 'wporg-plugins', 'readme-validator', __( 'URL must end in <code>readme.txt</code>!', 'wporg-plugins' ) );
     79                /* Translators: File name; */
     80                add_settings_error( 'wporg-plugins', 'readme-validator', sprintf( __( 'URL must end in %s!', 'wporg-plugins' ), '<code>readme.txt</code>' ) );
    8081                return;
    8182            }
     
    99100        // Fatal errors.
    100101        if ( empty( $readme->name ) ) {
    101             add_settings_error( 'wporg-plugins', 'readme-validator', __( "Fatal Error:\nNo plugin name detected. Plugin names look like: <code>=== Plugin Name ===</code>", 'wporg-plugins' ) );
     102            /* Translators: Plugin header tag; */
     103            add_settings_error( 'wporg-plugins', 'readme-validator', sprintf( __( "Fatal Error:\nNo plugin name detected. Plugin names look like: %s", 'wporg-plugins' ), '<code>=== Plugin Name ===</code>' ) );
    102104            return;
    103105        }
     
    105107        // Warnings.
    106108        if ( empty( $readme->requires_at_least ) ) {
    107             $warnings[] = __( '<code>Requires at least</code> is missing.', 'wporg-plugins' );
     109            /* Translators: Plugin header tag; */
     110            $warnings[] = sprintf( __( '%s is missing.', 'wporg-plugins' ), '<code>Requires at least</code>' );
    108111        }
    109112        if ( empty( $readme->tested_up_to ) ) {
    110             $warnings[] = __( '<code>Tested up to</code> is missing.', 'wporg-plugins' );
     113            /* Translators: Plugin header tag; */
     114            $warnings[] = sprintf( __( '%s is missing.', 'wporg-plugins' ), '<code>Tested up to</code>' );
    111115        }
    112116        if ( empty( $readme->stable_tag ) ) {
    113             $warnings[] = __( '<code>Stable tag</code> is missing.  Hint: If you treat <code>/trunk/</code> as stable, put <code>Stable tag: trunk</code>.', 'wporg-plugins' );
     117            /* Translators: 1: Plugin header tag; 2: SVN directory; 3: Plugin header tag; */
     118            $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>' );
    114119        }
    115120        if ( ! count( $readme->contributors ) ) {
    116             $warnings[] = __( 'No <code>Contributors</code> listed.', 'wporg-plugins' );
     121            /* Translators: Plugin header tag; */
     122            $warnings[] = sprintf( __( 'No %s listed.', 'wporg-plugins' ), '<code>Contributors</code>' );
    117123        }
    118124        if ( ! count( $readme->tags ) ) {
    119             $warnings[] = __( 'No <code>Tags</code> specified', 'wporg-plugins' );
     125            /* Translators: Plugin header tag; */
     126            $warnings[] = sprintf( __( 'No %s specified', 'wporg-plugins' ), '<code>Tags</code>' );
    120127        }
    121128        if ( ! empty( $readme->is_excerpt ) ) {
    122             $warnings[] = __( 'No <code>== Description ==</code> section was found... your short description section will be used instead.', 'wporg-plugins' );
     129            /* Translators: Plugin header tag; */
     130            $warnings[] = sprintf( __( 'No %s section was found... your short description section will be used instead.', 'wporg-plugins' ), '<code>== Description ==</code>' );
    123131        }
    124132        if ( ! empty( $readme->is_truncated ) ) {
     
    139147        // Notes.
    140148        if ( empty( $readme->license ) ) {
    141             $notes[] = __( 'No <code>License</code> is specified. WordPress is licensed under &#8220;GPLv2 or later&#8221;', 'wporg-plugins' );
     149            /* Translators: Plugin header tag; */
     150            $notes[] = sprintf( __( 'No %s is specified. WordPress is licensed under &#8220;GPLv2 or later&#8221;', 'wporg-plugins' ), '<code>License</code>' );
    142151        }
    143152        if ( empty( $readme->sections['installation'] ) ) {
    144             $notes[] = __( 'No <code>== Installation ==</code> section was found', 'wporg-plugins' );
     153            /* Translators: Plugin header tag; */
     154            $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Installation ==</code>' );
    145155        }
    146156        if ( empty( $readme->sections['frequently_asked_questions'] ) ) {
    147             $notes[] = __( 'No <code>== Frequently Asked Questions ==</code> section was found', 'wporg-plugins' );
     157            /* Translators: Plugin header tag; */
     158            $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Frequently Asked Questions ==</code>' );
    148159        }
    149160        if ( empty( $readme->sections['changelog'] ) ) {
    150             $notes[] = __( 'No <code>== Changelog ==</code> section was found', 'wporg-plugins' );
     161            /* Translators: Plugin header tag; */
     162            $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Changelog ==</code>' );
    151163        }
    152164        if ( empty( $readme->upgrade_notice ) ) {
    153             $notes[] = __( 'No <code>== Upgrade Notice ==</code> section was found', 'wporg-plugins' );
     165            /* Translators: Plugin header tag; */
     166            $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Upgrade Notice ==</code>' );
    154167        }
    155168        if ( empty( $readme->sections['screenshots'] ) ) {
    156             $notes[] = __( 'No <code>== Screenshots ==</code> section was found', 'wporg-plugins' );
     169            /* Translators: Plugin header tag; */
     170            $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Screenshots ==</code>' );
    157171        }
    158172        if ( empty( $readme->donate_link ) ) {
     
    171185        }
    172186
    173         add_settings_error( 'wporg-plugins', 'readme-validator', __( 'Your <code>readme.txt</code> rocks.  Seriously.  Flying colors.', 'wporg-plugins' ), 'updated' );
     187        /* Translators: File name; */
     188        add_settings_error( 'wporg-plugins', 'readme-validator', sprintf( __( 'Your %s rocks.  Seriously.  Flying colors.', 'wporg-plugins' ), '<code>readme.txt</code>' ), 'updated' );
    174189    }
    175190
     
    178193     */
    179194    public function section_description() {
    180         echo '<p>' . __( 'Enter the URL to your <code>readme.txt</code> file or paste its content below.' ) . '</p>';
     195        /* Translators: File name; */
     196        echo '<p>' . sprintf( __( 'Enter the URL to your %s file or paste its content below.' ), '<code>readme.txt</code>' ) . '</p>';
    181197    }
    182198
Note: See TracChangeset for help on using the changeset viewer.