jenkins-bot has submitted this change and it was merged.

Change subject: Add tracking category for math errors
......................................................................


Add tracking category for math errors

Bug: T134872
Change-Id: I6d0bce34aacfba27bedda23f6395001dae9c6568
---
M Math.hooks.php
M extension.json
M i18n/en.json
M i18n/qqq.json
4 files changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Mobrovac: Looks good to me, approved
  Raimond Spekking: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/Math.hooks.php b/Math.hooks.php
index b7f5a95..e85c3a3 100644
--- a/Math.hooks.php
+++ b/Math.hooks.php
@@ -216,7 +216,8 @@
                $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 @@
                } else {
                        LoggerFactory::getInstance( 'Math' )->warning(
                                "Rendering failed. Printing error message." );
+                       $parser->addTrackingCategory( 
'math-tracking-category-error' );
                        return $renderer->getLastError();
                }
                Hooks::run( 'MathFormulaPostRender',
diff --git a/extension.json b/extension.json
index 708fa4e..918fce5 100644
--- a/extension.json
+++ b/extension.json
@@ -231,5 +231,8 @@
                "MathShowImage": "SpecialMathShowImage",
                "MathStatus": "SpecialMathStatus"
        },
+       "TrackingCategories": [
+               "math-tracking-category-error"
+       ],
        "manifest_version": 1
 }
diff --git a/i18n/en.json b/i18n/en.json
index 7066b3c..2672873 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -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)",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 919661a..0694afd 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -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}}",

-- 
To view, visit https://gerrit.wikimedia.org/r/292576
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6d0bce34aacfba27bedda23f6395001dae9c6568
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <w...@physikerwelt.de>
Gerrit-Reviewer: GWicke <gwi...@wikimedia.org>
Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: Raimond Spekking <raimond.spekk...@gmail.com>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: TheDJ <hartman.w...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to