Changeset 10222
- Timestamp:
- 08/30/2020 02:05:57 PM (4 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-export.php
r10097 r10222 138 138 139 139 // Find all unique sources this translation originates from. 140 $sources = array_map( function ( $reference ) { 141 $parts = explode( ':', $reference ); 142 $file = $parts[0]; 143 144 if ( substr( $file, -7 ) === '.min.js' ) { 145 return substr( $file, 0, -7 ) . '.js'; 146 } 147 148 if ( substr( $file, -3 ) === '.js' ) { 149 return $file; 150 } 151 152 return 'po'; 153 }, $entry->references ); 154 155 $sources = array_unique( $sources ); 140 if ( ! empty( $entry->references ) ) { 141 $sources = array_map( 142 function ( $reference ) { 143 $parts = explode( ':', $reference ); 144 $file = $parts[0]; 145 146 if ( substr( $file, -7 ) === '.min.js' ) { 147 return substr( $file, 0, -7 ) . '.js'; 148 } 149 150 if ( substr( $file, -3 ) === '.js' ) { 151 return $file; 152 } 153 return 'po'; 154 }, 155 $entry->references 156 ); 157 158 $sources = array_unique( $sources ); 159 } else { 160 $sources = [ 'po' ]; 161 } 156 162 157 163 foreach ( $sources as $source ) { -
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.