Changeset 8500
- Timestamp:
- 03/24/2019 08:58:17 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-export.php
r7843 r8500 166 166 167 167 /** 168 * Builds a mapping of JS file names to translation entries.168 * Builds a a separate JSON file with translations for each JavaScript file. 169 169 * 170 170 * @param GP_Project $gp_project The GlotPress project. … … 176 176 */ 177 177 private function build_json_files( $gp_project, $gp_locale, $set, $mapping, $base_dest ) { 178 // Export translations for each JS file to a separate translation file.179 178 $files = array(); 180 179 $format = gp_array_get( GP::$formats, 'jed1x' ); 180 181 181 foreach ( $mapping as $file => $entries ) { 182 // Get the translations in Jed 1.x compatible JSON format. 182 183 $json_content = $format->print_exported_file( $gp_project, $gp_locale, $set, $entries ); 184 185 // Decode and add comment with file reference for debugging. 186 $json_content_decoded = json_decode( $json_content ); 187 $json_content_decoded->comment = [ 'reference' => $file ]; 188 189 $json_content = wp_json_encode( $json_content_decoded ); 183 190 184 191 $hash = md5( $file );
Note: See TracChangeset
for help on using the changeset viewer.