Finishing to find all the strings to localize
This commit is contained in:
parent
dd019796b0
commit
503f997064
|
@ -1279,8 +1279,9 @@ MathJax.Hub = {
|
||||||
},
|
},
|
||||||
|
|
||||||
errorSettings: {
|
errorSettings: {
|
||||||
// Localization: should be updated when the language is changed
|
// Localization: not defined at that point.
|
||||||
message: ["["+MathJax.Localization_("MathProcessingError", "Math Processing Error")+"]"], // HTML snippet structure for message to use
|
// should be updated when the language is changed
|
||||||
|
message: ["[Math Processing Error]"], // HTML snippet structure for message to use
|
||||||
style: {color: "#CC0000", "font-style":"italic"} // style for message
|
style: {color: "#CC0000", "font-style":"italic"} // style for message
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2522,6 +2523,8 @@ MathJax.Localization = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Message: {
|
Message: {
|
||||||
|
isLoaded: true,
|
||||||
|
strings: {
|
||||||
LoadFailed: "Échec du téléchargement de %1",
|
LoadFailed: "Échec du téléchargement de %1",
|
||||||
CantLoadWebFont: "Impossible de télécharcharger la police Web %1",
|
CantLoadWebFont: "Impossible de télécharcharger la police Web %1",
|
||||||
FirefoxCantLoadWebFont:
|
FirefoxCantLoadWebFont:
|
||||||
|
@ -2534,6 +2537,7 @@ MathJax.Localization = {
|
||||||
"utilisées à la place",
|
"utilisées à la place",
|
||||||
MathJaxNotSupported:
|
MathJaxNotSupported:
|
||||||
"Votre navigateur ne supporte pas MathJax"
|
"Votre navigateur ne supporte pas MathJax"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
FontWarnings: {
|
FontWarnings: {
|
||||||
isLoaded: true,
|
isLoaded: true,
|
||||||
|
@ -2693,6 +2697,10 @@ MathJax.Localization = {
|
||||||
"Accolade fermante manquante",
|
"Accolade fermante manquante",
|
||||||
UndefinedControlSequence:
|
UndefinedControlSequence:
|
||||||
"Commande %1 non définie",
|
"Commande %1 non définie",
|
||||||
|
IllegalControlSequenceName:
|
||||||
|
"Nom de contrôle de séquence non autorisé pour la commande %1",
|
||||||
|
IllegalParamNumber:
|
||||||
|
"Nombre de paramètres incorrect pour la commande %1",
|
||||||
DoubleExponent:
|
DoubleExponent:
|
||||||
"Double exposant: utilisez des accolades pour clarifier",
|
"Double exposant: utilisez des accolades pour clarifier",
|
||||||
DoubleSubscripts:
|
DoubleSubscripts:
|
||||||
|
@ -2700,12 +2708,15 @@ MathJax.Localization = {
|
||||||
DoubleExponentPrime:
|
DoubleExponentPrime:
|
||||||
"Un prime entraine un double exposant: utilisez"+
|
"Un prime entraine un double exposant: utilisez"+
|
||||||
"des accolades pour clarifier",
|
"des accolades pour clarifier",
|
||||||
CanUseHash:
|
CantUseHash1:
|
||||||
"Vous ne pouvez pas utilisez le caractère #, indiquant un "+
|
"Vous ne pouvez pas utilisez le caractère #, indiquant un "+
|
||||||
"paramètre de macro, dans le mode mathématique",
|
"paramètre de macro, dans le mode mathématique",
|
||||||
|
CantUseHash2:
|
||||||
|
"Usage du caractère # non autorisé dans le modèle pour la séquence"+
|
||||||
|
"de contrôle %1",
|
||||||
MisplacedMiddle:
|
MisplacedMiddle:
|
||||||
"La commande %1 doit être placée à l'intérieur d'une section"+
|
"La commande %1 doit être placée à l'intérieur d'une section"+
|
||||||
"\\left ... \right"
|
"\\left ... \right",
|
||||||
MisplacedLimits:
|
MisplacedLimits:
|
||||||
"La commande %1 n'est autorisée que sur les opérateurs",
|
"La commande %1 n'est autorisée que sur les opérateurs",
|
||||||
MisplacedMoveRoot:
|
MisplacedMoveRoot:
|
||||||
|
@ -2724,9 +2735,11 @@ MathJax.Localization = {
|
||||||
UnknownAttrForElement:
|
UnknownAttrForElement:
|
||||||
"Attribut %1 inconnu pour l'élément %2",
|
"Attribut %1 inconnu pour l'élément %2",
|
||||||
MaxMacroSub1:
|
MaxMacroSub1:
|
||||||
"Le nombre maximal de substitution de macro autorisé par MathJax a été dépassé. Il y a t'il un appel de macro récursif?",
|
"Le nombre maximal de substitution de macro autorisé par MathJax "+
|
||||||
|
"a été dépassé. Il y a t'il un appel de macro récursif?",
|
||||||
MaxMacroSub2:
|
MaxMacroSub2:
|
||||||
"Le nombre maximal de substitution de macro autorisé par MathJax a été dépassé. Il y a t'il un environnement LaTeX récursif?",
|
"Le nombre maximal de substitution de macro autorisé par MathJax "+
|
||||||
|
"a été dépassé. Il y a t'il un environnement LaTeX récursif?",
|
||||||
MissingArgFor:
|
MissingArgFor:
|
||||||
"Argument manquant pour la commande %1",
|
"Argument manquant pour la commande %1",
|
||||||
ExtraAlignTab:
|
ExtraAlignTab:
|
||||||
|
@ -2760,7 +2773,8 @@ MathJax.Localization = {
|
||||||
IllegalMacroParam:
|
IllegalMacroParam:
|
||||||
"Paramètre de référence de macro non autorisé",
|
"Paramètre de référence de macro non autorisé",
|
||||||
MaxBufferSize:
|
MaxBufferSize:
|
||||||
"Taille maximale du tampon interne de MathJax dépassée. Il y a t'il un appel de macro récursif?",
|
"Taille maximale du tampon interne de MathJax dépassée. " +
|
||||||
|
"Il y a t'il un appel de macro récursif?",
|
||||||
CommandNotAllowedInEnv:
|
CommandNotAllowedInEnv:
|
||||||
"La commande %1 n'est pas autorisé à l'intérieur de"+
|
"La commande %1 n'est pas autorisé à l'intérieur de"+
|
||||||
"l'environnement %2",
|
"l'environnement %2",
|
||||||
|
@ -2772,16 +2786,53 @@ MathJax.Localization = {
|
||||||
BadMathStyleFor:
|
BadMathStyleFor:
|
||||||
"Style mathématique non valide pour la commande %1",
|
"Style mathématique non valide pour la commande %1",
|
||||||
ErroneousNestingEq:
|
ErroneousNestingEq:
|
||||||
"Emboitement incorrect des structures d'équation"
|
"Emboitement incorrect des structures d'équation",
|
||||||
MultipleRowsOneCol:
|
MultipleRowsOneCol:
|
||||||
"Les lignes multiples doivent avoir exactement une colonne"
|
"Les lignes multiples doivent avoir exactement une colonne",
|
||||||
NoClosingDelim:
|
NoClosingDelim:
|
||||||
"Impossible de trouver le délimiteur fermant pour la commande %1",
|
"Impossible de trouver le délimiteur fermant pour la commande %1",
|
||||||
|
NoClosingChar:
|
||||||
|
"Impossible de trouver le délimiteur '%1' fermant",
|
||||||
MultipleBBoxProperty:
|
MultipleBBoxProperty:
|
||||||
"La propriété %1 de la commande %2 spécifiée deux fois",
|
"La propriété %1 de la commande %2 spécifiée deux fois",
|
||||||
InvalidBboxProperty:
|
InvalidBboxProperty:
|
||||||
"La valeur '%1' ne semble pas être une couleur, une dimension ou"+
|
"La valeur '%1' ne semble pas être une couleur, une dimension ou"+
|
||||||
"de marge intérieur ou un style."
|
"de marge intérieur ou un style.",
|
||||||
|
ExtraEndMissingBegin:
|
||||||
|
"Commande %1 non attendue ou commande \\begingroup manquante",
|
||||||
|
GlobalNotFollowedBy:
|
||||||
|
"Command %1 non suivie d'une commande \\let, \\def ou \newcommand",
|
||||||
|
NewextarrowArg1:
|
||||||
|
"Le premier argument de la commande %1 doit être le nom d'une"+
|
||||||
|
"séquence de contrôle",
|
||||||
|
NewextarrowArg2:
|
||||||
|
"Le second argument de la commande %1 doit être deux entiers"+
|
||||||
|
"séparés par une virgule",
|
||||||
|
NewextarrowArg3:
|
||||||
|
"Le troisième argument de la commande %1 doit être la valeur d'un"+
|
||||||
|
"caractère unicode",
|
||||||
|
UndefinedColorModel:
|
||||||
|
"Le modèle de couleur '%1' n'est pas défini",
|
||||||
|
rgbArg1:
|
||||||
|
"Les couleurs rgb nécéssitent 3 nombres décimaux",
|
||||||
|
InvalidDecimalNumber: "Nombre décimal non valide",
|
||||||
|
rgbArg2: "Les valeurs rgb doivent être comprises entre 0 et 1",
|
||||||
|
RGBArg1: "Les couleurs RGB nécéssitent 3 nombres",
|
||||||
|
InvalidNumber: "Nombre non valide",
|
||||||
|
RGBArg2: "Les valeurs RGB doivent être comprises entre 0 et 255",
|
||||||
|
GrayScalerArg:
|
||||||
|
"Les valeurs de dégradé de gris doivent être comprises entre 0 et 1",
|
||||||
|
DoubleBackSlash:
|
||||||
|
"\\ doit être suivi d'une séquence de contrôle",
|
||||||
|
SequentialParam:
|
||||||
|
"Les paramètres de la séquence de contrôle %1 doivent être"+
|
||||||
|
"énumérés de façon séquentielle",
|
||||||
|
MissingReplacementString:
|
||||||
|
"Chaine de caractère de remplacement manquante pour la définition %1",
|
||||||
|
MismatchUseDef:
|
||||||
|
"L'utilisation de la commande %1 ne correspond pas à sa définition",
|
||||||
|
RunawayArgument:
|
||||||
|
"Argument manquant pour la commande %1 ?"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -2789,7 +2840,7 @@ MathJax.Localization = {
|
||||||
isLoaded: true,
|
isLoaded: true,
|
||||||
strings: {
|
strings: {
|
||||||
BadMglyph: "Élement mglyph incorrect: %1",
|
BadMglyph: "Élement mglyph incorrect: %1",
|
||||||
BadMglyphFont: "Police de caractère incorrecte: %1"
|
BadMglyphFont: "Police de caractère incorrecte: %1",
|
||||||
MathPlayer:
|
MathPlayer:
|
||||||
"MathJax n'est pas parvenu à configurer MathPlayer.\n\n"+
|
"MathJax n'est pas parvenu à configurer MathPlayer.\n\n"+
|
||||||
"Vous devez d'abord installer MathPlayer. Si c'est déjà le cas,\n"+
|
"Vous devez d'abord installer MathPlayer. Si c'est déjà le cas,\n"+
|
||||||
|
|
|
@ -236,8 +236,10 @@ MathJax.Hub.Config({
|
||||||
// jax that prevents it from operating properly).
|
// jax that prevents it from operating properly).
|
||||||
//
|
//
|
||||||
errorSettings: {
|
errorSettings: {
|
||||||
// Localization: should be updated when the language is changed
|
// Localization:
|
||||||
message: ["["+MathJax.Localization._("MathProcessingError", "Math Processing Error"])+"]"], // HTML snippet structure for message to use
|
// TODO
|
||||||
|
// should be updated when the language is changed
|
||||||
|
message: ["[MathProcessingError]"], // HTML snippet structure for message to use
|
||||||
style: {color: "#CC0000", "font-style":"italic"} // style for message
|
style: {color: "#CC0000", "font-style":"italic"} // style for message
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,12 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
if (TEX.eqnStack.top > 1) {
|
if (TEX.eqnStack.top > 1) {
|
||||||
TEX.eqnStack.Pop();
|
TEX.eqnStack.Pop();
|
||||||
} else if (TEX.rootStack.top === 1) {
|
} else if (TEX.rootStack.top === 1) {
|
||||||
TEX.Error("Extra "+name+" or missing \\begingroup");
|
TEX.Error(
|
||||||
|
MathJax.Localization._(
|
||||||
|
["TeX", "ExtraEndMissingBegin"],
|
||||||
|
"Extra %1 or missing \\begingroup", name
|
||||||
|
)
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
TEX.eqnStack.Clear();
|
TEX.eqnStack.Clear();
|
||||||
TEX.rootStack.Pop();
|
TEX.rootStack.Pop();
|
||||||
|
@ -290,8 +295,13 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
//
|
//
|
||||||
Global: function (name) {
|
Global: function (name) {
|
||||||
var i = this.i; var cs = this.GetCSname(name); this.i = i;
|
var i = this.i; var cs = this.GetCSname(name); this.i = i;
|
||||||
if (cs !== "let" && cs !== "def" && cs !== "newcommand")
|
if (cs !== "let" && cs !== "def" && cs !== "newcommand") {
|
||||||
{TEX.Error(name+" not followed by \\let, \\def, or \\newcommand")}
|
TEX.Error(
|
||||||
|
MathJax.Localization._(
|
||||||
|
["TeX", "GlobalNotFollowedBy"],
|
||||||
|
"%1 not followed by \\let, \\def, or \\newcommand", name)
|
||||||
|
)
|
||||||
|
}
|
||||||
this.stack.env.isGlobal = true;
|
this.stack.env.isGlobal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,12 @@ MathJax.Extension["TeX/color"] = {
|
||||||
getColor: function (model,def) {
|
getColor: function (model,def) {
|
||||||
if (!model) {model = "named"}
|
if (!model) {model = "named"}
|
||||||
var fn = this["get_"+model];
|
var fn = this["get_"+model];
|
||||||
if (!fn) {this.TEX.Error("Color model '"+model+"' not defined")}
|
if (!fn) {
|
||||||
|
this.TEX.Error(
|
||||||
|
MathJax.Localization._(["TeX", "UndefinedColorModel"],
|
||||||
|
"Color model '%1' not defined", model)
|
||||||
|
)
|
||||||
|
}
|
||||||
return fn.call(this,def);
|
return fn.call(this,def);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -123,11 +128,24 @@ MathJax.Extension["TeX/color"] = {
|
||||||
*/
|
*/
|
||||||
get_rgb: function (rgb) {
|
get_rgb: function (rgb) {
|
||||||
rgb = rgb.split(/,/); var RGB = "#";
|
rgb = rgb.split(/,/); var RGB = "#";
|
||||||
if (rgb.length !== 3) {this.TEX.Error("rgb colors require 3 decimal numbers")}
|
if (rgb.length !== 3) {
|
||||||
|
this.TEX.Error(MathJax.Localization._(["TeX", "rgbArg1"],
|
||||||
|
"rgb colors require 3 decimal numbers"))
|
||||||
|
}
|
||||||
for (var i = 0; i < 3; i++) {
|
for (var i = 0; i < 3; i++) {
|
||||||
if (!rgb[i].match(/^(\d+(\.\d*)?|\.\d+)$/)) {this.TEX.Error("Invalid decimal number")}
|
if (!rgb[i].match(/^(\d+(\.\d*)?|\.\d+)$/)) {
|
||||||
|
this.TEX.Error(
|
||||||
|
MathJax.Localization._(["TeX", "InvalidDecimalNumber"],
|
||||||
|
"Invalid decimal number")
|
||||||
|
)
|
||||||
|
}
|
||||||
var n = parseFloat(rgb[i]);
|
var n = parseFloat(rgb[i]);
|
||||||
if (n < 0 || n > 1) {this.TEX.Error("rgb values must be between 0 and 1")}
|
if (n < 0 || n > 1) {
|
||||||
|
this.TEX.Error(
|
||||||
|
MathJax.Localization._(["TeX", "rgbArg2"],
|
||||||
|
"rgb values must be between 0 and 1")
|
||||||
|
)
|
||||||
|
}
|
||||||
n = Math.floor(n*255).toString(16); if (n.length < 2) {n = "0"+n}
|
n = Math.floor(n*255).toString(16); if (n.length < 2) {n = "0"+n}
|
||||||
RGB += n;
|
RGB += n;
|
||||||
}
|
}
|
||||||
|
@ -139,11 +157,22 @@ MathJax.Extension["TeX/color"] = {
|
||||||
*/
|
*/
|
||||||
get_RGB: function (rgb) {
|
get_RGB: function (rgb) {
|
||||||
rgb = rgb.split(/,/); var RGB = "#";
|
rgb = rgb.split(/,/); var RGB = "#";
|
||||||
if (rgb.length !== 3) {this.TEX.Error("RGB colors require 3 numbers")}
|
if (rgb.length !== 3) {
|
||||||
|
this.TEX.Error(MathJax.Localization._(["TeX", "RGBArg1"],
|
||||||
|
"RGB colors require 3 numbers"))
|
||||||
|
}
|
||||||
for (var i = 0; i < 3; i++) {
|
for (var i = 0; i < 3; i++) {
|
||||||
if (!rgb[i].match(/^\d+$/)) {this.TEX.Error("Invalid number")}
|
if (!rgb[i].match(/^\d+$/)) {
|
||||||
|
this.TEX.Error(MathJax.Localization._(["TeX", "InvalidNumber"],
|
||||||
|
"Invalid number"))
|
||||||
|
}
|
||||||
var n = parseInt(rgb[i]);
|
var n = parseInt(rgb[i]);
|
||||||
if (n > 255) {this.TEX.Error("RGB values must be between 0 and 255")}
|
if (n > 255) {
|
||||||
|
this.TEX.Error(
|
||||||
|
MathJax.Localization._(["TeX", "RGBArg2"],
|
||||||
|
"RGB values must be between 0 and 255")
|
||||||
|
)
|
||||||
|
}
|
||||||
n = n.toString(16); if (n.length < 2) {n = "0"+n}
|
n = n.toString(16); if (n.length < 2) {n = "0"+n}
|
||||||
RGB += n;
|
RGB += n;
|
||||||
}
|
}
|
||||||
|
@ -154,9 +183,18 @@ MathJax.Extension["TeX/color"] = {
|
||||||
* Get a gray-scale value
|
* Get a gray-scale value
|
||||||
*/
|
*/
|
||||||
get_gray: function (gray) {
|
get_gray: function (gray) {
|
||||||
if (!gray.match(/^(\d+(\.\d*)?|\.\d+)$/)) {this.TEX.Error("Invalid decimal number")}
|
if (!gray.match(/^(\d+(\.\d*)?|\.\d+)$/)) {
|
||||||
|
this.TEX.Error(
|
||||||
|
MathJax.Localization._(["TeX", "InvalidDecimalNumber"],
|
||||||
|
"Invalid decimal number")
|
||||||
|
)
|
||||||
|
}
|
||||||
var n = parseFloat(gray);
|
var n = parseFloat(gray);
|
||||||
if (n < 0 || n > 1) {this.TEX.Error("Grey-scale values must be between 0 and 1")}
|
if (n < 0 || n > 1) {
|
||||||
|
this.TEX.Error(
|
||||||
|
MathJax.Localization._(["TeX", "GrayScalerArg"],
|
||||||
|
"Grey-scale values must be between 0 and 1"))
|
||||||
|
}
|
||||||
n = Math.floor(n*255).toString(16); if (n.length < 2) {n = "0"+n}
|
n = Math.floor(n*255).toString(16); if (n.length < 2) {n = "0"+n}
|
||||||
return "#"+n+n+n;
|
return "#"+n+n+n;
|
||||||
},
|
},
|
||||||
|
|
|
@ -72,12 +72,25 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
var cs = this.GetArgument(name),
|
var cs = this.GetArgument(name),
|
||||||
space = this.GetArgument(name),
|
space = this.GetArgument(name),
|
||||||
chr = this.GetArgument(name);
|
chr = this.GetArgument(name);
|
||||||
if (!cs.match(/^\\([a-z]+|.)$/i))
|
if (!cs.match(/^\\([a-z]+|.)$/i)) {
|
||||||
{TEX.Error("First argument to "+name+" must be a control sequence name")}
|
TEX.Error(
|
||||||
if (!space.match(/^(\d+),(\d+)$/))
|
MathJax.Localization._(["TeX", "NewextarrowArg1"]
|
||||||
{TEX.Error("Second argument to "+name+" must be two integers separated by a comma")}
|
"First argument to %1 must be a control sequence name", name)
|
||||||
if (!chr.match(/^(\d+|0x[0-9A-F]+)$/i))
|
)
|
||||||
{TEX.Error("Third argument to "+name+" must be a unicode character number")}
|
}
|
||||||
|
if (!space.match(/^(\d+),(\d+)$/)) {
|
||||||
|
TEX.Error(
|
||||||
|
MathJax.Localization._(["TeX", "NewextarrowArg2"]
|
||||||
|
"Second argument to %1 must be two integers separated by a comma",
|
||||||
|
name)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (!chr.match(/^(\d+|0x[0-9A-F]+)$/i)) {
|
||||||
|
TEX.Error(
|
||||||
|
MathJax.Localization._(["TeX", "NewextarrowArg3"]
|
||||||
|
"Third argument to %1 must be a unicode character number", name)
|
||||||
|
)
|
||||||
|
}
|
||||||
cs = cs.substr(1); space = space.split(","); chr = parseInt(chr);
|
cs = cs.substr(1); space = space.split(","); chr = parseInt(chr);
|
||||||
TEXDEF.macros[cs] = ['xArrow',chr,parseInt(space[0]),parseInt(space[1])];
|
TEXDEF.macros[cs] = ['xArrow',chr,parseInt(space[0]),parseInt(space[1])];
|
||||||
}
|
}
|
||||||
|
|
|
@ -352,11 +352,22 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
if (C === "{") {braces++} else
|
if (C === "{") {braces++} else
|
||||||
if (C === "}") {
|
if (C === "}") {
|
||||||
if (braces) {braces--}
|
if (braces) {braces--}
|
||||||
else {TEX.Error("Extra close brace or missing open brace")}
|
else {
|
||||||
|
TEX.Error(
|
||||||
|
MathJax.Localization._(
|
||||||
|
["TeX", "ExtraCloseMissingOpen"],
|
||||||
|
"Extra close brace or missing open brace"
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (braces) {TEX.Error("Missing close brace")};
|
}
|
||||||
TEX.Error("Can't find closing "+c);
|
if (braces) {
|
||||||
|
TEX.Error(MathJax.Localization._(["TeX", "MissingCloseBrace"],
|
||||||
|
"Missing close brace"))
|
||||||
|
};
|
||||||
|
TEX.Error(MathJax.Localization._(["TeX", "NoClosingChar"],
|
||||||
|
"Can't find closing %1", c)
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -30,6 +30,11 @@ MathJax.Extension["TeX/newcommand"] = {
|
||||||
|
|
||||||
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
|
|
||||||
|
var _ = function (id) {
|
||||||
|
return MathJax.Localization._.apply(MathJax.Localization,
|
||||||
|
[ ["TeX", id] ].concat([].slice.call(arguments,1)))
|
||||||
|
};
|
||||||
|
|
||||||
var TEX = MathJax.InputJax.TeX;
|
var TEX = MathJax.InputJax.TeX;
|
||||||
var TEXDEF = TEX.Definitions;
|
var TEXDEF = TEX.Definitions;
|
||||||
|
|
||||||
|
@ -55,10 +60,16 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
opt = this.GetBrackets(name),
|
opt = this.GetBrackets(name),
|
||||||
def = this.GetArgument(name);
|
def = this.GetArgument(name);
|
||||||
if (cs.charAt(0) === "\\") {cs = cs.substr(1)}
|
if (cs.charAt(0) === "\\") {cs = cs.substr(1)}
|
||||||
if (!cs.match(/^(.|[a-z]+)$/i)) {TEX.Error("Illegal control sequence name for "+name)}
|
if (!cs.match(/^(.|[a-z]+)$/i)) {
|
||||||
|
TEX.Error(_("IllegalControlSequenceName",
|
||||||
|
"Illegal control sequence name for %1", name))
|
||||||
|
}
|
||||||
if (n) {
|
if (n) {
|
||||||
n = this.trimSpaces(n);
|
n = this.trimSpaces(n);
|
||||||
if (!n.match(/^[0-9]+$/)) {TEX.Error("Illegal number of parameters specified in "+name)}
|
if (!n.match(/^[0-9]+$/)) {
|
||||||
|
TEX.Error(_("IllegalParamNumber"
|
||||||
|
"Illegal number of parameters specified in %1", name))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.setDef(cs,['Macro',def,n,opt]);
|
this.setDef(cs,['Macro',def,n,opt]);
|
||||||
},
|
},
|
||||||
|
@ -73,7 +84,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
edef = this.GetArgument(name);
|
edef = this.GetArgument(name);
|
||||||
if (n) {
|
if (n) {
|
||||||
n = this.trimSpaces(n);
|
n = this.trimSpaces(n);
|
||||||
if (!n.match(/^[0-9]+$/)) {TEX.Error("Illegal number of parameters specified in "+name)}
|
if (!n.match(/^[0-9]+$/)) {
|
||||||
|
TEX.Error(_("IllegalParamNumber"
|
||||||
|
"Illegal number of parameters specified in %1", name))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.setEnv(env,['BeginEnv','EndEnv',bdef,edef,n]);
|
this.setEnv(env,['BeginEnv','EndEnv',bdef,edef,n]);
|
||||||
},
|
},
|
||||||
|
@ -130,7 +144,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
*/
|
*/
|
||||||
GetCSname: function (cmd) {
|
GetCSname: function (cmd) {
|
||||||
var c = this.GetNext();
|
var c = this.GetNext();
|
||||||
if (c !== "\\") {TEX.Error("\\ must be followed by a control sequence")}
|
if (c !== "\\") {
|
||||||
|
TEX.Error(_("DoubleBackSlash",
|
||||||
|
"\\ must be followed by a control sequence"))
|
||||||
|
}
|
||||||
var cs = this.trimSpaces(this.GetArgument(cmd));
|
var cs = this.trimSpaces(this.GetArgument(cmd));
|
||||||
return cs.substr(1);
|
return cs.substr(1);
|
||||||
},
|
},
|
||||||
|
@ -146,8 +163,15 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
if (c === '#') {
|
if (c === '#') {
|
||||||
if (i !== this.i) {params[n] = this.string.substr(i,this.i-i)}
|
if (i !== this.i) {params[n] = this.string.substr(i,this.i-i)}
|
||||||
c = this.string.charAt(++this.i);
|
c = this.string.charAt(++this.i);
|
||||||
if (!c.match(/^[1-9]$/)) {TEX.Error("Illegal use of # in template for "+cs)}
|
if (!c.match(/^[1-9]$/)) {
|
||||||
if (parseInt(c) != ++n) {TEX.Error("Parameters for "+cs+" must be numbered sequentially")}
|
TEX.Error(_("CantUseHash2",
|
||||||
|
"Illegal use of # in template for %1", cs))
|
||||||
|
}
|
||||||
|
if (parseInt(c) != ++n) {
|
||||||
|
TEX.Error(_(
|
||||||
|
"SequentialParam",
|
||||||
|
"Parameters for %1 must be numbered sequentially", cs))
|
||||||
|
}
|
||||||
i = this.i+1;
|
i = this.i+1;
|
||||||
} else if (c === '{') {
|
} else if (c === '{') {
|
||||||
if (i !== this.i) {params[n] = this.string.substr(i,this.i-i)}
|
if (i !== this.i) {params[n] = this.string.substr(i,this.i-i)}
|
||||||
|
@ -155,7 +179,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
}
|
}
|
||||||
this.i++;
|
this.i++;
|
||||||
}
|
}
|
||||||
TEX.Error("Missing replacement string for definition of "+cmd);
|
TEX.Error(_("MissingReplacementString",
|
||||||
|
"Missing replacement string for definition of %1", cmd));
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -164,15 +189,23 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
MacroWithTemplate: function (name,text,n,params) {
|
MacroWithTemplate: function (name,text,n,params) {
|
||||||
if (n) {
|
if (n) {
|
||||||
var args = []; this.GetNext();
|
var args = []; this.GetNext();
|
||||||
if (params[0] && !this.MatchParam(params[0]))
|
if (params[0] && !this.MatchParam(params[0])) {
|
||||||
{TEX.Error("Use of "+name+" doesn't match its definition")}
|
TEX.Error(
|
||||||
|
_("MismatchUseDef",
|
||||||
|
"Use of %1 doesn't match its definition", name))
|
||||||
|
)
|
||||||
|
}
|
||||||
for (var i = 0; i < n; i++) {args.push(this.GetParameter(name,params[i+1]))}
|
for (var i = 0; i < n; i++) {args.push(this.GetParameter(name,params[i+1]))}
|
||||||
text = this.SubstituteArgs(args,text);
|
text = this.SubstituteArgs(args,text);
|
||||||
}
|
}
|
||||||
this.string = this.AddArgs(text,this.string.slice(this.i));
|
this.string = this.AddArgs(text,this.string.slice(this.i));
|
||||||
this.i = 0;
|
this.i = 0;
|
||||||
if (++this.macroCount > TEX.config.MAXMACROS)
|
if (++this.macroCount > TEX.config.MAXMACROS) {
|
||||||
{TEX.Error("MathJax maximum macro substitution count exceeded; is there a recursive macro call?")}
|
TEX.Error(
|
||||||
|
_("MaxMacroSub1",
|
||||||
|
"MathJax maximum macro substitution count exceeded; is there a recursive macro call?")
|
||||||
|
)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -211,7 +244,9 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
this.i++; j++; hasBraces = 0;
|
this.i++; j++; hasBraces = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TEX.Error("Runaway argument for "+name+"?");
|
TEX.Error(
|
||||||
|
_("RunawayArgument", "Runaway argument for %1?", name)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1267,7 +1267,7 @@
|
||||||
* Handle hash marks outside of definitions
|
* Handle hash marks outside of definitions
|
||||||
*/
|
*/
|
||||||
Hash: function (c) {
|
Hash: function (c) {
|
||||||
TEX.Error(_("CanUseHash",
|
TEX.Error(_("CantUseHash1",
|
||||||
"You can't use 'macro parameter character #' in math mode"));
|
"You can't use 'macro parameter character #' in math mode"));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1323,7 +1323,7 @@
|
||||||
var delim = this.GetDelimiter(name);
|
var delim = this.GetDelimiter(name);
|
||||||
if (this.stack.Top().type !== "left") {
|
if (this.stack.Top().type !== "left") {
|
||||||
TEX.Error(_("MisplacedMiddle",
|
TEX.Error(_("MisplacedMiddle",
|
||||||
"%1 must be within \\left and \\right", name)}
|
"%1 must be within \\left and \\right", name))}
|
||||||
this.Push(MML.mo(delim).With({stretchy:true}));
|
this.Push(MML.mo(delim).With({stretchy:true}));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user