X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f5fcdc7994bb67cce809bc4777944ae8b7fad4a4..53f4633144ed68c8b8fb5861f992b5489894a940:/wp-includes/pomo/mo.php diff --git a/wp-includes/pomo/mo.php b/wp-includes/pomo/mo.php index e8eecc19..17570619 100644 --- a/wp-includes/pomo/mo.php +++ b/wp-includes/pomo/mo.php @@ -27,6 +27,10 @@ class MO extends Gettext_Translations { return $this->import_from_reader($reader); } + /** + * @param string $filename + * @return bool + */ function export_to_file($filename) { $fh = fopen($filename, 'wb'); if ( !$fh ) return false; @@ -35,6 +39,9 @@ class MO extends Gettext_Translations { return $res; } + /** + * @return string|false + */ function export() { $tmp_fh = fopen("php://temp", 'r+'); if ( !$tmp_fh ) return false; @@ -43,6 +50,10 @@ class MO extends Gettext_Translations { return stream_get_contents( $tmp_fh ); } + /** + * @param Translation_Entry $entry + * @return bool + */ function is_entry_good_for_export( $entry ) { if ( empty( $entry->translations ) ) { return false; @@ -55,6 +66,10 @@ class MO extends Gettext_Translations { return true; } + /** + * @param resource $fh + * @return true + */ function export_to_file_handle($fh) { $entries = array_filter( $this->entries, array( $this, 'is_entry_good_for_export' ) ); ksort($entries); @@ -101,6 +116,10 @@ class MO extends Gettext_Translations { return true; } + /** + * @param Translation_Entry $entry + * @return string + */ function export_original($entry) { //TODO: warnings for control characters $exported = $entry->singular; @@ -109,11 +128,18 @@ class MO extends Gettext_Translations { return $exported; } + /** + * @param Translation_Entry $entry + * @return string + */ function export_translations($entry) { //TODO: warnings for control characters return implode(chr(0), $entry->translations); } + /** + * @return string + */ function export_headers() { $exported = ''; foreach($this->headers as $header => $value) { @@ -122,6 +148,10 @@ class MO extends Gettext_Translations { return $exported; } + /** + * @param int $magic + * @return string|false + */ function get_byteorder($magic) { // The magic is 0x950412de @@ -254,10 +284,17 @@ class MO extends Gettext_Translations { return $entry; } + /** + * @param int $count + * @return string + */ function select_plural_form($count) { return $this->gettext_select_plural_form($count); } + /** + * @return int + */ function get_plural_forms_count() { return $this->_nplurals; }