$index = $nameNodes->item( 0 )->attributes->getNamedItem( 'index' )->textContent;
$index = $index - $indexOffset;
if ( isset( $namedArgs[$index] ) || isset( $numberedArgs[$index] ) ) {
+ $this->parser->getOutput()->addWarning( wfMessage( 'duplicate-args-warning',
+ wfEscapeWikiText( $this->title ),
+ wfEscapeWikiText( $title ),
+ wfEscapeWikiText( $index ) )->text() );
$this->parser->addTrackingCategory( 'duplicate-args-category' );
}
$numberedArgs[$index] = $value->item( 0 );
// Named parameter
$name = trim( $this->expand( $nameNodes->item( 0 ), PPFrame::STRIP_COMMENTS ) );
if ( isset( $namedArgs[$name] ) || isset( $numberedArgs[$name] ) ) {
+ $this->parser->getOutput()->addWarning( wfMessage( 'duplicate-args-warning',
+ wfEscapeWikiText( $this->title ),
+ wfEscapeWikiText( $title ),
+ wfEscapeWikiText( $name ) )->text() );
$this->parser->addTrackingCategory( 'duplicate-args-category' );
}
$namedArgs[$name] = $value->item( 0 );
// Numbered parameter
$index = $bits['index'] - $indexOffset;
if ( isset( $namedArgs[$index] ) || isset( $numberedArgs[$index] ) ) {
+ $this->parser->getOutput()->addWarning( wfMessage( 'duplicate-args-warning',
+ wfEscapeWikiText( $this->title ),
+ wfEscapeWikiText( $title ),
+ wfEscapeWikiText( $index ) )->text() );
$this->parser->addTrackingCategory( 'duplicate-args-category' );
}
$numberedArgs[$index] = $bits['value'];
// Named parameter
$name = trim( $this->expand( $bits['name'], PPFrame::STRIP_COMMENTS ) );
if ( isset( $namedArgs[$name] ) || isset( $numberedArgs[$name] ) ) {
+ $this->parser->getOutput()->addWarning( wfMessage( 'duplicate-args-warning',
+ wfEscapeWikiText( $this->title ),
+ wfEscapeWikiText( $title ),
+ wfEscapeWikiText( $name ) )->text() );
$this->parser->addTrackingCategory( 'duplicate-args-category' );
}
$namedArgs[$name] = $bits['value'];
"content-model-json": "JSON",
"content-json-empty-object": "Empty object",
"content-json-empty-array": "Empty array",
+ "duplicate-args-warning": "<strong>Warning:</strong> [[:$1]] is calling [[:$2]] with more than one value for the \"$3\" parameter. Only the last value provided will be used.",
"duplicate-args-category": "Pages using duplicate arguments in template calls",
"duplicate-args-category-desc": "The page contains template calls that use duplicates of arguments, such as <code><nowiki>{{foo|bar=1|bar=2}}</nowiki></code> or <code><nowiki>{{foo|bar|1=baz}}</nowiki></code>.",
"expensive-parserfunction-warning": "<strong>Warning:</strong> This page contains too many expensive parser function calls.\n\nIt should have less than $2 {{PLURAL:$2|call|calls}}, there {{PLURAL:$1|is now $1 call|are now $1 calls}}.",
"content-model-json": "Name for the JSON content model, used when decribing what type of content a page contains.\n\nThis message is substituted in:\n*{{msg-mw|Bad-target-model}}\n*{{msg-mw|Content-not-allowed-here}}",
"content-json-empty-object": "Used to represent an object with no properties on a JSON content model page.",
"content-json-empty-array": "Used to represent an array with no values on a JSON content model page.",
+ "duplicate-args-warning": "If a page calls a template and specifies the same argument more than once, such as <code><nowiki>{{foo|bar=1|bar=2}}</nowiki></code> or <code><nowiki>{{foo|bar|1=baz}}</nowiki></code>, this warning is displayed when previewing.\n\nParameters:\n* $1 - The calling page\n* $2 - The called template\n $3 - The name of the duplicated argument",
"duplicate-args-category": "This message is used as a category name for a [[mw:Special:MyLanguage/Help:Tracking categories|tracking category]] where pages are placed automatically if they contain template calls that use duplicates of arguments, such as <code><nowiki>{{foo|bar=1|bar=2}}</nowiki></code> or <code><nowiki>{{foo|bar|1=baz}}</nowiki></code>.",
"duplicate-args-category-desc": "Duplicate arguments category description. Shown on [[Special:TrackingCategories]].\n\nSee also:\n* {{msg-mw|Duplicate-args-category}}",
"expensive-parserfunction-warning": "On some (expensive) [[MetaWikipedia:Help:ParserFunctions|parser functions]] (e.g. <code><nowiki>{{#ifexist:}}</nowiki></code>) there is a limit of how many times it may be used. This is an error message shown when the limit is exceeded.\n\nParameters:\n* $1 - the current number of parser function calls\n* $2 - the allowed number of parser function calls\nSee also [[:mw:Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit in the MediaWiki manual]].\n\nSee also:\n* {{msg-mw|Expensive-parserfunction-category}}",