https://www.mediawiki.org/wiki/Special:Code/MediaWiki/110309

Revision: 110309
Author:   nikerabbit
Date:     2012-01-30 17:45:48 +0000 (Mon, 30 Jan 2012)
Log Message:
-----------
A bit ugly fix to allow Special:Translate/page-Foo_bar syntax for translatable 
pages with spaces.

Modified Paths:
--------------
    trunk/extensions/Translate/MessageGroups.php

Modified: trunk/extensions/Translate/MessageGroups.php
===================================================================
--- trunk/extensions/Translate/MessageGroups.php        2012-01-30 17:36:43 UTC 
(rev 110308)
+++ trunk/extensions/Translate/MessageGroups.php        2012-01-30 17:45:48 UTC 
(rev 110309)
@@ -1182,6 +1182,11 @@
        public static function getGroup( $id ) {
                // BC with page| which is now page-
                $id = strtr( $id, '|', '-' );
+               /* Translatable pages use spaces, but MW occasionally likes to
+                * normalize spaces to underscores */
+               if ( strpos( $id, 'page-' ) === 0 ) {
+                       $id = strtr( $id, '_', ' ' );
+               }
                self::init();
 
                global $wgTranslateEC, $wgTranslateAC, $wgTranslateCC;


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to