]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/pomo/mo.php
WordPress 4.7
[autoinstalls/wordpress.git] / wp-includes / pomo / mo.php
index 6bc44d614d69c899078889a62f8035ae44f8131e..47e9b6afe4a875015a7a6e347cb70f2234881fc3 100644 (file)
@@ -15,16 +15,37 @@ class MO extends Gettext_Translations {
 
        var $_nplurals = 2;
 
+       /**
+        * Loaded MO file.
+        *
+        * @var string
+        */
+       private $filename = '';
+
+       /**
+        * Returns the loaded MO file.
+        *
+        * @return string The loaded MO file.
+        */
+       public function get_filename() {
+               return $this->filename;
+       }
+
        /**
         * Fills up with the entries from MO file $filename
         *
         * @param string $filename MO file to load
         */
        function import_from_file($filename) {
-               $reader = new POMO_FileReader($filename);
-               if (!$reader->is_resource())
+               $reader = new POMO_FileReader( $filename );
+
+               if ( ! $reader->is_resource() ) {
                        return false;
-               return $this->import_from_reader($reader);
+               }
+
+               $this->filename = (string) $filename;
+
+               return $this->import_from_reader( $reader );
        }
 
        /**
@@ -299,4 +320,4 @@ class MO extends Gettext_Translations {
                return $this->_nplurals;
        }
 }
-endif;
\ No newline at end of file
+endif;