Fix more localization errors and update the test/localization.html accordingly ; Also force all menu items to display in the test. #529
This commit is contained in:
parent
026e261e00
commit
f42ac43cd4
|
@ -48,16 +48,7 @@
|
||||||
|
|
||||||
/* set the currentLocale */
|
/* set the currentLocale */
|
||||||
MathJax.Hub.Config({
|
MathJax.Hub.Config({
|
||||||
menuSettings: { locale: currentLocale },
|
menuSettings: { locale: currentLocale }
|
||||||
MathMenu: {
|
|
||||||
showRenderer: true,
|
|
||||||
showMathPlayer: true,
|
|
||||||
showFontMenu: true,
|
|
||||||
showContext: true,
|
|
||||||
showDiscoverable: true,
|
|
||||||
showLocale: true,
|
|
||||||
showLocaleURL: true
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
var menu = MathJax.HTML.Cookie.Get("menu");
|
var menu = MathJax.HTML.Cookie.Get("menu");
|
||||||
menu.locale = currentLocale;
|
menu.locale = currentLocale;
|
||||||
|
@ -102,14 +93,23 @@
|
||||||
message += MathJax.Localization._(["MathMenu","SwitchAnyway"], _M_);
|
message += MathJax.Localization._(["MathMenu","SwitchAnyway"], _M_);
|
||||||
alert(message);
|
alert(message);
|
||||||
}
|
}
|
||||||
|
function showAllItems(aMenu)
|
||||||
|
{
|
||||||
|
for (var i = 0, m = aMenu.items.length; i < m; i++) {
|
||||||
|
var item = aMenu.items[i];
|
||||||
|
item.hidden = false;
|
||||||
|
item.disabled = false;
|
||||||
|
if (item.menu) showAllItems(item.menu);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MathJax.Hub.Register.StartupHook("MathMenu Ready", function () {
|
||||||
|
showAllItems(MathJax.Menu.menu);
|
||||||
|
});
|
||||||
|
|
||||||
/* Simulate some error messages... */
|
/* These MathML parsing errors happen only in rare cases, so we fake them... */
|
||||||
MathJax.Hub.Queue(function() {
|
MathJax.Hub.Queue(function() {
|
||||||
document.getElementById('ErrorParsingMathML').innerHTML = MathJax.Localization._(['MathML','ErrorParsingMathML'], _M_);
|
document.getElementById('ErrorParsingMathML').innerHTML = MathJax.Localization._(['MathML','ErrorParsingMathML'], _M_);
|
||||||
document.getElementById('MathMLSingleElement').innerHTML = MathJax.Localization._(['MathML','MathMLSingleElement'], _M_);
|
document.getElementById('MathMLSingleElement').innerHTML = MathJax.Localization._(['MathML','MathMLSingleElement'], _M_);
|
||||||
document.getElementById('MissingOpenForSub').innerHTML = MathJax.Localization._(['TeX','MissingOpenForSub'], _M_);
|
|
||||||
document.getElementById('MissingBoxFor').innerHTML = MathJax.Localization._(['TeX','MissingBoxFor'], _M_, 'COMMANDNAME');
|
|
||||||
document.getElementById('ExtraClose').innerHTML = MathJax.Localization._(['TeX','ExtraClose'], _M_);
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -152,14 +152,10 @@
|
||||||
<li>CantCreateXMLParser: <input type="button" onclick="alert(MathJax.Localization._(['MathML','CantCreateXMLParser'], _M_))" value="Show alert box"/></li>
|
<li>CantCreateXMLParser: <input type="button" onclick="alert(MathJax.Localization._(['MathML','CantCreateXMLParser'], _M_))" value="Show alert box"/></li>
|
||||||
<li>UnknownNodeType: <math><UNKNOWNNODE/></math></li>
|
<li>UnknownNodeType: <math><UNKNOWNNODE/></math></li>
|
||||||
<li>UnexpectedTextNode: <math>UNEXPECTEDTEXT</math></li>
|
<li>UnexpectedTextNode: <math>UNEXPECTEDTEXT</math></li>
|
||||||
<li>ErrorParsingMathML:
|
<li>ErrorParsingMathML: <math><merror><mtext id="ErrorParsingMathML"></mtext></merror></math>
|
||||||
<!-- fredw: not sure how to produce this error... -->
|
|
||||||
<math><merror><mtext id="ErrorParsingMathML"></mtext></merror></math>
|
|
||||||
</li>
|
</li>
|
||||||
<li>ParsingError: <script type="math/mml"></script></li>
|
<li>ParsingError: <script type="math/mml"></script></li>
|
||||||
<li>MathMLSingleElement:
|
<li>MathMLSingleElement: <math><merror><mtext id="MathMLSingleElement"></mtext></merror></math>
|
||||||
<!-- fredw: not sure how to produce this error... -->
|
|
||||||
<math><merror><mtext id="MathMLSingleElement"></mtext></merror></math>
|
|
||||||
<li>MathMLRootElement: <script type="math/mml"><INVALIDROOT/></script></li>
|
<li>MathMLRootElement: <script type="math/mml"><INVALIDROOT/></script></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
@ -173,14 +169,25 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li id="MathMenu">MathMenu:
|
<li id="MathMenu">MathMenu:
|
||||||
<!-- fredw: all the menu items may not be displayed -->
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Right click on one these formulas to display the menu:
|
<li>Right click on one these formulas to display the menu:
|
||||||
<ul>
|
<ul>
|
||||||
<li>TeX: \( x \)</li>
|
<li>TeX: \( x \)</li>
|
||||||
<li>AsciiMath: `x`</li>
|
<li>AsciiMath: `x`</li>
|
||||||
<li>MathML: <math><mi>x</mi></math></li>
|
<li>MathML: <math><mi>x</mi></math></li>
|
||||||
<li>MathProcessingError: <script id="s3"></script></li>
|
<li>MathProcessingError: <script id="s3"></script></li>
|
||||||
|
<li>Annotation:
|
||||||
|
<math>
|
||||||
|
<semantics>
|
||||||
|
<mi>x</mi>
|
||||||
|
<annotation encoding="TeX">x (TeX)</annotation>
|
||||||
|
<annotation encoding="StarMath 5.0">x (StarMath)</annotation>
|
||||||
|
<annotation encoding="Maple">x (Maple)</annotation>
|
||||||
|
<annotation-xml encoding="MathML-Content"><ci>x</ci></annotation-xml>
|
||||||
|
<annotation-xml encoding="OpenMath"><OMV name="x"/></annotation-xml>
|
||||||
|
</semantics>
|
||||||
|
</math>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>About Box: <input type="button" onclick="MathJax.Menu.About()" value="Show About Box"/></li>
|
<li>About Box: <input type="button" onclick="MathJax.Menu.About()" value="Show About Box"/></li>
|
||||||
|
@ -221,18 +228,12 @@
|
||||||
<li>MissingScript: \( x^ \)</li>
|
<li>MissingScript: \( x^ \)</li>
|
||||||
<li>ExtraLeftMissingRight: \( \left( \)</li>
|
<li>ExtraLeftMissingRight: \( \left( \)</li>
|
||||||
<li>Misplaced: \( & \)</li>
|
<li>Misplaced: \( & \)</li>
|
||||||
<li>MissingOpenForSub:
|
<li>MissingOpenForSub: \( x__ \)</li>
|
||||||
<!-- fredw: not sure how to produce this error... -->
|
|
||||||
<math><merror><mtext id="MissingOpenForSub"></mtext></merror></math>
|
|
||||||
</li>
|
|
||||||
<li>MissingOpenForSup: \( x^^ \)</li>
|
<li>MissingOpenForSup: \( x^^ \)</li>
|
||||||
<li>AmbiguousUseOf: \( x \over y \over z \)</li>
|
<li>AmbiguousUseOf: \( x \over y \over z \)</li>
|
||||||
<li>EnvBadEnd: \( \begin{aligned} \end{eqarray} \)</li>
|
<li>EnvBadEnd: \( \begin{aligned} \end{eqarray} \)</li>
|
||||||
<li>EnvMissingEnd: \( \begin{aligned} \)</li>
|
<li>EnvMissingEnd: \( \begin{aligned} \)</li>
|
||||||
<li>MissingBoxFor:
|
<li>MissingBoxFor: \( \raise 1pt \)</li>
|
||||||
<!-- fredw: not sure how to produce this error... -->
|
|
||||||
<math><merror><mtext id="MissingBoxFor"></mtext></merror></math>
|
|
||||||
</li>
|
|
||||||
<li>MissingCloseBrace: \( \array{ \)</li>
|
<li>MissingCloseBrace: \( \array{ \)</li>
|
||||||
<li>UndefinedControlSequence: \( \UNDEFINED \)</li>
|
<li>UndefinedControlSequence: \( \UNDEFINED \)</li>
|
||||||
<li>DoubleExponent: \( x^3^2 \) </li>
|
<li>DoubleExponent: \( x^3^2 \) </li>
|
||||||
|
@ -254,10 +255,6 @@
|
||||||
<li>BracketMustBeDimension: \(\begin{array} x \\[INVALID] y \end{array}\)</li>
|
<li>BracketMustBeDimension: \(\begin{array} x \\[INVALID] y \end{array}\)</li>
|
||||||
<li>InvalidEnv: \( \begin{_INVALID_} \end{_INVALID_} \)</li>
|
<li>InvalidEnv: \( \begin{_INVALID_} \end{_INVALID_} \)</li>
|
||||||
<li>UnknownEnv: \( \begin{UNKNOWN} \end{UNKNOWN} \) </li>
|
<li>UnknownEnv: \( \begin{UNKNOWN} \end{UNKNOWN} \) </li>
|
||||||
<li>ExtraClose:
|
|
||||||
<!-- fredw: not sure how to produce this error... -->
|
|
||||||
<math><merror><mtext id="ExtraClose"></mtext></merror></math>
|
|
||||||
</li>
|
|
||||||
<li>ExtraCloseLooking: \( \sqrt[}]x \)</li>
|
<li>ExtraCloseLooking: \( \sqrt[}]x \)</li>
|
||||||
<li>MissingCloseBracket: \( \sqrt[ \)</li>
|
<li>MissingCloseBracket: \( \sqrt[ \)</li>
|
||||||
<li>MissingOrUnrecognizedDelim: \( \left \)</li>
|
<li>MissingOrUnrecognizedDelim: \( \left \)</li>
|
||||||
|
@ -319,7 +316,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>IllegalControlSequenceName: \( \newcommand{_INVALID_}{} \)</li>
|
<li>IllegalControlSequenceName: \( \newcommand{_INVALID_}{} \)</li>
|
||||||
<li>IllegalParamNumber: \( \newcommand{mycommand}[INVALID]{} \) </li>
|
<li>IllegalParamNumber: \( \newcommand{mycommand}[INVALID]{} \) </li>
|
||||||
<li>DoubleBackSlash: \( \let INVALID \)</li>
|
<li>MissingCS: \( \let INVALID \)</li>
|
||||||
<li>CantUseHash2: \( \def\mycommand#A \)</li>
|
<li>CantUseHash2: \( \def\mycommand#A \)</li>
|
||||||
<li>SequentialParam: \( \def\mycommand#2#1 \)</li>
|
<li>SequentialParam: \( \def\mycommand#2#1 \)</li>
|
||||||
<li>MissingReplacementString: \( \def\mycommand \)</li>
|
<li>MissingReplacementString: \( \def\mycommand \)</li>
|
||||||
|
|
|
@ -141,8 +141,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
GetCSname: function (cmd) {
|
GetCSname: function (cmd) {
|
||||||
var c = this.GetNext();
|
var c = this.GetNext();
|
||||||
if (c !== "\\") {
|
if (c !== "\\") {
|
||||||
TEX.Error(["DoubleBackSlash",
|
TEX.Error(["MissingCS",
|
||||||
"\\ must be followed by a control sequence"])
|
"%1 must be followed by a control sequence", cmd])
|
||||||
}
|
}
|
||||||
var cs = this.trimSpaces(this.GetArgument(cmd));
|
var cs = this.trimSpaces(this.GetArgument(cmd));
|
||||||
return cs.substr(1);
|
return cs.substr(1);
|
||||||
|
|
|
@ -158,7 +158,7 @@
|
||||||
type: "subsup",
|
type: "subsup",
|
||||||
stopError: /*_()*/ ["MissingScript","Missing superscript or subscript argument"],
|
stopError: /*_()*/ ["MissingScript","Missing superscript or subscript argument"],
|
||||||
supError: /*_()*/ ["MissingOpenForSup","Missing open brace for superscript"],
|
supError: /*_()*/ ["MissingOpenForSup","Missing open brace for superscript"],
|
||||||
subError: /*_()*/ ["MissingOpenForSup","Missing open brace for subscript"],
|
subError: /*_()*/ ["MissingOpenForSub","Missing open brace for subscript"],
|
||||||
checkItem: function (item) {
|
checkItem: function (item) {
|
||||||
if (item.type === "open" || item.type === "left") {return true}
|
if (item.type === "open" || item.type === "left") {return true}
|
||||||
if (item.type === "mml") {
|
if (item.type === "mml") {
|
||||||
|
@ -240,7 +240,7 @@
|
||||||
STACKITEM.position = STACKITEM.Subclass({
|
STACKITEM.position = STACKITEM.Subclass({
|
||||||
type: "position",
|
type: "position",
|
||||||
checkItem: function (item) {
|
checkItem: function (item) {
|
||||||
if (item.isClose) {TEX.Error(["MissingBoxFor","Missing box for %1",name])}
|
if (item.isClose) {TEX.Error(["MissingBoxFor","Missing box for %1",this.name])}
|
||||||
if (item.isNotStack) {
|
if (item.isNotStack) {
|
||||||
var mml = item.mmlData();
|
var mml = item.mmlData();
|
||||||
switch (this.move) {
|
switch (this.move) {
|
||||||
|
@ -1848,7 +1848,6 @@
|
||||||
case '\\': this.i++; break;
|
case '\\': this.i++; break;
|
||||||
case '{': parens++; break;
|
case '{': parens++; break;
|
||||||
case '}':
|
case '}':
|
||||||
if (parens == 0) {TEX.Error(["ExtraClose","Extra close brace"])}
|
|
||||||
if (--parens == 0) {return this.string.slice(j,this.i-1)}
|
if (--parens == 0) {return this.string.slice(j,this.i-1)}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user