Changeset 10222 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-language-pack.php
- Timestamp:
- 08/30/2020 02:05:57 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-language-pack.php
r10097 r10222 415 415 416 416 // Find all unique sources this translation originates from. 417 $sources = array_map( function ( $reference ) { 418 $parts = explode( ':', $reference ); 419 $file = $parts[0]; 420 421 if ( substr( $file, -7 ) === '.min.js' ) { 422 return substr( $file, 0, -7 ) . '.js'; 423 } 424 425 if ( substr( $file, -3 ) === '.js' ) { 426 return $file; 427 } 428 return 'po'; 429 }, $entry->references ); 430 431 $sources = array_unique( $sources ); 417 if ( ! empty( $entry->references ) ) { 418 $sources = array_map( 419 function ( $reference ) { 420 $parts = explode( ':', $reference ); 421 $file = $parts[0]; 422 423 if ( substr( $file, -7 ) === '.min.js' ) { 424 return substr( $file, 0, -7 ) . '.js'; 425 } 426 427 if ( substr( $file, -3 ) === '.js' ) { 428 return $file; 429 } 430 return 'po'; 431 }, 432 $entry->references 433 ); 434 435 $sources = array_unique( $sources ); 436 } else { 437 $sources = [ 'po' ]; 438 } 432 439 433 440 foreach ( $sources as $source ) {
Note: See TracChangeset
for help on using the changeset viewer.