Changeset 31319
- Timestamp:
- 01/31/2015 10:01:33 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/i18n/makepot.php
r31315 r31319 24 24 'mu', 25 25 'bp', 26 'glotpress', 26 27 'rosetta', 27 28 'wporg-bb-forums', … … 242 243 } 243 244 244 function wp_frontend($dir, $output) { 245 if ( ! file_exists( "$dir/wp-admin/user/about.php" ) ) return false; 245 function wp_frontend( $dir, $output ) { 246 if ( ! file_exists( "$dir/wp-admin/user/about.php" ) ) { 247 return false; 248 } 249 250 $excludes = array( 'wp-admin/.*', 'wp-content/themes/.*', 'wp-includes/class-pop3\.php' ); 251 252 // Exclude Akismet all together for 3.9+. 253 if ( file_exists( "$dir/wp-admin/css/about.css" ) ) { 254 $excludes[] = 'wp-content/plugins/akismet/.*'; 255 } 246 256 247 257 return $this->wp_generic( $dir, array( 248 258 'project' => 'wp-frontend', 'output' => $output, 249 259 'includes' => array(), 250 'excludes' => array( 'wp-admin/.*', 'wp-content/themes/.*', 'wp-includes/class-pop3\.php' ),260 'excludes' => $excludes, 251 261 'default_output' => 'wordpress.pot', 252 262 ) ); … … 254 264 255 265 function wp_admin($dir, $output) { 256 if ( ! file_exists( "$dir/wp-admin/user/about.php" ) ) return false; 266 if ( ! file_exists( "$dir/wp-admin/user/about.php" ) ) { 267 return false; 268 } 257 269 258 270 $frontend_pot = $this->tempnam( 'frontend.pot' ); 259 if ( false === $frontend_pot ) return false; 271 if ( false === $frontend_pot ) { 272 return false; 273 } 260 274 261 275 $frontend_result = $this->wp_frontend( $dir, $frontend_pot ); 262 if ( ! $frontend_result ) 263 return false; 276 if ( ! $frontend_result ) { 277 return false; 278 } 264 279 265 280 $result = $this->wp_generic( $dir, array( 266 281 'project' => 'wp-admin', 'output' => $output, 267 282 'includes' => array( 'wp-admin/.*' ), 268 'excludes' => array( 'wp-admin/ network/.*', 'wp-admin/network.php' ),283 'excludes' => array( 'wp-admin/includes/continents-cities\.php', 'wp-admin/network/.*', 'wp-admin/network.php' ), 269 284 'default_output' => 'wordpress-admin.pot', 270 285 ) ); 271 272 if ( ! $result )273 return false;286 if ( ! $result ) { 287 return false; 288 } 274 289 275 290 $potextmeta = new PotExtMeta; 276 $result = $potextmeta->append( "$dir/wp-content/plugins/akismet/akismet.php", $output ); 277 if ( ! $result ) 278 return false; 291 292 if ( ! file_exists( "$dir/wp-admin/css/about.css" ) ) { // < 3.9 293 $result = $potextmeta->append( "$dir/wp-content/plugins/akismet/akismet.php", $output ); 294 if ( ! $result ) { 295 return false; 296 } 297 } 298 279 299 $result = $potextmeta->append( "$dir/wp-content/plugins/hello.php", $output ); 280 if ( ! $result ) 281 return false; 300 if ( ! $result ) { 301 return false; 302 } 282 303 283 304 /* Adding non-gettexted strings can repeat some phrases */ … … 286 307 287 308 $common_pot = $this->tempnam( 'common.pot' ); 288 if ( ! $common_pot ) 289 return false; 309 if ( ! $common_pot ) { 310 return false; 311 } 290 312 $admin_pot = realpath( is_null( $output ) ? 'wordpress-admin.pot' : $output ); 291 313 system( "msgcat --more-than=1 --use-first $frontend_pot $admin_pot > $common_pot" ); … … 571 593 $output = is_null( $output )? 'rosetta.pot' : $output; 572 594 return $this->xgettext( 'rosetta', $dir, $output, array(), array(), array( 595 'mu-plugins/(roles|showcase|downloads)/.*\.php', 573 596 'mu-plugins/rosetta.*\.php', 574 597 'mu-plugins/rosetta/[^/]+\.php',
Note: See TracChangeset
for help on using the changeset viewer.