Add tracking category for math errors

Bug: T134872
Change-Id: I6d0bce34aacfba27bedda23f6395001dae9c6568
This commit is contained in:
Moritz Schubotz 2016-06-03 17:42:59 +02:00 committed by Mobrovac
parent 81156bfc08
commit 14ec229cf9
4 changed files with 10 additions and 1 deletions

View file

@ -216,7 +216,8 @@ class MathHooks {
$checkResult = $renderer->checkTeX();
if ( $checkResult !== true ) {
// Returns the error message
// Returns the error message and add tracking category
$parser->addTrackingCategory( 'math-tracking-category-error' );
return $renderer->getLastError();
}
@ -226,6 +227,7 @@ class MathHooks {
} else {
LoggerFactory::getInstance( 'Math' )->warning(
"Rendering failed. Printing error message." );
$parser->addTrackingCategory( 'math-tracking-category-error' );
return $renderer->getLastError();
}
Hooks::run( 'MathFormulaPostRender',

View file

@ -231,5 +231,8 @@
"MathShowImage": "SpecialMathShowImage",
"MathStatus": "SpecialMathStatus"
},
"TrackingCategories": [
"math-tracking-category-error"
],
"manifest_version": 1
}

View file

@ -74,6 +74,8 @@
"math-test-contains-diff" : "Returned string $1 does not contain expected string $2.",
"math-test-equals-diff" : "Returned string $1 is different from expected string $2.",
"math_tip": "Mathematical formula (LaTeX)",
"math-tracking-category-error": "Pages with math errors",
"math-tracking-category-error-desc": "Pages in this category have errors in the usage of math tags.",
"math_unknown_error": "unknown error",
"math_unknown_function": "unknown function \"$1\"",
"mw_math_latexml": "LaTeXML (experimental; uses MathML)",

View file

@ -73,6 +73,8 @@
"math-test-contains-diff": "Used as special-page wikitext.\n\nParameters:\n* $1 syntax highlight element of the returned string \n* $2 syntax highlight element of the expected string",
"math-test-equals-diff": "Used as special-page wikitext.\n\nParameters:\n* $1 syntax highlight element of the returned string \n* $2 syntax highlight element of the expected string",
"math_tip": "This is the text that appears when you hover the mouse over the fourth button from the right on the edit toolbar.",
"math-tracking-category-error": "Tracking category name.",
"math-tracking-category-error-desc": "Tracking category description.",
"math_unknown_error": "Used as error message for unknown texvc error.\n\nThis message follows the message {{msg-mw|Math failure}}.\n{{Identical|Unknown error}}",
"math_unknown_function": "Used as error message when texvc encounters an unknown function.\n\nPreceded by the message {{msg-mw|Math failure}}.\n\nParameters:\n* $1 - name of unknown function",
"mw_math_latexml": "Used as label for latexml radio button.\n\nSee also:\n* {{msg-mw|Mw math png}}\n* {{msg-mw|Mw math source}}\n* {{msg-mw|Mw math mathjax}}",