Sync pomo. Props nbachiyski. fixes #11832

git-svn-id: http://svn.automattic.com/wordpress/trunk@13228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-02-19 18:01:50 +00:00
parent ebdbcbc4b3
commit 3b98150c82
5 changed files with 10 additions and 8 deletions

View File

@ -2,7 +2,7 @@
/** /**
* Contains Translation_Entry class * Contains Translation_Entry class
* *
* @version $Id: entry.php 351 2009-12-03 11:39:08Z nbachiyski $ * @version $Id: entry.php 406 2010-02-07 11:10:24Z nbachiyski $
* @package pomo * @package pomo
* @subpackage entry * @subpackage entry
*/ */

View File

@ -2,7 +2,7 @@
/** /**
* Class for working with MO files * Class for working with MO files
* *
* @version $Id: mo.php 293 2009-11-12 15:43:50Z nbachiyski $ * @version $Id: mo.php 406 2010-02-07 11:10:24Z nbachiyski $
* @package pomo * @package pomo
* @subpackage mo * @subpackage mo
*/ */
@ -201,7 +201,7 @@ class MO extends Gettext_Translations {
* 0x00 as a plural translations separator * 0x00 as a plural translations separator
*/ */
function &make_entry($original, $translation) { function &make_entry($original, $translation) {
$entry = & new Translation_Entry(); $entry = new Translation_Entry();
// look for context // look for context
$parts = explode(chr(4), $original); $parts = explode(chr(4), $original);
if (isset($parts[1])) { if (isset($parts[1])) {

View File

@ -2,7 +2,7 @@
/** /**
* Class for working with PO files * Class for working with PO files
* *
* @version $Id: po.php 283 2009-09-23 16:21:51Z nbachiyski $ * @version $Id: po.php 406 2010-02-07 11:10:24Z nbachiyski $
* @package pomo * @package pomo
* @subpackage po * @subpackage po
*/ */
@ -254,7 +254,7 @@ class PO extends Gettext_Translations {
return false; return false;
} }
// add comment // add comment
$this->add_comment_to_entry($entry, $line); $this->add_comment_to_entry($entry, $line);;
} elseif (preg_match('/^msgctxt\s+(".*")/', $line, $m)) { } elseif (preg_match('/^msgctxt\s+(".*")/', $line, $m)) {
if ($is_final($context)) { if ($is_final($context)) {
PO::read_line($f, 'put-back'); PO::read_line($f, 'put-back');

View File

@ -3,7 +3,7 @@
* Classes, which help reading streams of data from files. * Classes, which help reading streams of data from files.
* Based on the classes from Danilo Segan <danilo@kvota.net> * Based on the classes from Danilo Segan <danilo@kvota.net>
* *
* @version $Id: streams.php 293 2009-11-12 15:43:50Z nbachiyski $ * @version $Id: streams.php 406 2010-02-07 11:10:24Z nbachiyski $
* @package pomo * @package pomo
* @subpackage streams * @subpackage streams
*/ */

View File

@ -2,7 +2,7 @@
/** /**
* Class for a set of entries for translation and their associated headers * Class for a set of entries for translation and their associated headers
* *
* @version $Id: translations.php 291 2009-10-21 05:46:08Z nbachiyski $ * @version $Id: translations.php 406 2010-02-07 11:10:24Z nbachiyski $
* @package pomo * @package pomo
* @subpackage translations * @subpackage translations
*/ */
@ -104,7 +104,9 @@ class Translations {
* @return void * @return void
**/ **/
function merge_with(&$other) { function merge_with(&$other) {
$this->entries = array_merge($this->entries, $other->entries); foreach( $other->entries as $entry ) {
$this->entries[$entry->key()] = $entry;
}
} }
} }