<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[22349] trunk/wp-includes/pomo: Sync POMO with GlotPress</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/22349">22349</a></dd>
<dt>Author</dt> <dd>nbachiyski</dd>
<dt>Date</dt> <dd>2012-10-31 22:13:51 +0000 (Wed, 31 Oct 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Sync POMO with GlotPress

See http://glotpress.trac.wordpress.org/browser/trunk/pomo/</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludespomoentryphp">trunk/wp-includes/pomo/entry.php</a></li>
<li><a href="#trunkwpincludespomomophp">trunk/wp-includes/pomo/mo.php</a></li>
<li><a href="#trunkwpincludespomopophp">trunk/wp-includes/pomo/po.php</a></li>
<li><a href="#trunkwpincludespomostreamsphp">trunk/wp-includes/pomo/streams.php</a></li>
<li><a href="#trunkwpincludespomotranslationsphp">trunk/wp-includes/pomo/translations.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludespomoentryphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/pomo/entry.php (22348 => 22349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/pomo/entry.php        2012-10-31 21:43:59 UTC (rev 22348)
+++ trunk/wp-includes/pomo/entry.php        2012-10-31 22:13:51 UTC (rev 22349)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> /**
</span><span class="cx">  * Contains Translation_Entry class
</span><span class="cx">  *
</span><del>- * @version $Id: entry.php 621 2011-06-13 12:21:50Z nbachiyski $
</del><ins>+ * @version $Id: entry.php 718 2012-10-31 00:32:02Z nbachiyski $
</ins><span class="cx">  * @package pomo
</span><span class="cx">  * @subpackage entry
</span><span class="cx">  */
</span><span class="lines">@@ -65,14 +65,14 @@
</span><span class="cx">                 // prepend context and EOT, like in MO files
</span><span class="cx">                 return is_null($this-&gt;context)? $this-&gt;singular : $this-&gt;context.chr(4).$this-&gt;singular;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function merge_with(&amp;$other) {
</span><span class="cx">                 $this-&gt;flags = array_unique( array_merge( $this-&gt;flags, $other-&gt;flags ) );
</span><span class="cx">                 $this-&gt;references = array_unique( array_merge( $this-&gt;references, $other-&gt;references ) );
</span><span class="cx">                 if ( $this-&gt;extracted_comments != $other-&gt;extracted_comments ) {
</span><span class="cx">                         $this-&gt;extracted_comments .= $other-&gt;extracted_comments;
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> endif;
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludespomomophp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/pomo/mo.php (22348 => 22349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/pomo/mo.php        2012-10-31 21:43:59 UTC (rev 22348)
+++ trunk/wp-includes/pomo/mo.php        2012-10-31 22:13:51 UTC (rev 22349)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> /**
</span><span class="cx">  * Class for working with MO files
</span><span class="cx">  *
</span><del>- * @version $Id: mo.php 602 2011-01-30 12:43:29Z nbachiyski $
</del><ins>+ * @version $Id: mo.php 718 2012-10-31 00:32:02Z nbachiyski $
</ins><span class="cx">  * @package pomo
</span><span class="cx">  * @subpackage mo
</span><span class="cx">  */
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">                 fclose($fh);
</span><span class="cx">                 return $res;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function export() {
</span><span class="cx">                 $tmp_fh = fopen(&quot;php://temp&quot;, 'r+');
</span><span class="cx">                 if ( !$tmp_fh ) return false;
</span><span class="lines">@@ -42,9 +42,21 @@
</span><span class="cx">                 rewind( $tmp_fh );
</span><span class="cx">                 return stream_get_contents( $tmp_fh );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
+        function is_entry_good_for_export( $entry ) {
+                if ( empty( $entry-&gt;translations ) ) {
+                        return false;
+                }
+
+                if ( !array_filter( $entry-&gt;translations ) ) {
+                        return false;
+                }
+
+                return true;
+        }
+
</ins><span class="cx">         function export_to_file_handle($fh) {
</span><del>-                $entries = array_filter($this-&gt;entries, create_function('$e', 'return !empty($e-&gt;translations);'));
</del><ins>+                $entries = array_filter( $this-&gt;entries, array( $this, 'is_entry_good_for_export' ) );
</ins><span class="cx">                 ksort($entries);
</span><span class="cx">                 $magic = 0x950412de;
</span><span class="cx">                 $revision = 0;
</span><span class="lines">@@ -57,7 +69,7 @@
</span><span class="cx">                 fwrite($fh, pack('V*', $magic, $revision, $total, $originals_lenghts_addr,
</span><span class="cx">                         $translations_lenghts_addr, $size_of_hash, $hash_addr));
</span><span class="cx">                 fseek($fh, $originals_lenghts_addr);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // headers' msgid is an empty string
</span><span class="cx">                 fwrite($fh, pack('VV', 0, $current_addr));
</span><span class="cx">                 $current_addr++;
</span><span class="lines">@@ -69,24 +81,24 @@
</span><span class="cx">                         fwrite($fh, pack('VV', $length, $current_addr));
</span><span class="cx">                         $current_addr += $length + 1; // account for the NULL byte after
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $exported_headers = $this-&gt;export_headers();
</span><span class="cx">                 fwrite($fh, pack('VV', strlen($exported_headers), $current_addr));
</span><span class="cx">                 $current_addr += strlen($exported_headers) + 1;
</span><span class="cx">                 $translations_table = $exported_headers . chr(0);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 foreach($entries as $entry) {
</span><span class="cx">                         $translations_table .= $this-&gt;export_translations($entry) . chr(0);
</span><span class="cx">                         $length = strlen($this-&gt;export_translations($entry));
</span><span class="cx">                         fwrite($fh, pack('VV', $length, $current_addr));
</span><span class="cx">                         $current_addr += $length + 1;
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 fwrite($fh, $originals_table);
</span><span class="cx">                 fwrite($fh, $translations_table);
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function export_original($entry) {
</span><span class="cx">                 //TODO: warnings for control characters
</span><span class="cx">                 $exported = $entry-&gt;singular;
</span><span class="lines">@@ -94,12 +106,12 @@
</span><span class="cx">                 if (!is_null($entry-&gt;context)) $exported = $entry-&gt;context . chr(4) . $exported;
</span><span class="cx">                 return $exported;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function export_translations($entry) {
</span><span class="cx">                 //TODO: warnings for control characters
</span><span class="cx">                 return implode(chr(0), $entry-&gt;translations);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function export_headers() {
</span><span class="cx">                 $exported = '';
</span><span class="cx">                 foreach($this-&gt;headers as $header =&gt; $value) {
</span><span class="lines">@@ -195,8 +207,7 @@
</span><span class="cx">                         $translation = $reader-&gt;substr( $strings, $t['pos'], $t['length'] );
</span><span class="cx"> 
</span><span class="cx">                         if ('' === $original) {
</span><del>-                                $headers = $this-&gt;make_headers($translation);
-                                $this-&gt;set_headers($headers);
</del><ins>+                                $this-&gt;set_headers($this-&gt;make_headers($translation));
</ins><span class="cx">                         } else {
</span><span class="cx">                                 $entry = &amp;$this-&gt;make_entry($original, $translation);
</span><span class="cx">                                 $this-&gt;entries[$entry-&gt;key()] = &amp;$entry;
</span><span class="lines">@@ -208,7 +219,7 @@
</span><span class="cx">         /**
</span><span class="cx">          * Build a Translation_Entry from original string and translation strings,
</span><span class="cx">          * found in a MO file
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * @static
</span><span class="cx">          * @param string $original original string to translate from MO file. Might contain
</span><span class="cx">          *         0x04 as context separator or 0x00 as singular/plural separator
</span></span></pre></div>
<a id="trunkwpincludespomopophp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/pomo/po.php (22348 => 22349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/pomo/po.php        2012-10-31 21:43:59 UTC (rev 22348)
+++ trunk/wp-includes/pomo/po.php        2012-10-31 22:13:51 UTC (rev 22349)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> /**
</span><span class="cx">  * Class for working with PO files
</span><span class="cx">  *
</span><del>- * @version $Id: po.php 589 2010-12-18 01:40:57Z nbachiyski $
</del><ins>+ * @version $Id: po.php 718 2012-10-31 00:32:02Z nbachiyski $
</ins><span class="cx">  * @package pomo
</span><span class="cx">  * @subpackage po
</span><span class="cx">  */
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx">  */
</span><span class="cx"> if ( !class_exists( 'PO' ) ):
</span><span class="cx"> class PO extends Gettext_Translations {
</span><del>-        
</del><ins>+
</ins><span class="cx">         var $comments_before_headers = '';
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="lines">@@ -80,10 +80,10 @@
</span><span class="cx">                 if (false === $res) return false;
</span><span class="cx">                 return fclose($fh);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         /**
</span><span class="cx">          * Text to include as a comment before the start of the PO contents
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * Doesn't need to include # in the beginning of lines, these are added automatically
</span><span class="cx">          */
</span><span class="cx">         function set_comment_before_headers( $text ) {
</span><span class="lines">@@ -120,10 +120,10 @@
</span><span class="cx">                 $po = str_replace(&quot;$newline$quote$quote&quot;, '', $po);
</span><span class="cx">                 return $po;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         /**
</span><span class="cx">          * Gives back the original string from a PO-formatted string
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * @static
</span><span class="cx">          * @param string $string PO-formatted string
</span><span class="cx">          * @return string enascaped string
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /**
</span><del>-         * Inserts $with in the beginning of every new line of $string and 
</del><ins>+         * Inserts $with in the beginning of every new line of $string and
</ins><span class="cx">          * returns the modified string
</span><span class="cx">          *
</span><span class="cx">          * @static
</span><span class="lines">@@ -229,9 +229,15 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 PO::read_line($f, 'clear');
</span><del>-                return $res !== false;
</del><ins>+                if ( false === $res ) {
+                        return false;
+                }
+                if ( ! $this-&gt;headers &amp;&amp; ! $this-&gt;entries ) {
+                        return false;
+                }
+                return true;
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function read_entry($f, $lineno = 0) {
</span><span class="cx">                 $entry = new Translation_Entry();
</span><span class="cx">                 // where were we in the last step
</span><span class="lines">@@ -336,7 +342,7 @@
</span><span class="cx">                 }
</span><span class="cx">                 return array('entry' =&gt; $entry, 'lineno' =&gt; $lineno);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function read_line($f, $action = 'read') {
</span><span class="cx">                 static $last_line = '';
</span><span class="cx">                 static $use_last_line = false;
</span><span class="lines">@@ -349,11 +355,12 @@
</span><span class="cx">                         return true;
</span><span class="cx">                 }
</span><span class="cx">                 $line = $use_last_line? $last_line : fgets($f);
</span><ins>+                $line = gp_endswith( $line, &quot;\r\n&quot; )? rtrim( $line, &quot;\r\n&quot; ) . &quot;\n&quot; : $line;
</ins><span class="cx">                 $last_line = $line;
</span><span class="cx">                 $use_last_line = false;
</span><span class="cx">                 return $line;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function add_comment_to_entry(&amp;$entry, $po_comment_line) {
</span><span class="cx">                 $first_two = substr($po_comment_line, 0, 2);
</span><span class="cx">                 $comment = trim(substr($po_comment_line, 2));
</span><span class="lines">@@ -367,7 +374,7 @@
</span><span class="cx">                         $entry-&gt;translator_comments = trim($entry-&gt;translator_comments . &quot;\n&quot; . $comment);
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function trim_quotes($s) {
</span><span class="cx">                 if ( substr($s, 0, 1) == '&quot;') $s = substr($s, 1);
</span><span class="cx">                 if ( substr($s, -1, 1) == '&quot;') $s = substr($s, 0, -1);
</span></span></pre></div>
<a id="trunkwpincludespomostreamsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/pomo/streams.php (22348 => 22349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/pomo/streams.php        2012-10-31 21:43:59 UTC (rev 22348)
+++ trunk/wp-includes/pomo/streams.php        2012-10-31 22:13:51 UTC (rev 22349)
</span><span class="lines">@@ -3,22 +3,22 @@
</span><span class="cx">  * Classes, which help reading streams of data from files.
</span><span class="cx">  * Based on the classes from Danilo Segan &lt;danilo@kvota.net&gt;
</span><span class="cx">  *
</span><del>- * @version $Id: streams.php 597 2011-01-16 20:14:36Z nbachiyski $
</del><ins>+ * @version $Id: streams.php 718 2012-10-31 00:32:02Z nbachiyski $
</ins><span class="cx">  * @package pomo
</span><span class="cx">  * @subpackage streams
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> if ( !class_exists( 'POMO_Reader' ) ):
</span><span class="cx"> class POMO_Reader {
</span><del>-        
</del><ins>+
</ins><span class="cx">         var $endian = 'little';
</span><span class="cx">         var $_post = '';
</span><del>-        
</del><ins>+
</ins><span class="cx">         function POMO_Reader() {
</span><span class="cx">                 $this-&gt;is_overloaded = ((ini_get(&quot;mbstring.func_overload&quot;) &amp; 2) != 0) &amp;&amp; function_exists('mb_substr');
</span><span class="cx">                 $this-&gt;_pos = 0;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         /**
</span><span class="cx">          * Sets the endianness of the file.
</span><span class="cx">          *
</span><span class="lines">@@ -57,8 +57,8 @@
</span><span class="cx">                 $endian_letter = ('big' == $this-&gt;endian)? 'N' : 'V';
</span><span class="cx">                 return unpack($endian_letter.$count, $bytes);
</span><span class="cx">         }
</span><del>-        
-        
</del><ins>+
+
</ins><span class="cx">         function substr($string, $start, $length) {
</span><span class="cx">                 if ($this-&gt;is_overloaded) {
</span><span class="cx">                         return mb_substr($string, $start, $length, 'ascii');
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">                         return substr($string, $start, $length);
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function strlen($string) {
</span><span class="cx">                 if ($this-&gt;is_overloaded) {
</span><span class="cx">                         return mb_strlen($string, 'ascii');
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">                         return strlen($string);
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function str_split($string, $chunk_size) {
</span><span class="cx">                 if (!function_exists('str_split')) {
</span><span class="cx">                         $length = $this-&gt;strlen($string);
</span><span class="lines">@@ -86,8 +86,8 @@
</span><span class="cx">                         return str_split( $string, $chunk_size );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
-                
</del><ins>+
+
</ins><span class="cx">         function pos() {
</span><span class="cx">                 return $this-&gt;_pos;
</span><span class="cx">         }
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx">         function is_resource() {
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function close() {
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="lines">@@ -108,11 +108,11 @@
</span><span class="cx">                 parent::POMO_Reader();
</span><span class="cx">                 $this-&gt;_f = fopen($filename, 'rb');
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function read($bytes) {
</span><span class="cx">                 return fread($this-&gt;_f, $bytes);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function seekto($pos) {
</span><span class="cx">                 if ( -1 == fseek($this-&gt;_f, $pos, SEEK_SET)) {
</span><span class="cx">                         return false;
</span><span class="lines">@@ -120,19 +120,19 @@
</span><span class="cx">                 $this-&gt;_pos = $pos;
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function is_resource() {
</span><span class="cx">                 return is_resource($this-&gt;_f);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function feof() {
</span><span class="cx">                 return feof($this-&gt;_f);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function close() {
</span><span class="cx">                 return fclose($this-&gt;_f);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function read_all() {
</span><span class="cx">                 $all = '';
</span><span class="cx">                 while ( !$this-&gt;feof() )
</span><span class="lines">@@ -148,9 +148,9 @@
</span><span class="cx">  * of a physical file.
</span><span class="cx">  */
</span><span class="cx"> class POMO_StringReader extends POMO_Reader {
</span><del>-        
</del><ins>+
</ins><span class="cx">         var $_str = '';
</span><del>-        
</del><ins>+
</ins><span class="cx">         function POMO_StringReader($str = '') {
</span><span class="cx">                 parent::POMO_Reader();
</span><span class="cx">                 $this-&gt;_str = $str;
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx">         function read_all() {
</span><span class="cx">                 return $this-&gt;substr($this-&gt;_str, $this-&gt;_pos, $this-&gt;strlen($this-&gt;_str));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> endif;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludespomotranslationsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/pomo/translations.php (22348 => 22349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/pomo/translations.php        2012-10-31 21:43:59 UTC (rev 22348)
+++ trunk/wp-includes/pomo/translations.php        2012-10-31 22:13:51 UTC (rev 22349)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> /**
</span><span class="cx">  * Class for a set of entries for translation and their associated headers
</span><span class="cx">  *
</span><del>- * @version $Id: translations.php 590 2010-12-20 19:58:37Z nbachiyski $
</del><ins>+ * @version $Id: translations.php 718 2012-10-31 00:32:02Z nbachiyski $
</ins><span class="cx">  * @package pomo
</span><span class="cx">  * @subpackage translations
</span><span class="cx">  */
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">                 $this-&gt;entries[$key] = &amp;$entry;
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function add_entry_or_merge($entry) {
</span><span class="cx">                 if (is_array($entry)) {
</span><span class="cx">                         $entry = new Translation_Entry($entry);
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">         /**
</span><span class="cx">          * Given the number of items, returns the 0-based index of the plural form to use
</span><span class="cx">          *
</span><del>-         * Here, in the base Translations class, the common logic for English is implemented:
</del><ins>+         * Here, in the base Translations class, the common logic for English is implmented:
</ins><span class="cx">          *         0 if there is one element, 1 otherwise
</span><span class="cx">          *
</span><span class="cx">          * This function should be overrided by the sub-classes. For example MO/PO can derive the logic
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx">                         $this-&gt;entries[$entry-&gt;key()] = $entry;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function merge_originals_with(&amp;$other) {
</span><span class="cx">                 foreach( $other-&gt;entries as $entry ) {
</span><span class="cx">                         if ( !isset( $this-&gt;entries[$entry-&gt;key()] ) )
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">                 }
</span><span class="cx">                 return call_user_func($this-&gt;_gettext_select_plural_form, $count);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function nplurals_and_expression_from_header($header) {
</span><span class="cx">                 if (preg_match('/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $header, $matches)) {
</span><span class="cx">                         $nplurals = (int)$matches[1];
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx">         /**
</span><span class="cx">          * Adds parantheses to the inner parts of ternary operators in
</span><span class="cx">          * plural expressions, because PHP evaluates ternary oerators from left to right
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * @param string $expression the expression without parentheses
</span><span class="cx">          * @return string the expression with parentheses added
</span><span class="cx">          */
</span><span class="lines">@@ -202,7 +202,7 @@
</span><span class="cx">                 }
</span><span class="cx">                 return rtrim($res, ';');
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function make_headers($translation) {
</span><span class="cx">                 $headers = array();
</span><span class="cx">                 // sometimes \ns are used instead of real new lines
</span><span class="lines">@@ -215,7 +215,7 @@
</span><span class="cx">                 }
</span><span class="cx">                 return $headers;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function set_header($header, $value) {
</span><span class="cx">                 parent::set_header($header, $value);
</span><span class="cx">                 if ('Plural-Forms' == $header) {
</span><span class="lines">@@ -234,7 +234,7 @@
</span><span class="cx"> class NOOP_Translations {
</span><span class="cx">         var $entries = array();
</span><span class="cx">         var $headers = array();
</span><del>-        
</del><ins>+
</ins><span class="cx">         function add_entry($entry) {
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>