From: Niklas Laxström Date: Sun, 20 Apr 2008 10:54:56 +0000 (+0000) Subject: * Support prefix for message meta data X-Git-Tag: 1.31.0-rc.0~48171 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=ad8333fbbcf4b26fa17ee9b00ad52f5de362dafa;p=lhc%2Fweb%2Fwiklou.git * Support prefix for message meta data --- diff --git a/maintenance/language/writeMessagesArray.inc b/maintenance/language/writeMessagesArray.inc index 5e2b4a64b2..05e6d01df3 100644 --- a/maintenance/language/writeMessagesArray.inc +++ b/maintenance/language/writeMessagesArray.inc @@ -9,7 +9,6 @@ class MessageWriter { static $optionalComment = 'only translate this message to other languages if you have to change it'; static $ignoredComment = "do not translate or duplicate this message to other languages"; - static $loaded = false; static $messageStructure; static $blockComments; static $messageComments; @@ -66,20 +65,19 @@ class MessageWriter { * * @return Array of the PHP text and the sorted messages array. */ - public static function writeMessagesArray( $messages, $ignoredComments = false ) { + public static function writeMessagesArray( $messages, $ignoredComments = false, $prefix = false ) { # Load messages - if( !self::$loaded ) { - require( dirname( __FILE__ ) . '/messages.inc' ); - self::$messageStructure = $wgMessageStructure; - self::$blockComments = $wgBlockComments; - self::$messageComments = $wgMessageComments; + $dir = $prefix ? $prefix : dirname( __FILE__ ); + + require( $dir . '/messages.inc' ); + self::$messageStructure = $wgMessageStructure; + self::$blockComments = $wgBlockComments; + self::$messageComments = $wgMessageComments; - require( dirname( __FILE__ ) . '/messageTypes.inc' ); - self::$ignoredMessages = $wgIgnoredMessages; - self::$optionalMessages = $wgOptionalMessages; + require( $dir . '/messageTypes.inc' ); + self::$ignoredMessages = $wgIgnoredMessages; + self::$optionalMessages = $wgOptionalMessages; - self::$loaded = true; - } # Sort messages to blocks $sortedMessages['unknown'] = $messages;