r37735 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37734‎ | r37735 | r37736 >
Date:03:54, 16 July 2008
Author:demon
Status:old
Tags:
Comment:
Localize this more. Also, fix some XHTML validation errors on using 'name' instead of 'id'. Uses patch by Platonides for bug 14727.
Modified paths:
  • /trunk/extensions/timeline/Timeline.i18n.php (modified) (history)
  • /trunk/extensions/timeline/Timeline.php (modified) (history)

Diff [purge]

Index: trunk/extensions/timeline/Timeline.i18n.php
@@ -9,6 +9,8 @@
1010
1111 $messages['en'] = array(
1212 'timeline-desc' => 'Adds <tt>&lt;timeline&gt;</tt> tag to create timelines',
 13+ 'timeline-install-error' => 'Timeline error: Executable not found. Command line was: $1',
 14+ 'timeline' => 'Timeline for $1', // Where $1 is the article name
1315 );
1416
1517 /** Afrikaans (Afrikaans)
Index: trunk/extensions/timeline/Timeline.php
@@ -39,6 +39,7 @@
4040 global $wgUploadDirectory, $wgUploadPath, $IP, $wgTimelineSettings, $wgArticlePath, $wgTmpDirectory;
4141 $hash = md5( $timelinesrc );
4242 $dest = $wgUploadDirectory."/timeline/";
 43+ wfLoadExtensionMessages('Timeline');
4344 if ( ! is_dir( $dest ) ) { mkdir( $dest, 0777 ); }
4445 if ( ! is_dir( $wgTmpDirectory ) ) { mkdir( $wgTmpDirectory, 0777 ); }
4546
@@ -58,8 +59,7 @@
5960 unlink($fname);
6061
6162 if ( $ret == "" ) {
62 - // Message not localized, only relevant during install
63 - return "<div id=\"toc\"><tt>Timeline error: Executable not found. Command line was: {$cmdline}</tt></div>";
 63+ return "<div id=\"toc\"><tt>" . wfMsgReplaceArgs( 'timeline-install-error', $cmdline ) . "</tt></div>";
6464 }
6565
6666 }
@@ -77,8 +77,11 @@
7878 $ext = "png";
7979 }
8080
81 - $txt = "<map name=\"$hash\">{$map}</map>".
82 - "<img usemap=\"#{$hash}\" src=\"{$wgUploadPath}/timeline/{$hash}.{$ext}\">";
 81+ $txt = "<map id=\"timeline_$hash\">{$map}</map>".
 82+ "<img usemap=\"#timeline_{$hash}\" src=\"{$wgUploadPath}/timeline/{$hash}.{$ext}\" alt=\"" .
 83+ wfMsgReplaceArgs('timeline', $wgTitle->getPrefixedText() ) . "\">";
8384 }
 85+
 86+ }
8487 return $txt;
8588 }

Status & tagging log