Changeset 13316 for trunk/wp-includes/pomo/mo.php
- Timestamp:
- 02/22/2010 11:12:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/pomo/mo.php
r13228 r13316 27 27 return $this->import_from_reader($reader); 28 28 } 29 29 30 30 function export_to_file($filename) { 31 31 $fh = fopen($filename, 'wb'); … … 44 44 $translations_lenghts_addr, $size_of_hash, $hash_addr)); 45 45 fseek($fh, $originals_lenghts_addr); 46 46 47 47 // headers' msgid is an empty string 48 48 fwrite($fh, pack('VV', 0, $current_addr)); … … 56 56 $current_addr += $length + 1; // account for the NULL byte after 57 57 } 58 58 59 59 $exported_headers = $this->export_headers(); 60 60 fwrite($fh, pack('VV', strlen($exported_headers), $current_addr)); 61 61 $current_addr += strlen($exported_headers) + 1; 62 62 $translations_table = $exported_headers . chr(0); 63 63 64 64 foreach($entries as $entry) { 65 65 $translations_table .= $this->export_translations($entry) . chr(0); … … 68 68 $current_addr += $length + 1; 69 69 } 70 70 71 71 fwrite($fh, $originals_table); 72 72 fwrite($fh, $translations_table); 73 73 fclose($fh); 74 74 } 75 75 76 76 function export_original($entry) { 77 77 //TODO: warnings for control characters … … 81 81 return $exported; 82 82 } 83 83 84 84 function export_translations($entry) { 85 85 //TODO: warnings for control characters 86 86 return implode(chr(0), $entry->translations); 87 87 } 88 88 89 89 function export_headers() { 90 90 $exported = '';
Note: See TracChangeset
for help on using the changeset viewer.