r52389 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52388‎ | r52389 | r52390 >
Date:09:31, 25 June 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
Convert to new system
Modified paths:
  • /trunk/extensions/Translate/scripts/poimport.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/poimport.php
@@ -81,7 +81,8 @@
8282 $group = MessageGroups::getGroup( $id );
8383
8484 $messages = $group->initCollection( $code );
85 - $group->fillCollection( $messages );
 85+ $messages->setInfile( $group->load( $code ) );
 86+ $messages->loadTranslations();
8687
8788 return $messages;
8889 }
@@ -144,11 +145,17 @@
145146 $translation = TRANSLATE_FUZZY . $translation;
146147 }
147148
148 - if ( $translation !== (string) $contents[$key]->translation ) {
 149+ $oldtranslation = (string) $contents[$key]->translation();
 150+
 151+ if ( $translation !== $oldtranslation ) {
149152 if ( $translation === '' ) {
150153 STDOUT( "Skipping empty translation in the po file for $key!" );
151154 } else {
152 - STDOUT( "Translation of $key differs:\n$translation\n" );
 155+ if ( $oldtranslation === '' ) {
 156+ STDOUT( "New translation for $key" );
 157+ } else {
 158+ STDOUT( "Translation of $key differs:\n$translation\n" );
 159+ }
153160 $changes["$key/$code"] = $translation;
154161 }
155162 }

Status & tagging log