Changeset 51919 for trunk/src/wp-includes/pomo/mo.php
- Timestamp:
- 10/18/2021 05:51:17 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pomo/mo.php
r51342 r51919 38 38 * @return bool True if the import from file was successful, otherwise false. 39 39 */ 40 function import_from_file( $filename ) {40 public function import_from_file( $filename ) { 41 41 $reader = new POMO_FileReader( $filename ); 42 42 … … 54 54 * @return bool 55 55 */ 56 function export_to_file( $filename ) {56 public function export_to_file( $filename ) { 57 57 $fh = fopen( $filename, 'wb' ); 58 58 if ( ! $fh ) { … … 67 67 * @return string|false 68 68 */ 69 function export() {69 public function export() { 70 70 $tmp_fh = fopen( 'php://temp', 'r+' ); 71 71 if ( ! $tmp_fh ) { … … 81 81 * @return bool 82 82 */ 83 function is_entry_good_for_export( $entry ) {83 public function is_entry_good_for_export( $entry ) { 84 84 if ( empty( $entry->translations ) ) { 85 85 return false; … … 97 97 * @return true 98 98 */ 99 function export_to_file_handle( $fh ) {99 public function export_to_file_handle( $fh ) { 100 100 $entries = array_filter( $this->entries, array( $this, 'is_entry_good_for_export' ) ); 101 101 ksort( $entries ); … … 158 158 * @return string 159 159 */ 160 function export_original( $entry ) {160 public function export_original( $entry ) { 161 161 // TODO: Warnings for control characters. 162 162 $exported = $entry->singular; … … 174 174 * @return string 175 175 */ 176 function export_translations( $entry ) {176 public function export_translations( $entry ) { 177 177 // TODO: Warnings for control characters. 178 178 return $entry->is_plural ? implode( "\0", $entry->translations ) : $entry->translations[0]; … … 182 182 * @return string 183 183 */ 184 function export_headers() {184 public function export_headers() { 185 185 $exported = ''; 186 186 foreach ( $this->headers as $header => $value ) { … … 194 194 * @return string|false 195 195 */ 196 function get_byteorder( $magic ) {196 public function get_byteorder( $magic ) { 197 197 // The magic is 0x950412de. 198 198 … … 215 215 * @return bool True if the import was successful, otherwise false. 216 216 */ 217 function import_from_reader( $reader ) {217 public function import_from_reader( $reader ) { 218 218 $endian_string = MO::get_byteorder( $reader->readint32() ); 219 219 if ( false === $endian_string ) { … … 312 312 * @return Translation_Entry Entry instance. 313 313 */ 314 function &make_entry( $original, $translation ) {314 public function &make_entry( $original, $translation ) { 315 315 $entry = new Translation_Entry(); 316 316 // Look for context, separated by \4. … … 336 336 * @return string 337 337 */ 338 function select_plural_form( $count ) {338 public function select_plural_form( $count ) { 339 339 return $this->gettext_select_plural_form( $count ); 340 340 } … … 343 343 * @return int 344 344 */ 345 function get_plural_forms_count() {345 public function get_plural_forms_count() { 346 346 return $this->_nplurals; 347 347 }
Note: See TracChangeset
for help on using the changeset viewer.