r43422 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43421‎ | r43422 | r43423 >
Date:21:00, 12 November 2008
Author:raymond
Status:old
Tags:
Comment:
Add messages for hardcoded parser warnings
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -573,6 +573,8 @@
574574 'post-expand-template-inclusion-category',
575575 'post-expand-template-argument-warning',
576576 'post-expand-template-argument-category',
 577+ 'parser-template-loop-warning',
 578+ 'parser-template-recursion-depth-warning',
577579 ),
578580 'undo' => array(
579581 'undo-success',
Index: trunk/phase3/includes/parser/Parser.php
@@ -2943,14 +2943,14 @@
29442944 # Do infinite loop check
29452945 if ( !$frame->loopCheck( $title ) ) {
29462946 $found = true;
2947 - $text = "<span class=\"error\">Template loop detected: [[$titleText]]</span>";
 2947+ $text = '<span class="error">' . wfMsgForContent( 'parser-template-loop-warning', $titleText ) . '</span>';
29482948 wfDebug( __METHOD__.": template loop broken at '$titleText'\n" );
29492949 }
29502950 # Do recursion depth check
29512951 $limit = $this->mOptions->getMaxTemplateDepth();
29522952 if ( $frame->depth >= $limit ) {
29532953 $found = true;
2954 - $text = "<span class=\"error\">Template recursion depth limit exceeded ($limit)</span>";
 2954+ $text = '<span class="error">' . wfMsgForContent( 'parser-template-recursion-depth-warning', $limit ) . '</span>';
29552955 }
29562956 }
29572957 }
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1216,6 +1216,8 @@
12171217 'post-expand-template-argument-warning' => 'Warning: This page contains at least one template argument which has a too large expansion size.
12181218 These arguments have been omitted.',
12191219 'post-expand-template-argument-category' => 'Pages containing omitted template arguments',
 1220+'parser-template-loop-warning' => 'Template loop detected: [[$1]]',
 1221+'parser-template-recursion-depth-warning' => 'Template recursion depth limit exceeded ($1)',
12201222
12211223 # "Undo" feature
12221224 'undo-success' => 'The edit can be undone.

Status & tagging log