Changeset 8469 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php
- Timestamp:
- 03/16/2019 09:35:34 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php
r7874 r8469 32 32 33 33 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 ); 36 39 return array( 37 40 'errors' => array( $error ), … … 64 67 // Fatal errors. 65 68 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 ); 68 75 } 69 76 … … 72 79 $latest_wordpress_version = defined( 'WP_CORE_STABLE_BRANCH' ) ? WP_CORE_STABLE_BRANCH : '5.0'; 73 80 74 /* translators: 1: plugin header tag; 2: Example version 5.0. 3: Example version 4.9. */75 81 $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' ), 77 84 '<code>Requires at least</code>', 78 85 '<code>' . number_format( $latest_wordpress_version, 1 ) . '</code>', … … 80 87 ); 81 88 } 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 ); 84 94 } 85 95 … … 87 97 $latest_wordpress_version = defined( 'WP_CORE_STABLE_BRANCH' ) ? WP_CORE_STABLE_BRANCH : '5.0'; 88 98 89 /* translators: 1: plugin header tag; 2: Example version 5.0. 3: Example version 5.1. */90 99 $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' ), 92 102 '<code>Tested up to</code>', 93 103 '<code>' . number_format( $latest_wordpress_version, 1 ) . '</code>', … … 95 105 ); 96 106 } 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 ); 99 112 } 100 113 101 114 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 ); 104 122 } 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 ); 107 128 } 108 129 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 ); 111 137 } 112 138 113 139 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 ); 116 145 } 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 ); 119 151 } 120 152 121 153 // Notes. 122 154 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 ); 125 160 } 126 161 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 ); 129 167 } 130 168 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 ); 133 174 } 134 175 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 ); 137 181 } 138 182 if ( empty( $readme->donate_link ) ) {
Note: See TracChangeset
for help on using the changeset viewer.