http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56366

Revision: 56366
Author:   raymond
Date:     2009-09-15 16:14:13 +0000 (Tue, 15 Sep 2009)

Log Message:
-----------
Bug 20652: Make hardcoded error message localizable.

Modified Paths:
--------------
    trunk/extensions/timeline/Timeline.i18n.php
    trunk/extensions/timeline/Timeline.php

Modified: trunk/extensions/timeline/Timeline.i18n.php
===================================================================
--- trunk/extensions/timeline/Timeline.i18n.php 2009-09-15 16:09:41 UTC (rev 
56365)
+++ trunk/extensions/timeline/Timeline.i18n.php 2009-09-15 16:14:13 UTC (rev 
56366)
@@ -11,6 +11,7 @@
 /** English */
 $messages['en'] = array(
        'timeline-desc' => 'Adds <tt>&lt;timeline&gt;</tt> tag to create 
timelines',
+       'timeline-invalidmap' => 'Invalid image map generated by EasyTimeline',
 );
 
 /** Message documentation (Message documentation)

Modified: trunk/extensions/timeline/Timeline.php
===================================================================
--- trunk/extensions/timeline/Timeline.php      2009-09-15 16:09:41 UTC (rev 
56365)
+++ trunk/extensions/timeline/Timeline.php      2009-09-15 16:14:13 UTC (rev 
56366)
@@ -130,18 +130,19 @@
  */
 function easyTimelineFixMap( $html ) {
        global $wgUrlProtocols;
-       $error = '<strong class="error">Invalid image map generated by 
EasyTimeline</strong>';
        $doc = new DOMDocument( '1.0', 'UTF-8' );
        wfSuppressWarnings();
        $status = $doc->loadXML( $html );
        wfRestoreWarnings();
        if ( !$status ) {
-               return $error;
+               wfLoadExtensionMessages( 'Timeline' ); // Load messages only if 
error occurs
+               return '<strong class="error">' . wfMsg( 'timeline-invalidmap' 
) . '</strong>';
        }
 
        $map = $doc->firstChild;
        if ( strtolower( $map->nodeName ) !== 'map' ) {
-               return $error;
+               wfLoadExtensionMessages( 'Timeline' ); // Load messages only if 
error occurs
+               return '<strong class="error">' . wfMsg( 'timeline-invalidmap' 
) . '</strong>';
        }
        $name = $map->attributes->getNamedItem( 'name' )->value;
        $html = Xml::openElement( 'map', array( 'name' => $name ) );



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to