Index: trunk/extensions/timeline/Timeline.i18n.php |
— | — | @@ -11,6 +11,7 @@ |
12 | 12 | /** English */ |
13 | 13 | $messages['en'] = array( |
14 | 14 | 'timeline-desc' => 'Adds <tt><timeline></tt> tag to create timelines', |
| 15 | + 'timeline-invalidmap' => 'Invalid image map generated by EasyTimeline', |
15 | 16 | ); |
16 | 17 | |
17 | 18 | /** Message documentation (Message documentation) |
Index: trunk/extensions/timeline/Timeline.php |
— | — | @@ -130,18 +130,19 @@ |
131 | 131 | */ |
132 | 132 | function easyTimelineFixMap( $html ) { |
133 | 133 | global $wgUrlProtocols; |
134 | | - $error = '<strong class="error">Invalid image map generated by EasyTimeline</strong>'; |
135 | 134 | $doc = new DOMDocument( '1.0', 'UTF-8' ); |
136 | 135 | wfSuppressWarnings(); |
137 | 136 | $status = $doc->loadXML( $html ); |
138 | 137 | wfRestoreWarnings(); |
139 | 138 | if ( !$status ) { |
140 | | - return $error; |
| 139 | + wfLoadExtensionMessages( 'Timeline' ); // Load messages only if error occurs |
| 140 | + return '<strong class="error">' . wfMsg( 'timeline-invalidmap' ) . '</strong>'; |
141 | 141 | } |
142 | 142 | |
143 | 143 | $map = $doc->firstChild; |
144 | 144 | if ( strtolower( $map->nodeName ) !== 'map' ) { |
145 | | - return $error; |
| 145 | + wfLoadExtensionMessages( 'Timeline' ); // Load messages only if error occurs |
| 146 | + return '<strong class="error">' . wfMsg( 'timeline-invalidmap' ) . '</strong>'; |
146 | 147 | } |
147 | 148 | $name = $map->attributes->getNamedItem( 'name' )->value; |
148 | 149 | $html = Xml::openElement( 'map', array( 'name' => $name ) ); |