Add messages for hardcoded parser warnings
authorRaimond Spekking <raymond@users.mediawiki.org>
Wed, 12 Nov 2008 21:00:59 +0000 (21:00 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Wed, 12 Nov 2008 21:00:59 +0000 (21:00 +0000)
includes/parser/Parser.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 1a84efa..7fc3a88 100644 (file)
@@ -2943,14 +2943,14 @@ class Parser
                                # Do infinite loop check
                                if ( !$frame->loopCheck( $title ) ) {
                                        $found = true;
-                                       $text = "<span class=\"error\">Template loop detected: [[$titleText]]</span>";
+                                       $text = '<span class="error">' . wfMsgForContent( 'parser-template-loop-warning', $titleText ) . '</span>';
                                        wfDebug( __METHOD__.": template loop broken at '$titleText'\n" );
                                }
                                # Do recursion depth check
                                $limit = $this->mOptions->getMaxTemplateDepth();
                                if ( $frame->depth >= $limit ) {
                                        $found = true;
-                                       $text = "<span class=\"error\">Template recursion depth limit exceeded ($limit)</span>";
+                                       $text = '<span class="error">' . wfMsgForContent( 'parser-template-recursion-depth-warning', $limit ) . '</span>';
                                }
                        }
                }
index 8243cb7..1cc20e3 100644 (file)
@@ -1216,6 +1216,8 @@ Some templates will not be included.',
 'post-expand-template-argument-warning'   => 'Warning: This page contains at least one template argument which has a too large expansion size.
 These arguments have been omitted.',
 'post-expand-template-argument-category'  => 'Pages containing omitted template arguments',
+'parser-template-loop-warning'            => 'Template loop detected: [[$1]]',
+'parser-template-recursion-depth-warning' => 'Template recursion depth limit exceeded ($1)',
 
 # "Undo" feature
 'undo-success' => 'The edit can be undone.
index 3517924..808d883 100644 (file)
@@ -573,6 +573,8 @@ $wgMessageStructure = array(
                'post-expand-template-inclusion-category',
                'post-expand-template-argument-warning',
                'post-expand-template-argument-category',
+               'parser-template-loop-warning',
+               'parser-template-recursion-depth-warning',
        ),
        'undo' => array(
                'undo-success',