]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/pomo/mo.php
WordPress 4.3
[autoinstalls/wordpress.git] / wp-includes / pomo / mo.php
index e8eecc19d53df8f659dac7e8c962913579b7194b..1757061960f6ebfc59fb7f15cdd18f2428a82292 100644 (file)
@@ -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;
        }