r40592 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40591‎ | r40592 | r40593 >
Date:18:42, 7 September 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* Hopefully fixed message flow to older branches
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/MessageGroups.php
@@ -311,10 +311,12 @@
312312 // Can return null, convert to array
313313 $messages = (array) $this->mangler->mangle(
314314 ResourceLoader::loadVariableFromPHPFile( $file, 'messages' ) );
315 - if ( $this->getId() !== 'core' && $code !== 'en' ) {
316 - // For branches, load trunk messages that are not in database
317 - $trunk = MessageGroups::getGroup( 'core' );
318 - $messages += $trunk->load( $code );
 315+ if ( $this->parentId ) {
 316+ if ( $code !== 'en' ) {
 317+ // For branches, load newer compatible messages for missing entries, if any
 318+ $trunk = MessageGroups::getGroup( $this->parentId );
 319+ $messages += $trunk->mangler->unmangle( $trunk->load( $code ) );
 320+ }
319321 }
320322
321323 return $messages;