Making WordPress.org

Ticket #2757: 2757.patch

File 2757.patch, 4.5 KB (added by SergeyBiryukov, 8 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php

     
    7575                if ( empty( $this->plugin['Name'] ) ) {
    7676                        $error = __( 'The plugin has no name.', 'wporg-plugins' );
    7777
    78                         /* translators: 1: comment header line, 2: Codex URL */
     78                        /* translators: 1: plugin header line, 2: Codex URL */
    7979                        return $error . ' ' . sprintf( __( 'Add a %1$s line to your main plugin file and upload the plugin again. <a href="%2$s">Plugin Headers</a>', 'wporg-plugins' ),
    8080                                '<code>Plugin Name:</code>',
    8181                                __( 'https://codex.wordpress.org/File_Header', 'wporg-plugins' )
     
    8787
    8888                // Make sure it doesn't use a slug deemed not to be used by the public.
    8989                if ( $this->has_reserved_slug() ) {
    90                         /* translators: %s: plugin slug */
    91                         return sprintf( __( 'Sorry, the plugin name %s is reserved for use by WordPress. Please change the name of your plugin and upload it again.', 'wporg-plugins' ),
    92                                 '<code>' . $this->plugin_slug . '</code>'
     90                        /* translators: 1: plugin slug, 2: 'Plugin Name:' */
     91                        return sprintf( __( 'Sorry, the plugin name %1%s is reserved for use by WordPress. Please change the %2$s line in your main plugin file and upload it again.', 'wporg-plugins' ),
     92                                '<code>' . $this->plugin_slug . '</code>',
     93                                '<code>Plugin Name:</code>'
    9394                        );
    9495                }
    9596
     
    9798
    9899                // Is there already a plugin by a different author?
    99100                if ( $plugin_post && $plugin_post->post_author != get_current_user_id() ) {
    100                         /* translators: %s: plugin slug */
    101                         return sprintf( __( 'There is already a plugin called %s by a different author. Please change the name of your plugin in the plugin header file and upload it again.', 'wporg-plugins' ),
    102                                 '<code>' . $this->plugin_slug . '</code>'
     101                        /* translators: 1: plugin slug, 2: 'Plugin Name:' */
     102                        return sprintf( __( 'There is already a plugin called %1$s by a different author. Please change the %2$s line in your main plugin file and upload it again.', 'wporg-plugins' ),
     103                                '<code>' . $this->plugin_slug . '</code>',
     104                                '<code>Plugin Name:</code>'
    103105                        );
    104106                }
    105107
    106108                // Check the plugin can accept uploads (New submissions, or pending further review).
    107109                if ( $plugin_post && ! in_array( $plugin_post->post_status, array( 'new', 'pending' ) ) ) {
    108                         /* translators: %s: plugin slug */
    109                         return sprintf( __( 'There is already a plugin called %s. Please change the name of your plugin in the plugin header file and upload it again.', 'wporg-plugins' ),
    110                                 '<code>' . $this->plugin_slug . '</code>'
     110                        /* translators: 1: plugin slug, 2: 'Plugin Name:' */
     111                        return sprintf( __( 'There is already a plugin called %1$s. Please change the %2$s line in your main plugin file and upload it again.', 'wporg-plugins' ),
     112                                '<code>' . $this->plugin_slug . '</code>',
     113                                '<code>Plugin Name:</code>'
    111114                        );
    112115                }
    113116
     
    114117                if ( ! $this->plugin['Description'] ) {
    115118                        $error = __( 'The plugin has no description.', 'wporg-plugins' );
    116119
    117                         /* translators: 1: comment header line, 2: Codex URL */
     120                        /* translators: 1: plugin header line, 2: Codex URL */
    118121                        return $error . ' ' . sprintf( __( 'Add a %1$s line to your main plugin file and upload the plugin again. <a href="%2$s">Plugin Headers</a>', 'wporg-plugins' ),
    119122                                '<code>Description:</code>',
    120123                                __( 'https://codex.wordpress.org/File_Header', 'wporg-plugins' )
     
    124127                if ( ! $this->plugin['Version'] ) {
    125128                        $error = __( 'The plugin has no version.', 'wporg-plugins' );
    126129
    127                         /* translators: 1: comment header line, 2: Codex URL */
     130                        /* translators: 1: plugin header line, 2: Codex URL */
    128131                        return $error . ' ' . sprintf( __( 'Add a %1$s line to your main plugin file and upload the plugin again. <a href="%2$s">Plugin Headers</a>', 'wporg-plugins' ),
    129132                                '<code>Version:</code>',
    130133                                __( 'https://codex.wordpress.org/File_Header', 'wporg-plugins' )
     
    132135                }
    133136
    134137                if ( preg_match( '|[^\d\.]|', $this->plugin['Version'] ) ) {
    135                         /* translators: %s: Version header */
     138                        /* translators: %s: 'Version:' */
    136139                        return sprintf( __( 'Version strings can only contain numeric and period characters (like 1.2). Please fix your %s line in your main plugin file and upload the plugin again.', 'wporg-plugins' ),
    137140                                '<code>Version:</code>'
    138141                        );