Display Cite errors in the user language

To make debugging easier when something goes wrong, display Cite errors
in the user language. This will fragment the parser cache, but since
these errors should be rate to not make this a problem.

Bug: T33216
Change-Id: I0f116f6da4b8f07b34f7d122458b6e23f542d468
This commit is contained in:
Kunal Mehta 2016-01-06 12:48:33 -08:00
parent d233a8811e
commit 55080cb5ed

View file

@ -1165,8 +1165,14 @@ class Cite {
# We rely on the fact that PHP is okay with passing unused argu-
# ments to functions. If $1 is not used in the message, wfMessage will
# just ignore the extra parameter.
$msg = wfMessage( 'cite_error', wfMessage( $key, $param )->inContentLanguage()->plain() )
->inContentLanguage()
# For ease of debugging and because errors are rare, we
# use the user language and split the parser cache.
$lang = $this->mParser->getOptions()->getUserLangObj();
$msg = wfMessage(
'cite_error',
wfMessage( $key, $param )->inLanguage( $lang )->plain()
)
->inLanguage( $lang )
->plain();
$this->mParser->addTrackingCategory( 'cite-tracking-category-cite-error' );