From 4ced117e0569fa42c57c7f444f9f103c74c65fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Tue, 19 Feb 2013 19:40:52 +0100 Subject: [PATCH 01/41] Initial implementation of MathJax.Localization. Some experiments with French localization. --- unpacked/MathJax.js | 312 ++++++++++++++++++++++++++++++++ unpacked/extensions/MathMenu.js | 76 +++++--- 2 files changed, 362 insertions(+), 26 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 75273002e..dda59b7c5 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax.js @@ -2476,3 +2478,313 @@ MathJax.Hub.Startup = { }} /**********************************************************/ + +MathJax.Localization = { + + locale: "fr", + directory: "[MathJax]/localization", + strings: { + fr: { + isLoaded: true, + domains: { + "_": { + strings: { + } + }, + // FontWarnings: { + // isLoaded: true, + // strings: { + // fonts: + // [ + // ["p"], + // "MathJax peut utiliser soit les ", + // ["a",{href:"http://www.stixfonts.org/",target:"_blank"},"polices STIX"], + // " soit les ", + // ["a",{href:"http://www.mathjax.org/help-v2/fonts/",target:"_blank"},["polices TeX de MathJax"]], + // ". Téléchargez et installez une de ces familles pour rendre plus confortable votre utilisation de MathJax." + // ] + // } + // }, + + Menu: { + isLoaded: true, + strings: { + WebkitNativeMMLWarning: + + "Votre navigateur ne semble pas comporter de support MathML, " + + "changer le mode de rendu pourrait rendre illisibles " + + "les expressions mathématiques.", + + MSIENativeMMLWarning: + + "Internet Explorer a besoin de module complémentaire MathPlayer " + + "pour afficher le MathML.", + + OperaNativeMMLWarning: + + "Le support MathML d'Opera est limité, changer le mode de rendu " + + "pourrait entrainer un affichage médiocre de certaines expressions.", + + SafariNativeMMLWarning: + + "Le support MathML natif de votre navigateur ne comporte pas " + + "toutes les fonctionnalités requises par MathJax, certaines " + + "expressions pourront donc ne pas s'afficher correctement.", + + FirefoxNativeMMLWarning: + + "Le support MathML natif de votre navigateur ne comporte pas " + + "toutes les fonctionnalités requises par MathJax, certaines " + + "expressions pourront donc ne pas s'afficher correctement.", + + SwitchAnyway: + "Êtes vous certain de vouloir changer le mode de rendu ?\n\n" + + "Appuyez sur OK pour valider ou Annuler pour continuer avec le " + + "mode de rendu actuellement sélectionné.", + + ScaleMath: + "Mise à l'échelle des expressions mathématiques (par rapport au " + + "text environnant) de %1%%", + + NonZeroScale: + "L'échelle ne peut être nulle", + + PercentScale: + "L'échelle doit être un pourcentage (e.g. 120%%)", + + IE8warning: + "Ceci désactivera le menu de MathJax et les fonctionalités de " + + "zoom mais vous pourrez toujours obtenir le menu de MathJax " + + "en utilisant la commande Alt+Clic sur une expression.\n\n" + + "Êtes vous certain de vouloir choisir les options de MathPlayer?", + + IE9warning: + "Le menu contextuel de MathJax sera désactivé, " + + "mais vous pourrez toujours obtenir le menu de MathJax " + + "en utilisant la commande Alt-Clic sur une expression.", + + NoOriginalForm: + "Aucune forme originelle", + + Close: + "Fermer", + + EqSource: + "Source de l'équation MathJax" + } + } + } + } + }, + + _: function (messageId, englishPhrase) { + + // These variables are used in string parsing + var plural = this.plural; + var args = arguments; + var i, s, result; + + function parseNextUnicodePoint(appendToResult) + { + var n = s.charCodeAt(i); + if (n <= 0xD7FF || 0xE000 <= n) { + // Code points U+0000 to U+D7FF and U+E000 to U+FFFF. + // Append the character. + if (appendToResult) result += s[i] + i++; + return; + } else if (i+1 < m) { + // Code points U+10000 to U+10FFFF + // Append the surrogate pairs. + if (appendToResult) { result += s[i]; result += s[i+1]; } + i+=2 + return; + } + // Ignore lead surrogate at the end of the string. + // This should not happen with valid unicode string. + i++; + } + + function parseArgument(appendToResult) + { + if (!(/\d/.test(s[0]))) return false; + + // %INTEGER argument substitution + var argIndex = s.match(/^\d+/)[0]; + i += argIndex.length; + var key = +argIndex+1; + if (key in args) { + if (appendToResult) { result += args[key]; } + return true; + } + + // invalid index: just %INTEGER and continue + if (appendToResult) { result += "%" + argIndex; } + i++; + return true; + } + + function parseInteger(appendToResult) + { + var number = s.match(/^\{(\d+)\}/); + if (!number) return false; + + // %{INTEGER} escaped integer + if (appendToResult) { result += number[1]; } + i += number[0].length; + return true; + } + + function parseChoiceBlock(blockName, choiceFunction) + { + var pattern = "^\\{"+blockName+":%(\\d)+\\|"; + var blockStart = s.match(pattern); + if (!blockStart) return false; + + var key = +blockStart[1]+1; + if (!(key in args)) return false; + + // %\{blockName:%INTEGER|form1|form2 ... \} + i = blockStart[0].length; + + var choiceIndex = choiceFunction(args[key]), j = 1; + var isChosenBlock = (j === choiceIndex); + var blockFound = false; + + while (i < m) { + if (s[i] == "|") { + // new choice block + i++; j++; + isChosenBlock = (j === choiceIndex); + if (isChosenBlock) blockFound = true; + continue; + } + if (s[i] == "}") { + // closing brace + i++; + break; + } + if (s[i] != "%" || i+1 == m) { + // normal char or % at the end of the string + parseNextUnicodePoint(isChosenBlock); + continue; + } + + // keep only the substring after the % + i++; s = s.substr(i); m -= i; i = 0; + + // %INTEGER argument substitution + if (parseArgument(isChosenBlock)) continue; + + // %{INTEGER} escaped integer + if (parseInteger(isChosenBlock)) continue; + + // %CHAR: escaped character + parseNextUnicodePoint(isChosenBlock); + continue; + } + + if (!blockFound) { + i = 0; + return false; + } + + return true; + } + + function transformString(string) + { + s = string; + i = 0; + m = s.length; + result = ""; + + while (i < m) { + if (s[i] != "%" || i+1 == m) { + // normal char or % at the end of the string + parseNextUnicodePoint(true); + continue; + } + + // keep only the substring after the % + i++; s = s.substr(i); m -= i; i = 0; + + // %INTEGER argument substitution + if (parseArgument(true)) continue; + + // %{INTEGER} escaped integer + if (parseInteger(true)) continue; + + // %\{plural:%INTEGER|form1|form2 ... \} plural forms + if (parseChoiceBlock("plural", plural)) continue; + + // %CHAR: escaped character + parseNextUnicodePoint(true); + continue; + } + + return result; + } + + function transformHTMLSnippet(snippet) + { + for (key in snippet) { + var e = snippet[key]; + if (typeof e === "string") { + snippet[key] = transformString(e); + continue; + } + var lastIndex = e.length-1; + if (Array.isArray(e[lastIndex])) { + e[lastIndex] = transformHTMLSnippet(e[lastIndex]); + } + } + return snippet; + } + + // try to get the translated phrase or use the englishPhrase fallback + var phrase = englishPhrase; + var translationData = this.strings[this.locale]; + if (translationData) { + if (translationData.isLoaded) { + var domain = "_"; + if (Array.isArray(messageId) && messageId.length == 2) { + domain = messageId[0]; + messageId = messageId[1]; + } + if (domain in translationData.domains) { + domain = translationData.domains[domain] + if (domain.isLoaded && messageId in domain.strings) { + phrase = domain.strings[messageId]; + } + } + } + } + + if (typeof phrase === "string") { + // handle the phrase as a simple string + return transformString(phrase); + } + + // handle the phrase as a HTML snippet + return transformHTMLSnippet(phrase); + }, + + setLocale: function(locale) { + this.locale = locale; + // TODO + }, + + addTranslation: function (locale, domain, definition) { + // TODO + }, + + fontFamily: function () { + return null; + }, + + plural: function(n) { + if (n == 1) return 1; + return 2; + } +}; diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index 8a2075a29..e849171ac 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/MathMenu.js @@ -33,6 +35,13 @@ signal: SIGNAL }; + var _ = function (id) { + return MathJax.Localization._.apply( + MathJax.Localization, + [ ["Menu", id] ].concat([].slice.call(arguments,1)) + ); + }; + var isPC = HUB.Browser.isPC, isMSIE = HUB.Browser.isMSIE, isIE9 = ((document.documentMode||0) > 8); var ROUND = (isPC ? null : "5px"); @@ -690,7 +699,10 @@ return; } } else { - if (MENU.jax.originalText == null) {alert("No original form available"); return} + if (MENU.jax.originalText == null) { + alert(_("NoOriginalForm", "No original form available")); + return; + } MENU.ShowSource.Text(MENU.jax.originalText,event); } }; @@ -706,16 +718,17 @@ var w = MENU.ShowSource.Window(event); delete MENU.ShowSource.w; text = text.replace(/^\s*/,"").replace(/\s*$/,""); text = text.replace(/&/g,"&").replace(//g,">"); + var title = _("EqSource", "MathJax Equation Source"); if (MENU.isMobile) { w.document.open(); - w.document.write("MathJax Equation Source"); + w.document.write(""+title+""); w.document.write("
"+text+"
"); - w.document.write("
"); + w.document.write("
"); w.document.write(""); w.document.close(); } else { w.document.open(); - w.document.write("MathJax Equation Source"); + w.document.write(""+title+""); w.document.write("
"+text+"
"); w.document.write(""); w.document.close(); @@ -740,7 +753,7 @@ MENU.Scale = function () { var HTMLCSS = OUTPUT["HTML-CSS"], nMML = OUTPUT.NativeMML, SVG = OUTPUT.SVG; var SCALE = (HTMLCSS||nMML||SVG||{config:{scale:100}}).config.scale; - var scale = prompt("Scale all mathematics (compared to surrounding text) by",SCALE+"%"); + var scale = prompt(_("ScaleMath", "Scale all mathematics (compared to surrounding text) by %1%%",SCALE)); if (scale) { if (scale.match(/^\s*\d+(\.\d*)?\s*%?\s*$/)) { scale = parseFloat(scale); @@ -752,8 +765,9 @@ MENU.cookie.scale = scale; MENU.saveCookie(); HUB.Reprocess(); } - } else {alert("The scale should not be zero")} - } else {alert("The scale should be a percentage (e.g., 120%)")} + } else {alert(_("NonZeroScale", "The scale should not be zero"))} + } else {alert(_("PercentScale", + "The scale should be a percentage (e.g., 120%%)"))} } }; @@ -791,8 +805,10 @@ break; } if (message) { - message += "\n\nSwitch the renderer anyway?\n\n" + - "(Press OK to switch, CANCEL to continue with the current renderer)"; + message += "\n\n"; + message += _("SwitchAnyway", + "Switch the renderer anyway?\n\n" + + "(Press OK to switch, CANCEL to continue with the current renderer)"); MENU.cookie.renderer = jax[0].id; MENU.saveCookie(); if (!confirm(message)) {return} if (warned) {MENU.cookie[warned] = CONFIG.settings[warned] = true} MENU.cookie.renderer = CONFIG.settings.renderer; MENU.saveCookie(); @@ -805,28 +821,34 @@ }; MENU.Renderer.Messages = { MML: { - WebKit: "Your browser doesn't seem to support MathML natively, " + - "so switching to MathML output may cause the mathematics " + - "on the page to become unreadable.", + WebKit: _("WebkitNativeMMLWarning", + "Your browser doesn't seem to support MathML natively, " + + "so switching to MathML output may cause the mathematics " + + "on the page to become unreadable."), - MSIE: "Internet Explorer requires the MathPlayer plugin " + - "in order to process MathML output.", + MSIE: _("MSIENativeMMLWarning", + "Internet Explorer requires the MathPlayer plugin " + + "in order to process MathML output."), - Opera: "Opera's support for MathML is limited, so switching to " + - "MathML output may cause some expressions to render poorly.", + Opera: _("OperaNativeMMLWarning", + "Opera's support for MathML is limited, so switching to " + + "MathML output may cause some expressions to render poorly."), - Safari: "Your browser's native MathML does not implement all the features " + - "used by MathJax, so some expressions may not render properly.", + Safari: _("SafariNativeMMLWarning", + "Your browser's native MathML does not implement all the features " + + "used by MathJax, so some expressions may not render properly."), - Firefox: "Your browser's native MathML does not implement all the features " + - "used by MathJax, so some expressions may not render properly." + Firefox: _("FirefoxNativeMMLWarning", + "Your browser's native MathML does not implement all the features " + + "used by MathJax, so some expressions may not render properly.") }, SVG: { - MSIE: "SVG is not implemented in Internet Explorer prior to " + - "IE9, or when the browser is emulating IE8 or below. " + - "Switching to SVG output will cause the mathemtics to " + - "not display properly." + MSIE: _("MSIESVGWarning", + "SVG is not implemented in Internet Explorer prior to " + + "IE9, or when the browser is emulating IE8 or below. " + + "Switching to SVG output will cause the mathemtics to " + + "not display properly.") } }; @@ -861,13 +883,15 @@ }; MENU.MPEvents.Messages = { IE8warning: + _("IE8warning", "This will disable the MathJax menu and zoom features, " + "but you can Alt-Click on an expression to obtain the MathJax " + - "menu instead.\n\nReally change the MathPlayer settings?", + "menu instead.\n\nReally change the MathPlayer settings?"), IE9warning: + _("IE9warning", "The MathJax contextual menu will be disabled, but you can " + - "Alt-Click on an expression to obtain the MathJax menu instead." + "Alt-Click on an expression to obtain the MathJax menu instead.") }; /*************************************************************/ From ca2f87ad7c4bd475917681b071f59f7a0eb98029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Wed, 20 Feb 2013 15:42:12 +0100 Subject: [PATCH 02/41] Trying to translate more dialogs ; Implement localization of numbers ; Handle arg substitution for arrays. --- unpacked/MathJax.js | 145 ++++++++++++++++++++++------ unpacked/extensions/FontWarnings.js | 88 ++++++++++------- unpacked/extensions/MathMenu.js | 12 ++- unpacked/extensions/v1.0-warning.js | 28 ++++-- unpacked/extensions/xxxxxxx | 11 +++ 5 files changed, 204 insertions(+), 80 deletions(-) create mode 100644 unpacked/extensions/xxxxxxx diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index dda59b7c5..1d09ce5e9 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -2481,7 +2481,7 @@ MathJax.Hub.Startup = { MathJax.Localization = { - locale: "fr", + locale: "en", directory: "[MathJax]/localization", strings: { fr: { @@ -2491,24 +2491,61 @@ MathJax.Localization = { strings: { } }, - // FontWarnings: { - // isLoaded: true, - // strings: { - // fonts: - // [ - // ["p"], - // "MathJax peut utiliser soit les ", - // ["a",{href:"http://www.stixfonts.org/",target:"_blank"},"polices STIX"], - // " soit les ", - // ["a",{href:"http://www.mathjax.org/help-v2/fonts/",target:"_blank"},["polices TeX de MathJax"]], - // ". Téléchargez et installez une de ces familles pour rendre plus confortable votre utilisation de MathJax." - // ] - // } - // }, + FontWarnings: { + isLoaded: true, + strings: { + webFont: + "MathJax utilise les polices Web pour afficher les expressions " + + "mathématiques sur cette page. Celles-ci mettent du temps à être "+ + "téléchargées et la page serait affichée plus rapidement si vous "+ + "installiez les polices mathématiques directement dans le dossier "+ + "des polices de votre système.", + + imageFonts: + "MathJax utilise des images de caractères plutôt que les polices "+ + "Web ou locales. Ceci rend le rendu plus lent que la normale et "+ + "les expressions mathématiques peuvent ne pas s'imprimer à la "+ + "résolution maximale de votre imprimante", + + noFonts: + "MathJax n'est pas parvenu à localiser une police pour afficher "+ + "les expressions mathématiques et les images de caractères ne "+ + "sont pas disponibles. Comme solution de dernier recours, il "+ + "utilise des caractères Unicode génériques en espérant que votre "+ + "navigateur sera capable de les afficher. Certains pourront ne "+ + "être rendus de façon incorrect voire pas du tout.", + + webFonts: + "La plupart des navigateurs modernes permettent de télécharger "+ + "des polices à partir du Web. En mettant à jour pour une version "+ + "plus récente de votre navigateur (ou en changeant de navigateur) "+ + "la qualité des expressions mathématiques sur cette page pourrait "+ + "être améliorée.", + + fonts: + "%1 MathJax peut utiliser les %2 ou bien les %3. Téléchargez et"+ + "installez l'une de ces familles de polices pour améliorer votre"+ + "expérience avec MathJax.", + + PageDesigned: + "%1 Cette page est conçue pour utiliser les %2. Téléchargez "+ + " et installez ces polices pour améliorer votre expérience "+ + "avec MathJax", + + STIXfonts: + "Polices STIX", + + TeXfonts: + "Polices TeX de MathJax", + } + }, Menu: { isLoaded: true, strings: { + AboutBox: + "%1 utilisant %2", + WebkitNativeMMLWarning: "Votre navigateur ne semble pas comporter de support MathML, " + @@ -2564,7 +2601,7 @@ MathJax.Localization = { "en utilisant la commande Alt-Clic sur une expression.", NoOriginalForm: - "Aucune forme originelle", + "Aucune forme d'origine disponible.", Close: "Fermer", @@ -2572,17 +2609,46 @@ MathJax.Localization = { EqSource: "Source de l'équation MathJax" } + }, + + ConfigWarning: { + isLoaded: true, + strings: { + MissingConfig: + "%1 MathJax ne charge plus de fichier de configuration par défaut"+ + " ; vous devez spécifier ces fichiers de façons explicites. Cette"+ + " page semble utiliser l'ancien fichier de configuration par "+ + "défaut %2 and doit donc être mise à jour. Ceci est expliqué "+ + "en détails à l'addresse suivante: %3" + } + }, + + Message: { + isLoaded: true, + strings: { + LoadFailed: "Échec du chargement du fichier %1" + } } + }, + + plural: function(n) { + if (0 <= n && n < 2) return 1; // one + return 2; // other + }, + + number: function(n) { + return n.replace(".", ","); // replace dot by comma } + } }, _: function (messageId, englishPhrase) { // These variables are used in string parsing - var plural = this.plural; + var locale = this; var args = arguments; - var i, s, result; + var i, s, resultString, resultArray; function parseNextUnicodePoint(appendToResult) { @@ -2590,13 +2656,13 @@ MathJax.Localization = { if (n <= 0xD7FF || 0xE000 <= n) { // Code points U+0000 to U+D7FF and U+E000 to U+FFFF. // Append the character. - if (appendToResult) result += s[i] + if (appendToResult) resultString += s[i] i++; return; } else if (i+1 < m) { // Code points U+10000 to U+10FFFF // Append the surrogate pairs. - if (appendToResult) { result += s[i]; result += s[i+1]; } + if (appendToResult) { resultString += s[i]; resultString += s[i+1]; } i+=2 return; } @@ -2614,12 +2680,26 @@ MathJax.Localization = { i += argIndex.length; var key = +argIndex+1; if (key in args) { - if (appendToResult) { result += args[key]; } + if (appendToResult) { + var e = args[key]; + if (Array.isArray(e)) { + // if that's an array, concatenate it to the result array + resultArray.push(resultString); + resultArray = resultArray.concat(e); + resultString = ""; + } else if (typeof e === "number") { + // if that's a number, append a localized version. + resultString += locale.number(e.toString()) + } else { + // otherwise, just concatenate it to the result string + resultString += e; + } + } return true; } // invalid index: just %INTEGER and continue - if (appendToResult) { result += "%" + argIndex; } + if (appendToResult) { resultString += "%" + argIndex; } i++; return true; } @@ -2630,7 +2710,7 @@ MathJax.Localization = { if (!number) return false; // %{INTEGER} escaped integer - if (appendToResult) { result += number[1]; } + if (appendToResult) { resultString += number[1]; } i += number[0].length; return true; } @@ -2697,7 +2777,8 @@ MathJax.Localization = { s = string; i = 0; m = s.length; - result = ""; + resultString = ""; + resultArray = []; while (i < m) { if (s[i] != "%" || i+1 == m) { @@ -2716,14 +2797,16 @@ MathJax.Localization = { if (parseInteger(true)) continue; // %\{plural:%INTEGER|form1|form2 ... \} plural forms - if (parseChoiceBlock("plural", plural)) continue; + if (parseChoiceBlock("plural", locale.plural)) continue; // %CHAR: escaped character parseNextUnicodePoint(true); continue; } - return result; + if (resultArray.length == 0) return resultString; + + return resultArray; } function transformHTMLSnippet(snippet) @@ -2772,6 +2855,8 @@ MathJax.Localization = { setLocale: function(locale) { this.locale = locale; + this.plural = this.strings[locale].plural; + this.number = this.strings[locale].number; // TODO }, @@ -2784,7 +2869,11 @@ MathJax.Localization = { }, plural: function(n) { - if (n == 1) return 1; - return 2; + if (n == 1) return 1; // one + return 2; // other + }, + + number: function(n) { + return n; } }; diff --git a/unpacked/extensions/FontWarnings.js b/unpacked/extensions/FontWarnings.js index d3b21afc1..46612abac 100644 --- a/unpacked/extensions/FontWarnings.js +++ b/unpacked/extensions/FontWarnings.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/FontWarnings.js @@ -84,6 +86,12 @@ (function (HUB,HTML) { var VERSION = "2.1"; + + var _ = function (id) { + return MathJax.Localization._.apply(MathJax.Localization, + [ ["FontWarnings",id] ].concat([].slice.call(arguments,1)) + ); + } var CONFIG = HUB.CombineConfig("FontWarnings",{ // @@ -112,29 +120,33 @@ Message: { webFont: [ ["closeBox"], - "MathJax is using web-based fonts to display the mathematics ", - "on this page. These take time to download, so the page would ", - "render faster if you installed math fonts directly in your ", - "system's font folder.", + _("webFont", + "MathJax is using web-based fonts to display the mathematics "+ + "on this page. These take time to download, so the page would "+ + "render faster if you installed math fonts directly in your "+ + "system's font folder."), ["fonts"] ], imageFonts: [ ["closeBox"], - "MathJax is using its image fonts rather than local or web-based fonts. ", - "This will render slower than usual, and the mathematics may not print ", - "at the full resolution of your printer.", + _("imageFonts", + "MathJax is using its image fonts rather than local or web-based fonts. "+ + "This will render slower than usual, and the mathematics may not print "+ + "at the full resolution of your printer."), + ["fonts"], ["webfonts"] ], noFonts: [ ["closeBox"], - "MathJax is unable to locate a font to use to display ", - "its mathematics, and image fonts are not available, so it ", - "is falling back on generic unicode characters in hopes that ", - "your browser will be able to display them. Some characters ", - "may not show up properly, or possibly not at all.", + _("noFonts", + "MathJax is unable to locate a font to use to display "+ + "its mathematics, and image fonts are not available, so it "+ + "is falling back on generic unicode characters in hopes that "+ + "your browser will be able to display them. Some characters "+ + "may not show up properly, or possibly not at all."), ["fonts"], ["webfonts"] ] @@ -168,35 +180,37 @@ [["span",{style:{position:"relative", bottom:".2em"}},["x"]]] ]], - webfonts: [ + webFonts: [ ["p"], - "Most modern browsers allow for fonts to be downloaded over the web. ", - "Updating to a more recent version of your browser (or changing browsers) ", - "could improve the quality of the mathematics on this page." + _("webFonts", + "Most modern browsers allow for fonts to be downloaded over the web. "+ + "Updating to a more recent version of your browser (or changing"+ + "browsers) could improve the quality of the mathematics on this page.") ], - fonts: [ - ["p"], - "MathJax can use either the ", - ["a",{href:"http://www.stixfonts.org/",target:"_blank"},"STIX fonts"], - " or the ", - ["a",{href:"http://www.mathjax.org/help-v2/fonts/",target:"_blank"},["MathJax TeX fonts"]], - ". Download and install either one to improve your MathJax experience." - ], + fonts: _("fonts", + "%1 MathJax can use either the %2 or the % "+ + ". Download and install either one to improve your MathJax experience.", + [["p"]], + [["a",{href:"http://www.stixfonts.org/",target:"_blank"}, + _("STIXfonts", "STIX fonts")]], + [["a",{href:"http://www.mathjax.org/help-v2/fonts/",target:"_blank"}, + [_("TeXfonts", "MathJax TeX fonts")]]] + ), - STIXfonts: [ - ["p"], - "This page is designed to use the ", - ["a",{href:"http://www.stixfonts.org/",target:"_blank"},"STIX fonts"], - ". Download and install those fonts to improve your MathJax experience." - ], - - TeXfonts: [ - ["p"], - "This page is designed to use the ", - ["a",{href:"http://www.mathjax.org/help-v2/fonts/",target:"_blank"},["MathJax TeX fonts"]], - ". Download and install those fonts to improve your MathJax experience." - ] + STIXfonts: _("PageDesigned", + "%1 This page is designed to use the %2."+ + " Download and install those fonts to improve your MathJax experience.", + [["p"]], + [["a",{href:"http://www.mathjax.org/help-v2/fonts/",target:"_blank"}, + [_("STIXfonts", "STIX fonts")]]]), + + TeXfonts: _("PageDesigned", + "%1 This page is designed to use the %2."+ + " Download and install those fonts to improve your MathJax experience.", + [["p"]], + [["a",{href:"http://www.mathjax.org/help-v2/fonts/",target:"_blank"}, + [_("TeXfonts", "MathJax TeX fonts")]]]) }, diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index e849171ac..0ba0af28f 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -622,9 +622,11 @@ MENU.About.div = MENU.Background(MENU.About); var about = HTML.addElement(MENU.About.div,"div",{ id: "MathJax_About" - },[ - ["b",{style:{fontSize:"120%"}},["MathJax"]]," v"+MathJax.version,["br"], - "using "+font,["br"],["br"], + }, + _("AboutBox", "%1 using %2", + [["b",{style:{fontSize:"120%"}},["MathJax"]], + " v"+MathJax.version,["br"]], + [font,["br"],["br"], ["span",{style:{ display:"inline-block", "text-align":"left", "font-size":"80%", "max-height":"20em", overflow:"auto", @@ -635,8 +637,8 @@ src: CONFIG.closeImg, style: {width:"21px", height:"21px", position:"absolute", top:".2em", right:".2em"}, onclick: MENU.About.Remove - }] - ]); + }]]) + ); var doc = (document.documentElement||{}); var H = window.innerHeight || doc.clientHeight || doc.scrollHeight || 0; if (MENU.prototype.msieAboutBug) { diff --git a/unpacked/extensions/v1.0-warning.js b/unpacked/extensions/v1.0-warning.js index 4d375f9e1..781f338b6 100644 --- a/unpacked/extensions/v1.0-warning.js +++ b/unpacked/extensions/v1.0-warning.js @@ -26,6 +26,13 @@ (function (HUB,HTML) { var VERSION = "2.1"; + var _ = function (id) { + return MathJax.Localization._.apply( + MathJax.Localization, + [ ["ConfigWarning", id] ].concat([].slice.call(arguments,1)) + ); + }; + var CONFIG = { style: { position:"fixed", bottom:"4em", left:"3em", width:"40em", @@ -56,8 +63,13 @@ CONFIG.style.position = "absolute"; } else {delete CONFIG.style.filter} CONFIG.style.maxWidth = (document.body.clientWidth-75) + "px"; - DIV = HTML.addElement(frame,"div",{id:"MathJax_ConfigWarning",style:CONFIG.style},[ - [ + DIV = HTML.addElement(frame,"div",{id:"MathJax_ConfigWarning",style:CONFIG.style}, + _("MissingConfig", + "%1 MathJax no longer loads a default configuration file; " + + "you must specify such files explicitly. " + + "This page seems to use the older default %2 file"+ + ", and so needs to be updated. This is explained further at %3", + [[ "div",{ style: { position:"absolute", overflow:"hidden", top:".1em", right:".1em", @@ -73,18 +85,14 @@ onclick: function () {DIV.style.display = "none"} }, [["span",{style:{position:"relative", bottom:".2em"}},["x"]]] - ], - "MathJax no longer loads a default configuration file; " + - "you must specify such files explicitly. " + - "This page seems to use the older default ",["code",{},["config/MathJax.js"]], - " file, and so needs to be updated. This is explained further at", - ["p",{style:{"text-align":"center"}},[ + ]], + [["code",{},["config/MathJax.js"]]], + [["p",{style:{"text-align":"center"}},[ ["a", {href:"http://www.mathjax.org/help/configuration"}, ["http://www.mathjax.org/help/configuration"] ] - ]] - ]); + ]]])) }); })(MathJax.Hub,MathJax.HTML); diff --git a/unpacked/extensions/xxxxxxx b/unpacked/extensions/xxxxxxx new file mode 100644 index 000000000..d468ab868 --- /dev/null +++ b/unpacked/extensions/xxxxxxx @@ -0,0 +1,11 @@ +["Do this", + ["b", null, + ["now!", ["img", {src: url}]] + ] +] + +_("dothis", "Do this %1", + ["b", null, + _("now", "now! %1", ["img", {src: url}]) + ] +) From d71498ee256e137e4691586f2b10e68429015d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Thu, 21 Feb 2013 13:12:42 +0100 Subject: [PATCH 03/41] Implement the general HTML snippets substitution (e.g do the substitution in attributes too) + some small changes. --- unpacked/MathJax.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 1d09ce5e9..a586d363b 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -2682,7 +2682,7 @@ MathJax.Localization = { if (key in args) { if (appendToResult) { var e = args[key]; - if (Array.isArray(e)) { + if (e instanceof Array) { // if that's an array, concatenate it to the result array resultArray.push(resultString); resultArray = resultArray.concat(e); @@ -2729,7 +2729,7 @@ MathJax.Localization = { var choiceIndex = choiceFunction(args[key]), j = 1; var isChosenBlock = (j === choiceIndex); - var blockFound = false; + var blockFound = isChosenBlock; while (i < m) { if (s[i] == "|") { @@ -2811,15 +2811,22 @@ MathJax.Localization = { function transformHTMLSnippet(snippet) { - for (key in snippet) { + for (var key in snippet) { var e = snippet[key]; if (typeof e === "string") { + // transform the string content snippet[key] = transformString(e); continue; } - var lastIndex = e.length-1; - if (Array.isArray(e[lastIndex])) { - e[lastIndex] = transformHTMLSnippet(e[lastIndex]); + if (e[1]) { + // transform attribute values + for (var key2 in e[1]) { + snippet[key][1][key2] = transformString(e[1][key2]); + } + } + if (e[2]) { + // transform the HTML content + snippet[key][2] = transformHTMLSnippet(e[2]); } } return snippet; @@ -2831,7 +2838,7 @@ MathJax.Localization = { if (translationData) { if (translationData.isLoaded) { var domain = "_"; - if (Array.isArray(messageId) && messageId.length == 2) { + if (messageId instanceof Array && messageId.length == 2) { domain = messageId[0]; messageId = messageId[1]; } From 4fdb68a0804e6734cfb891a91909b85bcbecee49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 22 Feb 2013 13:56:52 +0100 Subject: [PATCH 04/41] More attempts to translate messages. --- unpacked/MathJax.js | 58 +++++++++++++++++-- unpacked/extensions/v1.0-warning.js | 5 ++ unpacked/extensions/xxxxxxx | 11 ---- unpacked/jax/input/MathML/jax.js | 42 ++++++++++++-- unpacked/jax/input/TeX/jax.js | 7 ++- .../jax/output/HTML-CSS/autoload/mglyph.js | 13 ++++- unpacked/jax/output/HTML-CSS/config.js | 7 ++- unpacked/jax/output/HTML-CSS/jax.js | 30 ++++++++-- unpacked/jax/output/NativeMML/jax.js | 11 +++- unpacked/jax/output/SVG/autoload/mglyph.js | 7 ++- 10 files changed, 155 insertions(+), 36 deletions(-) delete mode 100644 unpacked/extensions/xxxxxxx diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index a586d363b..05bcd24eb 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -882,7 +882,10 @@ MathJax.fileversion = "2.1"; // The default error hook for file load failures // loadError: function (file) { - BASE.Message.Set("File failed to load: "+file,null,2000); + BASE.Message.Set( + BASE.Localization._(["Message", "LoadFailed"], + "File failed to load: %1", file), + null,2000); BASE.Hub.signal.Post(["file load error",file]); }, @@ -1758,9 +1761,10 @@ MathJax.Hub.Startup = { var user = MathJax.HTML.Cookie.Get("user"); if (user.URL || user.Config) { if (confirm( - "MathJax has found a user-configuration cookie that includes code to be run. " + - "Do you want to run it?\n\n"+ - "(You should press Cancel unless you set up the cookie yourself.)" + MathJax.Localization._("CookieConfig", + "MathJax has found a user-configuration cookie that includes code to"+ + "be run. Do you want to run it?\n\n"+ + "(You should press Cancel unless you set up the cookie yourself.)") )) { if (user.URL) {this.queue.Push(["Require",MathJax.Ajax,user.URL])} if (user.Config) {this.queue.Push(new Function(user.Config))} @@ -2488,9 +2492,28 @@ MathJax.Localization = { isLoaded: true, domains: { "_": { + isLoaded: true, strings: { + CookieConfie: + "MathJax a trouvé un cookie de configuration utilisateur qui inclut"+ + "du code à exécuter. Souhaitez vous l'exécuter?\n\n"+ + "(Choisissez Annuler sauf si vous avez créé ce cookie vous-même", } }, + Message: { + LoadFailed: "Échec du téléchargement de %1", + CantLoadWebFont: "Impossible de télécharcharger la police Web %1", + FirefoxCantLoadWebFont: + "Firefox ne peut télécharger les polices Web à partir d'un hôte"+ + "distant", + CantFindFontUsing: + "Impossible de trouver une police valide en utilisant %1", + WebFontsNotAvailable: + "Polices Web non disponibles -- des images de caractères vont être"+ + "utilisées à la place", + MathJaxNotSupported: + "Votre navigateur ne supporte pas MathJax" + }, FontWarnings: { isLoaded: true, strings: { @@ -2623,10 +2646,33 @@ MathJax.Localization = { } }, - Message: { + MathML: { isLoaded: true, strings: { - LoadFailed: "Échec du chargement du fichier %1" + BadMglyph: "Élement mglyph incorrect: %1", + BadMglyphFont: "Police de caractère incorrecte: %1" + MathPlayer: + "MathJax n'est pas parvenu à configurer MathPlayer.\n\n"+ + "Vous devez d'abord installer MathPlayer. Si c'est déjà le cas,\n"+ + "vos paramètres de sécurités peuvent empêcher l'exécution des\n"+ + "contrôles ActiveX. Sélectionnez Options Internet dans le menu\n"+ + "Outils et sélectionnez l'onglet Sécurité. Appuyez ensuite sur\n"+ + "le menu Niveau Personalisé. Assurez vous que les paramètres\n"+ + "Exécution des contrôles ActiveX et Comportements des exécutables\n"+ + "et des scripts sont activés.\n\n"+ + "Actuellement, vous verez des messages d'erreur à la place des"+ + "expressions mathématiques.", + CantCreateXMLParser: + "MathJax ne peut créer un analyseur grammatical XML pour le MathML", + UnknownNodeType: "Type de noeud inconnu: %1", + UnexpectedTextNode: "Noeud de texte inattendu: %1", + ErrorParsingMathML: + "Erreur lors de l'analyse grammaticale du code MathML", + MathMLSingleElement: + "Le code MathML doit être formé d'un unique élément", + MathMLRootElement: + "Le code MathML doit être formé d'un élément et non un"+ + "élément %1" } } }, diff --git a/unpacked/extensions/v1.0-warning.js b/unpacked/extensions/v1.0-warning.js index 781f338b6..b9c72174b 100644 --- a/unpacked/extensions/v1.0-warning.js +++ b/unpacked/extensions/v1.0-warning.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/v1.0-warning.js @@ -64,6 +66,9 @@ } else {delete CONFIG.style.filter} CONFIG.style.maxWidth = (document.body.clientWidth-75) + "px"; DIV = HTML.addElement(frame,"div",{id:"MathJax_ConfigWarning",style:CONFIG.style}, + // Localization: + // - decide HTML snippet format + // - how do we ensure it is updated when the language is changed? _("MissingConfig", "%1 MathJax no longer loads a default configuration file; " + "you must specify such files explicitly. " + diff --git a/unpacked/extensions/xxxxxxx b/unpacked/extensions/xxxxxxx deleted file mode 100644 index d468ab868..000000000 --- a/unpacked/extensions/xxxxxxx +++ /dev/null @@ -1,11 +0,0 @@ -["Do this", - ["b", null, - ["now!", ["img", {src: url}]] - ] -] - -_("dothis", "Do this %1", - ["b", null, - _("now", "now! %1", ["img", {src: url}]) - ] -) diff --git a/unpacked/jax/input/MathML/jax.js b/unpacked/jax/input/MathML/jax.js index 1270eefb7..31f3bcf13 100644 --- a/unpacked/jax/input/MathML/jax.js +++ b/unpacked/jax/input/MathML/jax.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/jax/input/MathML/jax.js @@ -26,6 +28,11 @@ (function (MATHML,BROWSER) { var MML; + var _ = function (id) { + return MathJax.Localization._.apply(MathJax.Localization,[ + ["MathML",id] ].concat([].slice.call(arguments,1))) + }; + MATHML.Parse = MathJax.Object.Subclass({ Init: function (string) {this.Parse(string)}, @@ -46,18 +53,35 @@ } math = math.replace(/^\s*(?:\/\/)?\s*$/,"$2"); math = math.replace(/&([a-z][a-z0-9]*);/ig,this.replaceEntity); - doc = MATHML.ParseXML(math); if (doc == null) {MATHML.Error("Error parsing MathML")} + doc = MATHML.ParseXML(math); + if (doc == null) { + MATHML.Error(_("ErrorParsingMathML", "Error parsing MathML")) + } } var err = doc.getElementsByTagName("parsererror")[0]; + // Localization: This seems to replace error messages produced + // by browsers. Does that work in all languages? if (err) MATHML.Error("Error parsing MathML: "+err.textContent.replace(/This page.*?errors:|XML Parsing Error: |Below is a rendering of the page.*/g,"")); - if (doc.childNodes.length !== 1) MATHML.Error("MathML must be formed by a single element"); + if (doc.childNodes.length !== 1) { + MATHML.Error( + _("MathMLSingleElement", "MathML must be formed by a single element") + ); + } if (doc.firstChild.nodeName.toLowerCase() === "html") { var h1 = doc.getElementsByTagName("h1")[0]; if (h1 && h1.textContent === "XML parsing error" && h1.nextSibling) + // Localization: This seems to replace error messages produced + // by browsers. Does that work in all languages? MATHML.Error("Error parsing MathML: "+String(h1.nextSibling.nodeValue).replace(/fatal parsing error: /,"")); } - if (doc.firstChild.nodeName.toLowerCase().replace(/^[a-z]+:/,"") !== "math") - MATHML.Error("MathML must be formed by a element, not <"+doc.firstChild.nodeName+">"); + if (doc.firstChild.nodeName.toLowerCase().replace(/^[a-z]+:/,"") !== + "math") { + MATHML.Error( + _("MathMLRootElement", + "MathML must be formed by a element, not %1", + "<"+doc.firstChild.nodeName+">") + ); + } this.mml = this.MakeMML(doc.firstChild); }, @@ -72,7 +96,10 @@ mml = this.TeXAtom(match[2]); } else if (!(MML[type] && MML[type].isa && MML[type].isa(MML.mbase))) { MathJax.Hub.signal.Post(["MathML Jax - unknown node type",type]); - return MML.merror("Unknown node type: "+type); + return MML.merror( + MathJax.Localization._( + "UnknownNodeType", "Unknown node type: %1", type) + ); } else { mml = MML[type](); } @@ -148,7 +175,10 @@ var text = child.nodeValue.replace(/&([a-z][a-z0-9]*);/ig,this.replaceEntity); mml.Append(MML.chars(this.trimSpace(text))); } else if (child.nodeValue.match(/\S/)) { - MATHML.Error("Unexpected text node: '"+child.nodeValue+"'"); + MATHML.Error( + _("UnexpectedTextNode", "Unexpected text node: %1", + "'"+child.nodeValue+"'") + ); } } else if (mml.type === "annotation-xml") { mml.Append(MML.xml(child)); diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index dff09447f..57f7ddc33 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/jax/input/TeX/jax.js @@ -72,8 +74,9 @@ var STACKITEM = STACK.Item = MathJax.Object.Subclass({ type: "base", - closeError: "Extra close brace or missing open brace", - rightError: "Missing \\left or extra \\right", + // Localization: should be updated when the language is changed + closeError: _("closeError", "Extra close brace or missing open brace"), + rightError: _("rightError", "Missing \\left or extra \\right"), Init: function () { if (this.isOpen) {this.env = {}} this.data = []; diff --git a/unpacked/jax/output/HTML-CSS/autoload/mglyph.js b/unpacked/jax/output/HTML-CSS/autoload/mglyph.js index 34cf76194..9c6837f01 100644 --- a/unpacked/jax/output/HTML-CSS/autoload/mglyph.js +++ b/unpacked/jax/output/HTML-CSS/autoload/mglyph.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/jax/output/HTML-CSS/autoload/mglyph.js @@ -39,7 +41,11 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { if (HTMLCSS.Font.testFont(font)) { this.HTMLhandleVariant(span,variant,String.fromCharCode(index)); } else { - if (values.alt === "") {values.alt = "Bad font: "+font.family} + if (values.alt === "") { + values.alt = + MathJax.Localization._(["MathML", "BadMglyphFont"], + "Bad font: %1", font.family); + } err = MML.merror(values.alt).With({mathsize:"75%"}); this.Append(err); err.toHTML(span); this.data.pop(); span.bbox = err.HTMLspanElement().bbox; @@ -57,7 +63,10 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { MathJax.Hub.RestartAfter(img.onload); } if (this.img.status !== "OK") { - err = MML.merror("Bad mglyph: "+values.src).With({mathsize:"75%"}); + err = MML.merror( + MathJax.Localization._(["MathML", "BadMglyph"], + "Bad mglyph: %1", values.src) + ).With({mathsize:"75%"}); this.Append(err); err.toHTML(span); this.data.pop(); span.bbox = err.HTMLspanElement().bbox; } else { diff --git a/unpacked/jax/output/HTML-CSS/config.js b/unpacked/jax/output/HTML-CSS/config.js index b37bec8e1..a142f3a23 100644 --- a/unpacked/jax/output/HTML-CSS/config.js +++ b/unpacked/jax/output/HTML-CSS/config.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/jax/output/HTML-CSS/config.js @@ -145,7 +147,10 @@ MathJax.Hub.Register.StartupHook("End Config",[function (HUB,HTMLCSS) { !HUB.Browser.versionAtLeast(CONFIG.minBrowserVersion[HUB.Browser]||0.0)) { HTMLCSS.Translate = CONFIG.minBrowserTranslate; HUB.Config({showProcessingMessages: false}); - MathJax.Message.Set("Your browser does not support MathJax",null,4000); + MathJax.Message.Set( + MathJax.Localization._(["Message", "MathJaxNotSupported"], + "Your browser does not support MathJax"), + null,4000); HUB.Startup.signal.Post("MathJax not supported"); } diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index 4517dc3f2..eae80fae3 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/jax/output/HTML-CSS/jax.js @@ -129,7 +131,12 @@ loadWebFont: function (font) { HUB.Startup.signal.Post("HTML-CSS Jax - Web-Font "+HTMLCSS.fontInUse+"/"+font.directory); - var n = MathJax.Message.File("Web-Font "+HTMLCSS.fontInUse+"/"+font.directory); + var n = MathJax.Message.File( + // Localization: Message.File(fileName) will write "Loading "+fileName + // Here, this will become "Loading Web-Font "+fileName. Does it work + // for all languages (word order might be different)? + "Web-Font "+HTMLCSS.fontInUse+"/"+font.directory + ); var done = MathJax.Callback({}); // called when font is loaded var callback = MathJax.Callback(["loadComplete",this,font,n,done]); AJAX.timer.start(AJAX,[this.checkWebFont,font,callback],0,this.timeout); @@ -149,11 +156,17 @@ if (!this.webFontLoaded) {HTMLCSS.loadWebFontError(font,done)} else {done()} }, loadError: function (font) { - MathJax.Message.Set("Can't load web font "+HTMLCSS.fontInUse+"/"+font.directory,null,2000); + MathJax.Message.Set( + MathJax.Localization._("Message", "CantLoadWebFont", + "Can't load web font %1", HTMLCSS.fontInUse+"/"+font.directory), + null,2000); HUB.Startup.signal.Post(["HTML-CSS Jax - web font error",HTMLCSS.fontInUse+"/"+font.directory,font]); }, firefoxFontError: function (font) { - MathJax.Message.Set("Firefox can't load web fonts from a remote host",null,3000); + MathJax.Message.Set( + MathJax.Localization._(["Message", "FirefoxCantLoadWebFont"], + "Firefox can't load web fonts from a remote host"), + null,3000); HUB.Startup.signal.Post("HTML-CSS Jax - Firefox web fonts on remote host error"); }, @@ -321,7 +334,11 @@ HUB.Startup.signal.Post("HTML-CSS Jax - using image fonts"); } } else { - MathJax.Message.Set("Can't find a valid font using ["+this.config.availableFonts.join(", ")+"]",null,3000); + MathJax.Message.Set( + MathJax.Localization._(["Message", "CantFindFontUsing"], + "Can't find a valid font using %1", + "["+this.config.availableFonts.join(", ")+"]"), + null,3000); this.FONTDATA = { TeX_factor: 1, baselineskip: 1.2, lineH: .8, lineD: .2, ffLineH: .8, FONTS: {}, VARIANT: {normal: {fonts:[]}}, RANGES: [], @@ -1469,7 +1486,10 @@ this.imgFonts = true; HUB.Startup.signal.Post("HTML-CSS Jax - switch to image fonts"); HUB.Startup.signal.Post("HTML-CSS Jax - using image fonts"); - MathJax.Message.Set("Web-Fonts not available -- using image fonts instead",null,3000); + MathJax.Message.Set( + MathJax.Localization._(["Message", "WebFontNotAvailable"], + "Web-Fonts not available -- using image fonts instead"), + null,3000); AJAX.Require(this.directory+"/imageFonts.js",done); } else { this.allowWebFonts = false; diff --git a/unpacked/jax/output/NativeMML/jax.js b/unpacked/jax/output/NativeMML/jax.js index e47e45304..fb8da25aa 100644 --- a/unpacked/jax/output/NativeMML/jax.js +++ b/unpacked/jax/output/NativeMML/jax.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/jax/output/NativeMML/jax.js @@ -139,7 +141,12 @@ // // If that fails, give an alert about security settings // - alert("MathJax was not able to set up MathPlayer.\n\n"+ + // Localization: this seems to use "\n" to force new lines in the + // dialog: is it really necessary? If so, we need a localization note + // to explain that to localizers. Handling of concatenation might + // be an additional difficulty for the string extractor. + alert(_MathJax.Localization._(["MathML", "MathPlayer"], + "MathJax was not able to set up MathPlayer.\n\n"+ "If MathPlayer is not installed, you need to install it first.\n"+ "Otherwise, your security settings may be preventing ActiveX \n"+ "controls from running. Use the Internet Options item under\n"+ @@ -148,7 +155,7 @@ "'Run ActiveX Controls', and 'Binary and script behaviors'\n"+ "are enabled.\n\n"+ "Currently you will see error messages rather than\n"+ - "typeset mathematics."); + "typeset mathematics.")); } } else { // diff --git a/unpacked/jax/output/SVG/autoload/mglyph.js b/unpacked/jax/output/SVG/autoload/mglyph.js index 72fd3ae47..7a46b84a1 100644 --- a/unpacked/jax/output/SVG/autoload/mglyph.js +++ b/unpacked/jax/output/SVG/autoload/mglyph.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/jax/output/SVG/autoload/mglyph.js @@ -70,7 +72,10 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () { MathJax.Hub.RestartAfter(img.onload); } if (this.img.status !== "OK") { - err = MML.merror("Bad mglyph: "+values.src).With({mathsize:"75%"}); + err = MML.merror( + MathJax.Localization._(["MathML", "BadMglyph"], + "Bad mglyph: %1", values.src) + ).With({mathsize:"75%"}); this.Append(err); svg = err.toSVG(); this.data.pop(); } else { var mu = this.SVGgetMu(svg); From e1761573bf82cf198032e67021265bfc0a7c8320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 22 Feb 2013 18:58:16 +0100 Subject: [PATCH 05/41] Translation of messages from jax/input/TeX/jax.js --- unpacked/MathJax.js | 94 +++++++++++++++ unpacked/jax/input/TeX/jax.js | 218 +++++++++++++++++++++++++--------- 2 files changed, 255 insertions(+), 57 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 05bcd24eb..7ef004fea 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -2646,6 +2646,100 @@ MathJax.Localization = { } }, + Tex: { + isLoaded: true, + strings: { + ExtraCloseMissingOpen: + "Accolade fermante non attendue ou accolade ouvrante manquante", + MissingLeftExtraRight: + "Commande \\left manquante or ou commande \\right non attendue", + MissingScript: + "Argument en exposant ou en indice manquant", + ExtraLeftMissingRight: + "Commande \\left inattendue or ou commande \\right manquante", + Misplaced: "Mauvaise position pour la commande %1", + MissingOpenForScript: + "Accolade ouvrante manquante pour le script %1", + AmbiguousUseOf: + "Usage ambigu de la commande %1", + EnvBadEnd: + "\\begin{%1} s'est terminé par un \\end{%2}", + EnvMissingEnd: + "\\end{%1} manquant", + MissingBoxFor: + "Boite manquante pour la commande %1", + MissingCloseBrace: + "Accolade fermante manquante", + UndefinedControlSequence: + "Commande %1 non définie", + DoubleExponent: + "Double exposant: utilisez des accolades pour clarifier", + DoubleSubscripts: + "Double indice: utilisez des accolades pour clarifier", + DoubleExponentPrime: + "Un prime entraine un double exposant: utilisez"+ + "des accolades pour clarifier", + CanUseHash: + "Vous ne pouvez pas utilisez le caractère #, indiquant un "+ + "paramètre de macro, dans le mode mathématique", + MisplacedMiddle: + "La commande %1 doit être placée à l'intérieur d'une section"+ + "\\left ... \right" + MisplacedLimits: + "La commande %1 n'est autorisée que sur les opérateurs", + MisplacedMoveRoot: + "La commande %1 n'est autorisée qu'à l'intérieur d'une racine", + MultipleMoveRoot: + "Commande %1 redondante", + MoveRootArg: + "L'argument de la commande %1 doit être un entier", + NotMathMLToken: + "L'élément %1 n'est pas un élément MathML élémentaire", + InvalidMathMLAttr: + "Attribut MathML non valide: %1", + UnknownAttrForElement: + "Attribut %1 inconnu pour l'élément %2", + 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?", + 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?", + MissingArgFor: + "Argument manquant pour la commande %1", + ExtraAlignTab: + "Tabulation d'alignement non attendu pour le texte de la commande"+ + "\\cases", + BracketMustBeDimension: + "L'argument entre crochets de la commande %1 doit être une"+ + "dimension", + InvalidEnv: + "Nom d'environnement '%1' non valide", + UnknownEnv: + "Environnement '%1' inconnu", + ExtraClose: + "Accolade fermante non attendue", + ExtraCloseInBrackets: + "Accolade fermante non attendue avant le crochet fermant.", + MissingCloseBracket: + "Impossible de trouver le crochet fermant pour l'argument de la "+ + "commande %1", + MissingOrUnrecognizedDelim: + "Délimiteur manquant ou non reconnu pour la commande %1", + MissingDimOrUnits: + "Dimension ou unité manquante pour la commande %1", + ExtraCloseBraceInUpTo: + "Accolade fermante non attendue avant la commande %1", + TokenNotFoundForCommand: + "Impossible de trouver la commande %1 pour la commande %2", + MathNotTerminated: + "Expression mathématique non terminée à l'intérieur de cette boite"+ + " de texte", + IllegalMacroParam: + "Paramètre de référence de macro non autorisé", + MaxBufferSize: + "Taille maximale du tampon interne de MathJax dépassée. Il y a t'il un appel de macro récursif?" + } + }, + MathML: { isLoaded: true, strings: { diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index 57f7ddc33..2f758bef9 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -28,6 +28,11 @@ (function (TEX,HUB,AJAX) { var MML, NBSP = "\u00A0"; + var _ = function (id) { + return MathJax.Localization._.apply(MathJax.Localization, + [ ["TeX", id] ].concat([].slice.call(arguments,1))) + }; + var STACK = MathJax.Object.Subclass({ Init: function (env,inner) { this.global = {isInner: inner}; @@ -74,9 +79,14 @@ var STACKITEM = STACK.Item = MathJax.Object.Subclass({ type: "base", - // Localization: should be updated when the language is changed - closeError: _("closeError", "Extra close brace or missing open brace"), - rightError: _("rightError", "Missing \\left or extra \\right"), + // Localization: should be updated when the language is changed + // This is used in TEX.Error(this[item.type+"Error"]) below, perhaps a if + // could just be used directly, or make the messageID contains close/right + // Add a note about the \\ syntax. + closeError: _("ExtraCloseMissingOpen", + "Extra close brace or missing open brace"), + rightError: _("MissingLeftExtraRight", + "Missing \\left or extra \\right"), Init: function () { if (this.isOpen) {this.env = {}} this.data = []; @@ -93,7 +103,7 @@ if (item.type === "over" && this.isOpen) {item.num = this.mmlData(false); this.data = []} if (item.type === "cell" && this.isOpen) { if (item.linebreak) {return false} - TEX.Error("Misplaced "+item.name); + TEX.Error(_("Misplaced %1", "Misplaced ", item.name)); } if (item.isClose && this[item.type+"Error"]) {TEX.Error(this[item.type+"Error"])} if (!item.isNotStack) {return true} @@ -124,7 +134,9 @@ STACKITEM.open = STACKITEM.Subclass({ type: "open", isOpen: true, - stopError: "Extra open brace or missing close brace", + // Localization: should be updated when the language is changed + stopError: _("ExtraOpenMissingClose", + "Extra open brace or missing close brace"), checkItem: function (item) { if (item.type === "close") { var mml = this.mmlData(); // this.mmlData(true,true); // force row @@ -150,7 +162,9 @@ STACKITEM.subsup = STACKITEM.Subclass({ type: "subsup", - stopError: "Missing superscript or subscript argument", + // Localization: should be updated when the language is changed + stopError: _("MissingScript", + "Missing superscript or subscript argument"), checkItem: function (item) { var script = ["","subscript","superscript"][this.position]; if (item.type === "open" || item.type === "left") {return true} @@ -162,8 +176,10 @@ this.data[0].SetData(this.position,item.data[0]); return STACKITEM.mml(this.data[0]); } - if (this.SUPER(arguments).checkItem.call(this,item)) - {TEX.Error("Missing open brace for "+script)} + if (this.SUPER(arguments).checkItem.call(this,item)) { + TEX.Error(_("MissingOpenForScript", + "Missing open brace for %1", script)) + } }, Pop: function () {} }); @@ -171,7 +187,9 @@ STACKITEM.over = STACKITEM.Subclass({ type: "over", isClose: true, name: "\\over", checkItem: function (item,stack) { - if (item.type === "over") {TEX.Error("Ambiguous use of "+item.name)} + if (item.type === "over") { + TEX.Error(_("AmbiguousUseOf", "Ambiguous use of %1", item.name)) + } if (item.isClose) { var mml = MML.mfrac(this.num,this.mmlData(false)); if (this.thickness != null) {mml.linethickness = this.thickness} @@ -189,7 +207,9 @@ STACKITEM.left = STACKITEM.Subclass({ type: "left", isOpen: true, delim: '(', - stopError: "Extra \\left or missing \\right", + // Localization: should be updated when the language is changed + // Add a note about the \\ syntax. + stopError: _("ExtraLeftMissingRight", "Extra \\left or missing \\right"), checkItem: function (item) { if (item.type === "right") { var mml = MML.mfenced(this.data.length === 1 ? this.data[0] : MML.mrow.apply(MML,this.data)); @@ -207,12 +227,17 @@ type: "begin", isOpen: true, checkItem: function (item) { if (item.type === "end") { - if (item.name !== this.name) - {TEX.Error("\\begin{"+this.name+"} ended with \\end{"+item.name+"}")} + if (item.name !== this.name) { + TEX.Error(_("EnvBadEnd", + "\\begin{%1} ended with \\end{%2}", + this.name, item.name)) + } if (!this.end) {return STACKITEM.mml(this.mmlData())} return this.parse[this.end].call(this.parse,this,this.data); } - if (item.type === "stop") {TEX.Error("Missing \\end{"+this.name+"}")} + if (item.type === "stop") { + TEX.Error(_("EnvMissingEnd", "Missing \\end{%1}", this.name)) + } return this.SUPER(arguments).checkItem.call(this,item); } }); @@ -233,7 +258,9 @@ STACKITEM.position = STACKITEM.Subclass({ type: "position", checkItem: function (item) { - if (item.isClose) {TEX.Error("Missing box for "+this.name)} + if (item.isClose) { + TEX.Error(_("MissingBoxFor", "Missing box for %1")) + } if (item.isNotStack) { var mml = item.mmlData(); switch (this.move) { @@ -275,7 +302,7 @@ mml = STACKITEM.mml(mml); if (this.requireClose) { if (item.type === 'close') {return mml} - TEX.Error("Missing close brace"); + TEX.Error(_("MissingCloseBrace", "Missing close brace")); } return [mml,item]; } @@ -1119,7 +1146,8 @@ // (overridden in noUndefined extension) // csUndefined: function (name) { - TEX.Error("Undefined control sequence "+name); + TEX.Error(_("UndefinedControlSequence", + "Undefined control sequence %1", name)); }, /* @@ -1164,7 +1192,10 @@ else {base = this.stack.Prev(); if (!base) {base = MML.mi("")}} if (base.isEmbellishedWrapper) {base = base.data[0].data[0]} if (base.type === "msubsup") { - if (base.data[base.sup]) {TEX.Error("Double exponent: use braces to clarify")} + if (base.data[base.sup]) { + TEX.Error(_("DoubleExponent", + "Double exponent: use braces to clarify")) + } position = base.sup; } else if (base.movesupsub) { if (base.type !== "munderover" || base.data[base.over]) { @@ -1186,7 +1217,10 @@ else {base = this.stack.Prev(); if (!base) {base = MML.mi("")}} if (base.isEmbellishedWrapper) {base = base.data[0].data[0]} if (base.type === "msubsup") { - if (base.data[base.sub]) {TEX.Error("Double subscripts: use braces to clarify")} + if (base.data[base.sub]) { + TEX.Error(_("DoubleSubscripts", + "Double subscripts: use braces to clarify")) + } position = base.sub; } else if (base.movesupsub) { if (base.type !== "munderover" || base.data[base.under]) { @@ -1203,8 +1237,10 @@ PRIME: "\u2032", SMARTQUOTE: "\u2019", Prime: function (c) { var base = this.stack.Prev(); if (!base) {base = MML.mi()} - if (base.type === "msubsup" && base.data[base.sup]) - {TEX.Error("Prime causes double exponent: use braces to clarify")} + if (base.type === "msubsup" && base.data[base.sup]) { + TEX.Error(_("DoubleExponentPrime", + "Prime causes double exponent: use braces to clarify")) + } var sup = ""; this.i--; do {sup += this.PRIME; this.i++, c = this.GetNext()} while (c === "'" || c === this.SMARTQUOTE); @@ -1231,7 +1267,8 @@ * Handle hash marks outside of definitions */ Hash: function (c) { - TEX.Error("You can't use 'macro parameter character #' in math mode"); + TEX.Error(_("CanUseHash", + "You can't use 'macro parameter character #' in math mode")); }, /* @@ -1284,7 +1321,9 @@ Middle: function (name) { var delim = this.GetDelimiter(name); - if (this.stack.Top().type !== "left") {TEX.Error(name+" must be within \\left and \\right")} + if (this.stack.Top().type !== "left") { + TEX.Error(_("MisplacedMiddle", + "%1 must be within \\left and \\right", name)} this.Push(MML.mo(delim).With({stretchy:true})); }, @@ -1307,7 +1346,10 @@ }, Limits: function (name,limits) { var op = this.stack.Prev("nopop"); - if (!op || op.texClass !== MML.TEXCLASS.OP) {TEX.Error(name+" is allowed only on operators")} + if (!op || op.texClass !== MML.TEXCLASS.OP) { + TEX.Error(_("MisplacedLimits", + "%1 is allowed only on operators", name)) + } op.movesupsub = (limits ? true : false); op.movablelimits = false; }, @@ -1356,10 +1398,18 @@ return n; }, MoveRoot: function (name,id) { - if (!this.stack.env.inRoot) TEX.Error(name+" can appear only within a root"); - if (this.stack.global[id]) TEX.Error("Multiple use of "+name); + if (!this.stack.env.inRoot) { + TEX.Error(_("BadMoveRoot", "%1 can appear only within a root")); + } + if (this.stack.global[id]) { + TEX.Error(_("MultipleMoveRoot", + "Multiple use of %1", name)); + } var n = this.GetArgument(name); - if (!n.match(/-?[0-9]+/)) TEX.Error("The argument to "+name+" must be an integer"); + if (!n.match(/-?[0-9]+/)) { + TEX.Error(_("MoveRootArg", + "The argument to %1 must be an integer", name)); + } n = (n/15)+"em"; if (n.substr(0,1) !== "-") {n = "+"+n} this.stack.global[id] = n; @@ -1414,12 +1464,21 @@ attr = this.GetBrackets(name,"").replace(/^\s+/,""), data = this.GetArgument(name), def = {attrNames:[]}, match; - if (!MML[type] || !MML[type].prototype.isToken) {TEX.Error(type+" is not a token element")} + if (!MML[type] || !MML[type].prototype.isToken) { + TEX.Error(_("NotMathMLToken", "%1 is not a token element", type)) + } while (attr !== "") { match = attr.match(/^([a-z]+)\s*=\s*('[^']*'|"[^"]*"|[^ ]*)\s*/i); - if (!match) {TEX.Error("Invalid MathML attribute: "+attr)} - if (!MML[type].prototype.defaults[match[1]] && !this.MmlTokenAllow[match[1]]) - {TEX.Error(match[1]+" is not a recognized attribute for "+type)} + if (!match) { + TEX.Error("InvalidMathMLAttr", + "Invalid MathML attribute: %1", attr) + } + if (!MML[type].prototype.defaults[match[1]] && + !this.MmlTokenAllow[match[1]]) { + TEX.Error(_("UnknownAttrForElement", + "%1 is not a recognized attribute for %2", + match[1], type)) + } def[match[1]] = match[2].replace(/^(['"])(.*)\1$/,"$2"); def.attrNames.push(match[1]); attr = attr.substr(match[0].length); @@ -1565,12 +1624,17 @@ } this.string = this.AddArgs(macro,this.string.slice(this.i)); this.i = 0; - if (++this.macroCount > TEX.config.MAXMACROS) - {TEX.Error("MathJax maximum macro substitution count exceeded; is there a recursive macro call?")} + if (++this.macroCount > TEX.config.MAXMACROS) { + TEX.Error(_("MaxMacroSub", + "MathJax maximum macro substitution count exceeded; is there a recursive macro call?")) + } }, Matrix: function (name,open,close,align,spacing,vspacing,style,cases) { - var c = this.GetNext(); if (c === "") {TEX.Error("Missing argument for "+name)} + var c = this.GetNext(); + if (c === "") { + TEX.Error(_("MissingArgFor", "Missing argument for %1", name)) + } if (c === "{") {this.i++} else {this.string = c+"}"+this.string.slice(this.i+1); this.i = 0} var array = STACKITEM.array().With({ requireClose: true, @@ -1595,8 +1659,10 @@ var c = string.charAt(i); if (c === "{") {braces++; i++} else if (c === "}") {if (braces === 0) {m = 0} else {braces--; i++}} - else if (c === "&" && braces === 0) {TEX.Error("Extra alignment tab in \\cases text")} - else if (c === "\\") { + else if (c === "&" && braces === 0) { + TEX.Error(_("ExtraAlignTab", + "Extra alignment tab in \\cases text")) + } else if (c === "\\") { if (string.substr(i).match(/^((\\cr)[^a-zA-Z]|\\\\)/)) {m = 0} else {i += 2} } else {i++} } @@ -1616,8 +1682,11 @@ var n; if (this.string.charAt(this.i) === "[") { n = this.GetBrackets(name,"").replace(/ /g,""); - if (n && !n.match(/^((-?(\.\d+|\d+(\.\d*)?))(pt|em|ex|mu|mm|cm|in|pc))$/)) - {TEX.Error("Bracket argument to "+name+" must be a dimension")} + if (n && + !n.match(/^((-?(\.\d+|\d+(\.\d*)?))(pt|em|ex|mu|mm|cm|in|pc))$/)) { + TEX.Error(_("BracketMustBeDimension", + "Bracket argument to %1 must be a dimension", name)) + } } this.Push(STACKITEM.cell().With({isCR: true, name: name, linebreak: true})); var top = this.stack.Top(); @@ -1656,7 +1725,9 @@ HLine: function (name,style) { if (style == null) {style = "solid"} var top = this.stack.Top(); - if (!top.isa(STACKITEM.array) || top.data.length) {TEX.Error("Misplaced "+name)} + if (!top.isa(STACKITEM.array) || top.data.length) { + TEX.Error(_("Misplaced", "Misplaced %1", name)) + } if (top.table.length == 0) { top.frame.push("top"); } else { @@ -1674,10 +1745,19 @@ Begin: function (name) { var env = this.GetArgument(name); - if (env.match(/[^a-z*]/i)) {TEX.Error('Invalid environment name "'+env+'"')} - var cmd = this.envFindName(env); if (!cmd) {TEX.Error('Unknown environment "'+env+'"')} - if (++this.macroCount > TEX.config.MAXMACROS) - {TEX.Error("MathJax maximum substitution count exceeded; is there a recursive latex environment?")} + if (env.match(/[^a-z*]/i)) { + TEX.Error(_("InvalidEnv", + "Invalid environment name '%1'", env)) + } + var cmd = this.envFindName(env); + if (!cmd) { + TEX.Error(_("UnknownEnv", + "Unknown environment '%1'", env)) + } + if (++this.macroCount > TEX.config.MAXMACROS) { + TEX.Error(_("MaxMacroSub2", + "MathJax maximum substitution count exceeded; is there a recursive latex environment?")) + } if (!(cmd instanceof Array)) {cmd = [cmd]} var mml = STACKITEM.begin().With({name: env, end: cmd[1], parse:this}); if (cmd[0] && this[cmd[0]]) {mml = this[cmd[0]].apply(this,[mml].concat(cmd.slice(2)))} @@ -1787,10 +1867,15 @@ GetArgument: function (name,noneOK) { switch (this.GetNext()) { case "": - if (!noneOK) {TEX.Error("Missing argument for "+name)} + if (!noneOK) { + TEX.Error(_("MissingArgFor", "Missing argument for %1", name)) + } return null; case '}': - if (!noneOK) {TEX.Error("Extra close brace or missing open brace")} + if (!noneOK) { + TEX.Error(_("ExtraCloseMissingOpen", + "Extra close brace or missing open brace")) + } return null; case '\\': this.i++; return "\\"+this.GetCS(); @@ -1801,12 +1886,14 @@ case '\\': this.i++; break; case '{': parens++; break; case '}': - if (parens == 0) {TEX.Error("Extra close brace")} + if (parens == 0) { + TEX.Error(_("ExtraClose", "Extra close brace")) + } if (--parens == 0) {return this.string.slice(j,this.i-1)} break; } } - TEX.Error("Missing close brace"); + TEX.Error(_("MissingCloseBrace", "Missing close brace")); break; } return this.string.charAt(this.i++); @@ -1823,14 +1910,19 @@ case '{': parens++; break; case '\\': this.i++; break; case '}': - if (parens-- <= 0) {TEX.Error("Extra close brace while looking for ']'")} + if (parens-- <= 0) { + TEX.Error(_("ExtraCloseInBrackets", + "Extra close brace while looking for ']'")) + } break; case ']': if (parens == 0) {return this.string.slice(j,this.i-1)} break; } } - TEX.Error("Couldn't find closing ']' for argument to "+name); + TEX.Error( + _("MissingCloseBracket", + "Couldn't find closing ']' for argument to %1", name)); }, /* @@ -1843,7 +1935,8 @@ this.i++; if (c == "\\") {c += this.GetCS(name)} if (TEXDEF.delimiter[c] != null) {return this.convertDelimiter(c)} } - TEX.Error("Missing or unrecognized delimiter for "+name); + TEX.Error(_("MissingOrUnrecognizedDelim", + "Missing or unrecognized delimiter for %1", name)); }, /* @@ -1864,7 +1957,8 @@ return match[1].replace(/ /g,""); } } - TEX.Error("Missing dimension or its units for "+name); + TEX.Error(_("MissingDimOrUnits", + "Missing dimension or its units for %1", name)); }, /* @@ -1879,13 +1973,17 @@ case '\\': c += this.GetCS(); break; case '{': parens++; break; case '}': - if (parens == 0) {TEX.Error("Extra close brace while looking for "+token)} + if (parens == 0) { + TEX.Error(_("ExtraCloseBraceInUpTo", + "Extra close brace while looking for %1", token)) + } parens--; break; } if (parens == 0 && c == token) {return this.string.slice(j,k)} } - TEX.Error("Couldn't find "+token+" for "+name); + TEX.Error(_("TokenNotFoundForCommand", + "Couldn't find %1 for %2", token, name)); }, /* @@ -1934,7 +2032,9 @@ } } } - if (match !== '') {TEX.Error("Math not terminated in text box")} + if (match !== '') { + TEX.Error(_("MathNotTerminated", "Math not terminated in text box")) + } if (k < text.length) {mml.push(this.InternalText(text.slice(k),def))} return mml; }, @@ -1954,8 +2054,10 @@ else if (c === '#') { c = string.charAt(i++); if (c === '#') {text += c} else { - if (!c.match(/[1-9]/) || c > args.length) - {TEX.Error("Illegal macro parameter reference")} + if (!c.match(/[1-9]/) || c > args.length) { + TEX.Error(_("IllegalMacroParam", + "Illegal macro parameter reference")) + } newstring = this.AddArgs(this.AddArgs(newstring,text),args[c-1]); text = ''; } @@ -1970,8 +2072,10 @@ */ AddArgs: function (s1,s2) { if (s2.match(/^[a-z]/i) && s1.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)) {s1 += ' '} - if (s1.length + s2.length > TEX.config.MAXBUFFER) - {TEX.Error("MathJax internal buffer size exceeded; is there a recursive macro call?")} + if (s1.length + s2.length > TEX.config.MAXBUFFER) { + TEX.Error(_("MaxBufferSize", + "MathJax internal buffer size exceeded; is there a recursive macro call?")) + } return s1+s2; } From dd019796b0bcdd79222ad414bf546609bc8e8563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Mon, 25 Feb 2013 16:09:17 +0100 Subject: [PATCH 06/41] More translations... --- unpacked/MathJax.js | 53 +++++++++++++++++++-- unpacked/config/Accessible-full.js | 5 +- unpacked/config/Accessible.js | 5 +- unpacked/config/MMLorHTML.js | 7 ++- unpacked/config/default.js | 5 +- unpacked/extensions/FontWarnings.js | 5 ++ unpacked/extensions/MathMenu.js | 13 ++++++ unpacked/extensions/TeX/AMSmath.js | 67 ++++++++++++++++++++++----- unpacked/extensions/TeX/bbox.js | 32 +++++++++++-- unpacked/extensions/TeX/begingroup.js | 2 + unpacked/extensions/TeX/color.js | 2 + unpacked/extensions/TeX/extpfeil.js | 2 + unpacked/extensions/TeX/mhchem.js | 2 + unpacked/extensions/TeX/newcommand.js | 2 + unpacked/extensions/TeX/verb.js | 17 +++++-- unpacked/extensions/v1.0-warning.js | 9 +--- unpacked/jax/input/TeX/jax.js | 2 +- unpacked/jax/output/NativeMML/jax.js | 2 +- 18 files changed, 196 insertions(+), 36 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 7ef004fea..d71dcba6e 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1136,6 +1136,13 @@ MathJax.Message = { frame.style.height = body.clientHeight + 'px'; }, + // Localization: + // - This will be a bit tedious, because some regexp matching and other + // concatenations are done. + // - In RTL languages: perhaps a "direction: rtl" style is needed somewhere ; + // the message box may need to be placed on the right hand side. + // - Perhaps related to the other messages "Loading", "Processing", + // "Typesetting" elsewhere. filterText: function (text,n) { if (MathJax.Hub.config.messageStyle === "simple") { if (text.match(/^Loading /)) { @@ -1210,6 +1217,9 @@ MathJax.Message = { File: function (file) { var root = MathJax.Ajax.config.root; if (file.substr(0,root.length) === root) {file = "[MathJax]"+file.substr(root.length)} + // Localization: + // This is used in the HTML output jax, + // MathJax.Message.File("Web-Font "+...) and so needs to be adapted. return this.Set("Loading "+file); }, @@ -1269,7 +1279,8 @@ MathJax.Hub = { }, errorSettings: { - message: ["[Math Processing Error]"], // HTML snippet structure for message to use + // Localization: should be updated when the language is changed + message: ["["+MathJax.Localization_("MathProcessingError", "Math Processing Error")+"]"], // HTML snippet structure for message to use style: {color: "#CC0000", "font-style":"italic"} // style for message } }, @@ -1554,6 +1565,7 @@ MathJax.Hub = { // Put up final message, reset the state and return // if (state.scripts.length && this.config.showProcessingMessages) + // Localization: see filterText {MathJax.Message.Set("Processing math: 100%",0)} state.start = new Date().getTime(); state.i = state.j = 0; return null; @@ -1653,6 +1665,7 @@ MathJax.Hub = { // Put up the typesetting-complete message // if (state.scripts.length && this.config.showProcessingMessages) { + // Localization: see filterText MathJax.Message.Set("Typesetting math: 100%",0); MathJax.Message.Clear(0); } @@ -1662,6 +1675,7 @@ MathJax.Hub = { processMessage: function (state,type) { var m = Math.floor(state.i/(state.scripts.length)*100); + // Localization: see filterText var message = (type === "Output" ? "Typesetting" : "Processing"); if (this.config.showProcessingMessages) {MathJax.Message.Set(message+" math: "+m+"%",0)} }, @@ -2302,10 +2316,13 @@ MathJax.Hub.Startup = { id: "Error", version: "2.1", config: {}, ContextMenu: function () {return BASE.Extension.MathEvents.Event.ContextMenu.apply(BASE.Extension.MathEvents.Event,arguments)}, Mousedown: function () {return BASE.Extension.MathEvents.Event.AltContextMenu.apply(BASE.Extension.MathEvents.Event,arguments)}, + // Localization: should this be translated? getJaxFromMath: function () {return {inputJax:"Error", outputJax:"Error", originalText:"Math Processing Error"}} }; BASE.InputJax.Error = { id: "Error", version: "2.1", config: {}, + // Localization: should this be translated? + // should be updated when the language is changed sourceMenuTitle: "Error Message" }; @@ -2494,10 +2511,14 @@ MathJax.Localization = { "_": { isLoaded: true, strings: { - CookieConfie: + CookieConfig: "MathJax a trouvé un cookie de configuration utilisateur qui inclut"+ "du code à exécuter. Souhaitez vous l'exécuter?\n\n"+ "(Choisissez Annuler sauf si vous avez créé ce cookie vous-même", + MathProcessingError: + "Erreur de traitement de la formule mathématique", + MathError: + "Erreur dans la formule mathématique" } }, Message: { @@ -2691,8 +2712,11 @@ MathJax.Localization = { "La commande %1 n'est autorisée qu'à l'intérieur d'une racine", MultipleMoveRoot: "Commande %1 redondante", - MoveRootArg: + IntegerArg: "L'argument de la commande %1 doit être un entier", + PositiveIntegerArg: + "L'argument de la commande %1 doit être un entier strictement"+ + "positif", NotMathMLToken: "L'élément %1 n'est pas un élément MathML élémentaire", InvalidMathMLAttr: @@ -2736,7 +2760,28 @@ MathJax.Localization = { IllegalMacroParam: "Paramètre de référence de macro non autorisé", 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: + "La commande %1 n'est pas autorisé à l'intérieur de"+ + "l'environnement %2", + MultipleCommand: "Usage multiple de la commande %1", + MultipleLabel: "Étiquette '%1' déjà définie", + CommandAtTheBeginingOfLine: + "La commande %1 doit être placée en début de ligne", + IllegalAlign: "Alignement non autorisé pour la commande %1", + BadMathStyleFor: + "Style mathématique non valide pour la commande %1", + ErroneousNestingEq: + "Emboitement incorrect des structures d'équation" + MultipleRowsOneCol: + "Les lignes multiples doivent avoir exactement une colonne" + NoClosingDelim: + "Impossible de trouver le délimiteur fermant pour la commande %1", + MultipleBBoxProperty: + "La propriété %1 de la commande %2 spécifiée deux fois", + InvalidBboxProperty: + "La valeur '%1' ne semble pas être une couleur, une dimension ou"+ + "de marge intérieur ou un style." } }, diff --git a/unpacked/config/Accessible-full.js b/unpacked/config/Accessible-full.js index 96f3e943e..4aa8b06c2 100644 --- a/unpacked/config/Accessible-full.js +++ b/unpacked/config/Accessible-full.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /* * /MathJax/unpacked/config/Accessible-full.js * @@ -22,7 +24,8 @@ MathJax.Hub.Config({ mpMouse: true }, errorSettings: { - message: ["[Math Error]"] + // Localization: should be updated when the language is changed + message: ["["+MathJax.Localization._("MathError", "Math Error")+"]"] } }); diff --git a/unpacked/config/Accessible.js b/unpacked/config/Accessible.js index 521f2eef1..384c60102 100644 --- a/unpacked/config/Accessible.js +++ b/unpacked/config/Accessible.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /* * /MathJax/unpacked/config/Accessible.js * @@ -22,7 +24,8 @@ MathJax.Hub.Config({ mpMouse: true }, errorSettings: { - message: ["[Math Error]"] + // Localization: should be updated when the language is changed + message: ["["+MathJax.Localization._("MathError", "Math Error")+"]"] } }); diff --git a/unpacked/config/MMLorHTML.js b/unpacked/config/MMLorHTML.js index a0d6028ae..124d4cc7c 100644 --- a/unpacked/config/MMLorHTML.js +++ b/unpacked/config/MMLorHTML.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/config/MMLorHTML.js @@ -95,7 +97,10 @@ } else { HUB.PreProcess.disabled = true; HUB.prepareScripts.disabled = true; - MathJax.Message.Set("Your browser does not support MathJax",null,4000); + MathJax.Message.Set( + MathJax.Localization._(["Message", MathJaxNotSupported], + "Your browser does not support MathJax"), + null,4000); HUB.Startup.signal.Post("MathJax not supported"); } }); diff --git a/unpacked/config/default.js b/unpacked/config/default.js index f432e9c02..a308af5eb 100644 --- a/unpacked/config/default.js +++ b/unpacked/config/default.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/config/default.js @@ -234,7 +236,8 @@ MathJax.Hub.Config({ // jax that prevents it from operating properly). // errorSettings: { - message: ["[Math Processing Error]"], // HTML snippet structure for message to use + // Localization: should be updated when the language is changed + message: ["["+MathJax.Localization._("MathProcessingError", "Math Processing Error"])+"]"], // HTML snippet structure for message to use style: {color: "#CC0000", "font-style":"italic"} // style for message }, diff --git a/unpacked/extensions/FontWarnings.js b/unpacked/extensions/FontWarnings.js index 46612abac..a1cf936e2 100644 --- a/unpacked/extensions/FontWarnings.js +++ b/unpacked/extensions/FontWarnings.js @@ -118,6 +118,8 @@ // The messages for the various situations // Message: { + // Localization: + // how do we ensure it is updated when the language is changed? webFont: [ ["closeBox"], _("webFont", @@ -180,6 +182,9 @@ [["span",{style:{position:"relative", bottom:".2em"}},["x"]]] ]], + // Localization: + // - decide HTML snippet format + // how do we ensure it is updated when the language is changed? webFonts: [ ["p"], _("webFonts", diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index 0ba0af28f..f83d5a11a 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -602,6 +602,10 @@ /* * Handle the ABOUT box */ + // Localization: need to be reorganized. currently, there are concatenation + // of HTMLCSS.fontInUse and English strings based on the values of + // HTMLCSS.webFonts and HTMLCSS.imgFonts, HTMLCSS.allowWebFonts etc Update + // MENU.About.GetJax too. MENU.About = function () { var HTMLCSS = OUTPUT["HTML-CSS"] || {fontInUse: ""}; var local = (HTMLCSS.webFonts ? "" : "local "), web = (HTMLCSS.webFonts ? " web" : ""); @@ -619,6 +623,9 @@ (HTMLCSS.webFonts && !HTMLCSS.imgFonts ? " \u2014 " + HTMLCSS.allowWebFonts.replace(/otf/,"woff or otf") + " fonts" : "") ]]); + // Localization: + // - decide HTML snippet format + // - how do we ensure it is updated when the language is changed? MENU.About.div = MENU.Background(MENU.About); var about = HTML.addElement(MENU.About.div,"div",{ id: "MathJax_About" @@ -807,6 +814,7 @@ break; } if (message) { + // Localization: concatenation, new line message += "\n\n"; message += _("SwitchAnyway", "Switch the renderer anyway?\n\n" + @@ -823,6 +831,8 @@ }; MENU.Renderer.Messages = { MML: { + // Localization: should be updated when the language is changed + // concatenation WebKit: _("WebkitNativeMMLWarning", "Your browser doesn't seem to support MathML natively, " + "so switching to MathML output may cause the mathematics " + @@ -883,6 +893,8 @@ alert(MESSAGE.IE9warning); } }; + // Localization: should be updated when the language is changed + // concatenation MENU.MPEvents.Messages = { IE8warning: _("IE8warning", @@ -940,6 +952,7 @@ /* * The main menu */ + // Localization: items used as key, should be refactored. MENU.menu = MENU( ITEM.SUBMENU("Show Math As", ITEM.COMMAND("MathML Code", MENU.ShowSource, {nativeTouch: true, format: "MathML"}), diff --git a/unpacked/extensions/TeX/AMSmath.js b/unpacked/extensions/TeX/AMSmath.js index e2682e519..133f35464 100644 --- a/unpacked/extensions/TeX/AMSmath.js +++ b/unpacked/extensions/TeX/AMSmath.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/TeX/AMSmath.js @@ -159,8 +161,16 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { var arg = this.trimSpaces(this.GetArgument(name)), tag = arg; if (!star) {arg = CONFIG.formatTag(arg)} var global = this.stack.global; global.tagID = tag; - if (global.notags) {TEX.Error(name+" not allowed in "+global.notags+" environment")} - if (global.tag) {TEX.Error("Multiple "+name)} + if (global.notags) { + TEX.Error(MathJax.Localization._(["TeX", "CommandNotAllowedInEnv"], + "%1 not allowed in %2 environment", + name, global.notags) + ) + } + if (global.tag) { + TEX.Error(MathJax.Localization._(["TeX", "MultipleCommand"], + "Multiple %1", name)) + } global.tag = MML.mtd.apply(MML,this.InternalMath(arg)).With({id:CONFIG.formatID(tag)}); }, HandleNoTag: function (name) { @@ -175,9 +185,16 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { var global = this.stack.global, label = this.GetArgument(name); if (label === "") return; if (!AMS.refUpdate) { - if (global.label) {TEX.Error("Multiple "+name+"'s")} + if (global.label) { + TEX.Error(MathJax.Localization._(["TeX", "MultipleCommand"], + "Multiple %1", name)) + } global.label = label; - if (AMS.labels[label] || AMS.eqlabels[label]) {TEX.Error("Label '"+label+"' mutiply defined")} + if (AMS.labels[label] || AMS.eqlabels[label]) { + TEX.Error(MathJax.Localization._(["TeX", "MultipleLabel"], + "Label '%1' mutiply defined", + label) + } AMS.eqlabels[label] = "???"; // will be replaced by tag value later } }, @@ -221,7 +238,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { */ HandleShove: function (name,shove) { var top = this.stack.Top(); - if (top.type !== "multline" || top.data.length) {TEX.Error(name+" must come at the beginning of the line")} + if (top.type !== "multline" || top.data.length) { + TEX.Error(MathJax.Localization._(["TeX", "CommandAtTheBeginingOfLine", + "%1 must come at the beginning of the line")) + } top.data.shove = shove; }, @@ -235,7 +255,11 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { var frac = MML.mfrac(TEX.Parse('\\strut\\textstyle{'+num+'}',this.stack.env).mml(), TEX.Parse('\\strut\\textstyle{'+den+'}',this.stack.env).mml()); lr = ({l:MML.ALIGN.LEFT, r:MML.ALIGN.RIGHT,"":""})[lr]; - if (lr == null) {TEX.Error("Illegal alignment specified in "+name)} + if (lr == null) { + TEX.Error(MathJax.Localization._(["TeX", "IllegalAlign"], + "Illegal alignment specified in %1", + name)) + } if (lr) {frac.numalign = frac.denomalign = lr} this.Push(frac); }, @@ -255,7 +279,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (left || right) {frac = MML.mfenced(frac).With({open: left, close: right})} if (style !== "") { var STYLE = (["D","T","S","SS"])[style]; - if (STYLE == null) {TEX.Error("Bad math style for "+name)} + if (STYLE == null) { + TEX.Error(MathJax.Localization._(["TeX", "BadMathStyleFor"], + "Bad math style for %1", name) + } frac = MML.mstyle(frac); if (STYLE === "D") {frac.displaystyle = true; frac.scriptlevel = 0} else {frac.displaystyle = false; frac.scriptlevel = style - 1} @@ -306,7 +333,11 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { var n, valign, align = "", spacing = []; if (!taggable) {valign = this.GetBrackets("\\begin{"+begin.name+"}")} n = this.GetArgument("\\begin{"+begin.name+"}"); - if (n.match(/[^0-9]/)) {TEX.Error("Argument to \\begin{"+begin.name+"} must me a positive integer")} + if (n.match(/[^0-9]/)) { + TEX.Error(MathJax.Localization._(["TeX", "PositiveIntegerArg"], + "Argument to %1 must me a positive integer"), + "\\begin{"+begin.name+"}") + } while (n > 0) {align += "rl"; spacing.push("0em 0em"); n--} spacing = spacing.join(" "); if (taggable) {return this.AMSarray(begin,numbered,taggable,align,spacing)} @@ -331,7 +362,12 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { * Check for bad nesting of equation environments */ checkEqnEnv: function () { - if (this.stack.global.eqnenv) {TEX.Error("Erroneous nesting of equation structures")} + if (this.stack.global.eqnenv) { + TEX.Error( + MathJax.Localization._(["TeX", "ErroneousNestingEq"], + "Erroneous nesting of equation structures") + ) + } this.stack.global.eqnenv = true; }, @@ -376,7 +412,11 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { GetDelimiterArg: function (name) { var c = this.trimSpaces(this.GetArgument(name)); if (c == "") {return null} - if (TEXDEF.delimiter[c] == null) {TEX.Error("Missing or unrecognized delimiter for "+name)} + if (TEXDEF.delimiter[c] == null) { + TEX.Error(MathJax.Localization._(["TeX", + "MissingOrUnrecognizedDelim"], + "Missing or unrecognized delimiter for %1", name)) + } return this.convertDelimiter(c); }, @@ -438,7 +478,12 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { this.data = []; }, EndRow: function () { - if (this.row.length != 1) {TEX.Error("multline rows must have exactly one column")} + if (this.row.length != 1) { + TEX.Error( + MathJax.Localization._(["TeX", "MultipleRowsOneCol"], + "multline rows must have exactly one column") + ) + } this.table.push(this.row); this.row = []; }, EndTable: function () { diff --git a/unpacked/extensions/TeX/bbox.js b/unpacked/extensions/TeX/bbox.js index 67e0fa1bc..d30026d24 100644 --- a/unpacked/extensions/TeX/bbox.js +++ b/unpacked/extensions/TeX/bbox.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/TeX/bbox.js @@ -63,16 +65,38 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { var match = part.match(/^(\.\d+|\d+(\.\d*)?)(pt|em|ex|mu|px|in|cm|mm)$/); if (match) { var pad = match[1]+match[3]; - if (def) {TEX.Error("Padding specified twice in "+name)} + if (def) { + TEX.Error( + MathJax.Localization._( + ["TeX", "MultipleBboxProperty"], + "%1 specified twice in %2", "Padding", name) + ) + } def = {height:"+"+pad, depth:"+"+pad, lspace:pad, width:"+"+(2*match[1])+match[3]}; } else if (part.match(/^([a-z0-9]+|\#[0-9a-f]{6}|\#[0-9a-f]{3})$/i)) { - if (background) {TEX.Error("Background specified twice in "+name)} + if (background) { + TEX.Error( + MathJax.Localization._( + ["TeX", "MultipleBboxProperty"], + "%1 specified twice in %2", "Background", name) + ) + } background = part; } else if (part.match(/^[-a-z]+:/i)) { - if (style) {TEX.Error("Style specified twice in "+name)} + if (style) { + TEX.Error( + MathJax.Localization._( + ["TeX", "MultipleBboxProperty"], + "%1 specified twice in %2", "Style", name) + ) + } style = part; } else if (part !== "") { - TEX.Error("'"+part+"' doesn't look like a color, a padding dimension, or a style"); + TEX.Error( + MathJax.Localization._( + ["TeX", "InvalidBboxProperty"], + "'%1' doesn't look like a color, a padding dimension, or a style", + part); } } if (def) {math = MML.mpadded(math).With(def)} diff --git a/unpacked/extensions/TeX/begingroup.js b/unpacked/extensions/TeX/begingroup.js index 437a7a188..f8e831403 100644 --- a/unpacked/extensions/TeX/begingroup.js +++ b/unpacked/extensions/TeX/begingroup.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/TeX/begingroup.js diff --git a/unpacked/extensions/TeX/color.js b/unpacked/extensions/TeX/color.js index f090b13c9..0e947d10d 100644 --- a/unpacked/extensions/TeX/color.js +++ b/unpacked/extensions/TeX/color.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/TeX/color.js diff --git a/unpacked/extensions/TeX/extpfeil.js b/unpacked/extensions/TeX/extpfeil.js index dbcf42267..b0a5d2fcb 100644 --- a/unpacked/extensions/TeX/extpfeil.js +++ b/unpacked/extensions/TeX/extpfeil.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/TeX/extpfeil.js diff --git a/unpacked/extensions/TeX/mhchem.js b/unpacked/extensions/TeX/mhchem.js index 4b939875f..4dcaf9cd0 100644 --- a/unpacked/extensions/TeX/mhchem.js +++ b/unpacked/extensions/TeX/mhchem.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/TeX/mhchem.js diff --git a/unpacked/extensions/TeX/newcommand.js b/unpacked/extensions/TeX/newcommand.js index 158e9ef45..74aa1a46e 100644 --- a/unpacked/extensions/TeX/newcommand.js +++ b/unpacked/extensions/TeX/newcommand.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/TeX/newcommand.js diff --git a/unpacked/extensions/TeX/verb.js b/unpacked/extensions/TeX/verb.js index b6d936e7f..2fc756e27 100644 --- a/unpacked/extensions/TeX/verb.js +++ b/unpacked/extensions/TeX/verb.js @@ -1,3 +1,5 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/TeX/verb.js @@ -41,10 +43,19 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { */ Verb: function (name) { var c = this.GetNext(); var start = ++this.i; - if (c == "" ) {TEX.Error(name+" requires an argument")} + if (c == "" ) { + TEX.Error( + MathJax.Localization._( + ["TeX", "MissingArgFor"], + "Argument manquant pour la commande %1", name)) + } while (this.i < this.string.length && this.string.charAt(this.i) != c) {this.i++} - if (this.i == this.string.length) - {TEX.Error("Can't find closing delimiter for "+name)} + if (this.i == this.string.length) { + TEX.Error( + MathJax.Localization._( + ["TeX", "NoClosinDelim"], + "Can't find closing delimiter for %1", name)) + } var text = this.string.slice(start,this.i); this.i++; this.Push(MML.mtext(text).With({mathvariant:MML.VARIANT.MONOSPACE})); } diff --git a/unpacked/extensions/v1.0-warning.js b/unpacked/extensions/v1.0-warning.js index b9c72174b..0f7a41bab 100644 --- a/unpacked/extensions/v1.0-warning.js +++ b/unpacked/extensions/v1.0-warning.js @@ -28,13 +28,6 @@ (function (HUB,HTML) { var VERSION = "2.1"; - var _ = function (id) { - return MathJax.Localization._.apply( - MathJax.Localization, - [ ["ConfigWarning", id] ].concat([].slice.call(arguments,1)) - ); - }; - var CONFIG = { style: { position:"fixed", bottom:"4em", left:"3em", width:"40em", @@ -69,7 +62,7 @@ // Localization: // - decide HTML snippet format // - how do we ensure it is updated when the language is changed? - _("MissingConfig", + MathJax.Localization._(["ConfigWarning", "MissingConfig"], "%1 MathJax no longer loads a default configuration file; " + "you must specify such files explicitly. " + "This page seems to use the older default %2 file"+ diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index 2f758bef9..f1cd6f878 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -1407,7 +1407,7 @@ } var n = this.GetArgument(name); if (!n.match(/-?[0-9]+/)) { - TEX.Error(_("MoveRootArg", + TEX.Error(_("IntegerArg", "The argument to %1 must be an integer", name)); } n = (n/15)+"em"; diff --git a/unpacked/jax/output/NativeMML/jax.js b/unpacked/jax/output/NativeMML/jax.js index fb8da25aa..e982b3f13 100644 --- a/unpacked/jax/output/NativeMML/jax.js +++ b/unpacked/jax/output/NativeMML/jax.js @@ -145,7 +145,7 @@ // dialog: is it really necessary? If so, we need a localization note // to explain that to localizers. Handling of concatenation might // be an additional difficulty for the string extractor. - alert(_MathJax.Localization._(["MathML", "MathPlayer"], + alert(MathJax.Localization._(["MathML", "MathPlayer"], "MathJax was not able to set up MathPlayer.\n\n"+ "If MathPlayer is not installed, you need to install it first.\n"+ "Otherwise, your security settings may be preventing ActiveX \n"+ From 503f9970640b558fde062d65cc49bd09cb77b6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Mon, 25 Feb 2013 18:05:33 +0100 Subject: [PATCH 07/41] Finishing to find all the strings to localize --- unpacked/MathJax.js | 73 +++++++++++++++++++++++---- unpacked/config/default.js | 6 ++- unpacked/extensions/TeX/begingroup.js | 16 ++++-- unpacked/extensions/TeX/color.js | 56 ++++++++++++++++---- unpacked/extensions/TeX/extpfeil.js | 25 ++++++--- unpacked/extensions/TeX/mhchem.js | 17 +++++-- unpacked/extensions/TeX/newcommand.js | 59 +++++++++++++++++----- unpacked/jax/input/TeX/jax.js | 4 +- 8 files changed, 208 insertions(+), 48 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index d71dcba6e..f463ba82c 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1279,8 +1279,9 @@ MathJax.Hub = { }, errorSettings: { - // Localization: should be updated when the language is changed - message: ["["+MathJax.Localization_("MathProcessingError", "Math Processing Error")+"]"], // HTML snippet structure for message to use + // Localization: not defined at that point. + // 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 } }, @@ -2522,6 +2523,8 @@ MathJax.Localization = { } }, Message: { + isLoaded: true, + strings: { LoadFailed: "Échec du téléchargement de %1", CantLoadWebFont: "Impossible de télécharcharger la police Web %1", FirefoxCantLoadWebFont: @@ -2534,6 +2537,7 @@ MathJax.Localization = { "utilisées à la place", MathJaxNotSupported: "Votre navigateur ne supporte pas MathJax" + } }, FontWarnings: { isLoaded: true, @@ -2693,6 +2697,10 @@ MathJax.Localization = { "Accolade fermante manquante", UndefinedControlSequence: "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: "Double exposant: utilisez des accolades pour clarifier", DoubleSubscripts: @@ -2700,12 +2708,15 @@ MathJax.Localization = { DoubleExponentPrime: "Un prime entraine un double exposant: utilisez"+ "des accolades pour clarifier", - CanUseHash: + CantUseHash1: "Vous ne pouvez pas utilisez le caractère #, indiquant un "+ "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: "La commande %1 doit être placée à l'intérieur d'une section"+ - "\\left ... \right" + "\\left ... \right", MisplacedLimits: "La commande %1 n'est autorisée que sur les opérateurs", MisplacedMoveRoot: @@ -2724,9 +2735,11 @@ MathJax.Localization = { UnknownAttrForElement: "Attribut %1 inconnu pour l'élément %2", 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: - "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: "Argument manquant pour la commande %1", ExtraAlignTab: @@ -2760,7 +2773,8 @@ MathJax.Localization = { IllegalMacroParam: "Paramètre de référence de macro non autorisé", 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: "La commande %1 n'est pas autorisé à l'intérieur de"+ "l'environnement %2", @@ -2772,16 +2786,53 @@ MathJax.Localization = { BadMathStyleFor: "Style mathématique non valide pour la commande %1", ErroneousNestingEq: - "Emboitement incorrect des structures d'équation" + "Emboitement incorrect des structures d'équation", MultipleRowsOneCol: - "Les lignes multiples doivent avoir exactement une colonne" + "Les lignes multiples doivent avoir exactement une colonne", NoClosingDelim: "Impossible de trouver le délimiteur fermant pour la commande %1", + NoClosingChar: + "Impossible de trouver le délimiteur '%1' fermant", MultipleBBoxProperty: "La propriété %1 de la commande %2 spécifiée deux fois", InvalidBboxProperty: "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, strings: { BadMglyph: "Élement mglyph incorrect: %1", - BadMglyphFont: "Police de caractère incorrecte: %1" + BadMglyphFont: "Police de caractère incorrecte: %1", MathPlayer: "MathJax n'est pas parvenu à configurer MathPlayer.\n\n"+ "Vous devez d'abord installer MathPlayer. Si c'est déjà le cas,\n"+ diff --git a/unpacked/config/default.js b/unpacked/config/default.js index a308af5eb..008f00f31 100644 --- a/unpacked/config/default.js +++ b/unpacked/config/default.js @@ -236,8 +236,10 @@ MathJax.Hub.Config({ // jax that prevents it from operating properly). // errorSettings: { - // Localization: should be updated when the language is changed - message: ["["+MathJax.Localization._("MathProcessingError", "Math Processing Error"])+"]"], // HTML snippet structure for message to use + // Localization: + // 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 }, diff --git a/unpacked/extensions/TeX/begingroup.js b/unpacked/extensions/TeX/begingroup.js index f8e831403..11126f7d9 100644 --- a/unpacked/extensions/TeX/begingroup.js +++ b/unpacked/extensions/TeX/begingroup.js @@ -215,7 +215,12 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (TEX.eqnStack.top > 1) { TEX.eqnStack.Pop(); } 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 { TEX.eqnStack.Clear(); TEX.rootStack.Pop(); @@ -290,8 +295,13 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { // Global: function (name) { var i = this.i; var cs = this.GetCSname(name); this.i = i; - if (cs !== "let" && cs !== "def" && cs !== "newcommand") - {TEX.Error(name+" not followed by \\let, \\def, or \\newcommand")} + if (cs !== "let" && cs !== "def" && cs !== "newcommand") { + TEX.Error( + MathJax.Localization._( + ["TeX", "GlobalNotFollowedBy"], + "%1 not followed by \\let, \\def, or \\newcommand", name) + ) + } this.stack.env.isGlobal = true; } diff --git a/unpacked/extensions/TeX/color.js b/unpacked/extensions/TeX/color.js index 0e947d10d..696e223ab 100644 --- a/unpacked/extensions/TeX/color.js +++ b/unpacked/extensions/TeX/color.js @@ -114,7 +114,12 @@ MathJax.Extension["TeX/color"] = { getColor: function (model,def) { if (!model) {model = "named"} 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); }, @@ -123,11 +128,24 @@ MathJax.Extension["TeX/color"] = { */ get_rgb: function (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++) { - 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]); - 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} RGB += n; } @@ -139,11 +157,22 @@ MathJax.Extension["TeX/color"] = { */ get_RGB: function (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++) { - 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]); - 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} RGB += n; } @@ -154,9 +183,18 @@ MathJax.Extension["TeX/color"] = { * Get a gray-scale value */ 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); - 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} return "#"+n+n+n; }, diff --git a/unpacked/extensions/TeX/extpfeil.js b/unpacked/extensions/TeX/extpfeil.js index b0a5d2fcb..717ca75ac 100644 --- a/unpacked/extensions/TeX/extpfeil.js +++ b/unpacked/extensions/TeX/extpfeil.js @@ -72,12 +72,25 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { var cs = this.GetArgument(name), space = this.GetArgument(name), chr = this.GetArgument(name); - if (!cs.match(/^\\([a-z]+|.)$/i)) - {TEX.Error("First argument to "+name+" must be a control sequence name")} - if (!space.match(/^(\d+),(\d+)$/)) - {TEX.Error("Second argument to "+name+" must be two integers separated by a comma")} - if (!chr.match(/^(\d+|0x[0-9A-F]+)$/i)) - {TEX.Error("Third argument to "+name+" must be a unicode character number")} + if (!cs.match(/^\\([a-z]+|.)$/i)) { + TEX.Error( + MathJax.Localization._(["TeX", "NewextarrowArg1"] + "First argument to %1 must be a control sequence name", name) + ) + } + 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); TEXDEF.macros[cs] = ['xArrow',chr,parseInt(space[0]),parseInt(space[1])]; } diff --git a/unpacked/extensions/TeX/mhchem.js b/unpacked/extensions/TeX/mhchem.js index 4dcaf9cd0..02007806e 100644 --- a/unpacked/extensions/TeX/mhchem.js +++ b/unpacked/extensions/TeX/mhchem.js @@ -352,11 +352,22 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (C === "{") {braces++} else if (C === "}") { 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) } }); diff --git a/unpacked/extensions/TeX/newcommand.js b/unpacked/extensions/TeX/newcommand.js index 74aa1a46e..a0eb655be 100644 --- a/unpacked/extensions/TeX/newcommand.js +++ b/unpacked/extensions/TeX/newcommand.js @@ -30,6 +30,11 @@ MathJax.Extension["TeX/newcommand"] = { 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 TEXDEF = TEX.Definitions; @@ -55,10 +60,16 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { opt = this.GetBrackets(name), def = this.GetArgument(name); 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) { 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]); }, @@ -73,7 +84,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { edef = this.GetArgument(name); if (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]); }, @@ -130,7 +144,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { */ GetCSname: function (cmd) { 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)); return cs.substr(1); }, @@ -146,8 +163,15 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (c === '#') { if (i !== this.i) {params[n] = this.string.substr(i,this.i-i)} c = this.string.charAt(++this.i); - if (!c.match(/^[1-9]$/)) {TEX.Error("Illegal use of # in template for "+cs)} - if (parseInt(c) != ++n) {TEX.Error("Parameters for "+cs+" must be numbered sequentially")} + if (!c.match(/^[1-9]$/)) { + 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; } else if (c === '{') { 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++; } - 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) { if (n) { var args = []; this.GetNext(); - if (params[0] && !this.MatchParam(params[0])) - {TEX.Error("Use of "+name+" doesn't match its definition")} + if (params[0] && !this.MatchParam(params[0])) { + 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]))} text = this.SubstituteArgs(args,text); } this.string = this.AddArgs(text,this.string.slice(this.i)); this.i = 0; - if (++this.macroCount > TEX.config.MAXMACROS) - {TEX.Error("MathJax maximum macro substitution count exceeded; is there a recursive macro call?")} + if (++this.macroCount > TEX.config.MAXMACROS) { + 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; } } - TEX.Error("Runaway argument for "+name+"?"); + TEX.Error( + _("RunawayArgument", "Runaway argument for %1?", name) + ); }, /* diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index f1cd6f878..c31c4947f 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -1267,7 +1267,7 @@ * Handle hash marks outside of definitions */ Hash: function (c) { - TEX.Error(_("CanUseHash", + TEX.Error(_("CantUseHash1", "You can't use 'macro parameter character #' in math mode")); }, @@ -1323,7 +1323,7 @@ var delim = this.GetDelimiter(name); if (this.stack.Top().type !== "left") { 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})); }, From 660f38959af84bb9cfaa6ca557ced602c38f5eae Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 3 Apr 2013 17:24:14 -0400 Subject: [PATCH 08/41] Make constant messages be translated when they are used rather than when they are defined. Rework About box, add menu ID's. Make TeX.Error() and MathML.Error() handle localization. Break up Fred's French data into separate files. Make localization data load on demand. Other miscellaneous updates. --- unpacked/MathJax.js | 1154 +++++++---------- unpacked/config/Accessible-full.js | 4 +- unpacked/config/Accessible.js | 4 +- unpacked/config/MMLorHTML.js | 6 +- unpacked/config/default.js | 6 +- unpacked/extensions/FontWarnings.js | 7 +- unpacked/extensions/MathEvents.js | 66 +- unpacked/extensions/MathMenu.js | 229 ++-- unpacked/extensions/TeX/AMSmath.js | 69 +- unpacked/extensions/TeX/bbox.js | 38 +- unpacked/extensions/TeX/begingroup.js | 17 +- unpacked/extensions/TeX/color.js | 67 +- unpacked/extensions/TeX/extpfeil.js | 24 +- unpacked/extensions/TeX/mhchem.js | 18 +- unpacked/extensions/TeX/newcommand.js | 54 +- unpacked/extensions/TeX/verb.js | 18 +- unpacked/jax/input/AsciiMath/config.js | 2 +- unpacked/jax/input/AsciiMath/jax.js | 2 +- unpacked/jax/input/MathML/config.js | 2 +- unpacked/jax/input/MathML/jax.js | 68 +- unpacked/jax/input/TeX/config.js | 2 +- unpacked/jax/input/TeX/jax.js | 225 ++-- .../jax/output/HTML-CSS/autoload/mglyph.js | 16 +- unpacked/jax/output/HTML-CSS/config.js | 8 +- unpacked/jax/output/HTML-CSS/jax.js | 35 +- unpacked/jax/output/SVG/autoload/mglyph.js | 7 +- unpacked/localization/fr/FontWarnings.js | 53 + unpacked/localization/fr/MathML.js | 49 + unpacked/localization/fr/MathMenu.js | 118 ++ unpacked/localization/fr/TeX.js | 254 ++++ unpacked/localization/fr/fr.js | 72 + unpacked/localization/fr/v1.0-warning.js | 15 + 32 files changed, 1474 insertions(+), 1235 deletions(-) create mode 100644 unpacked/localization/fr/FontWarnings.js create mode 100644 unpacked/localization/fr/MathML.js create mode 100644 unpacked/localization/fr/MathMenu.js create mode 100644 unpacked/localization/fr/TeX.js create mode 100644 unpacked/localization/fr/fr.js create mode 100644 unpacked/localization/fr/v1.0-warning.js diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index f463ba82c..1e0033d68 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -31,8 +31,8 @@ if (document.getElementById && document.childNodes && document.createElement) { if (!window.MathJax) {window.MathJax= {}} if (!MathJax.Hub) { // skip if already loaded -MathJax.version = "2.1.1"; -MathJax.fileversion = "2.1"; +MathJax.version = "2.1"; +MathJax.fileversion = "2.1.2"; /**********************************************************/ @@ -679,7 +679,7 @@ MathJax.fileversion = "2.1"; } else { this.head = HEAD(this.head); if (this.loader[type]) {this.loader[type].call(this,file,callback)} - else {throw Error("Can't load files of type "+type)} + else {throw Error("Can't load files of type "+type)} } return callback; }, @@ -719,16 +719,18 @@ MathJax.fileversion = "2.1"; // // Create a SCRIPT tag to load the file // - JS: function (file,callback) { + JS: function (file,callback) { var script = document.createElement("script"); var timeout = BASE.Callback(["loadTimeout",this,file]); this.loading[file] = { callback: callback, - message: BASE.Message.File(file), timeout: setTimeout(timeout,this.timeout), status: this.STATUS.OK, script: script }; + // Add this to the structure above after it is created to prevent recursion + // when loading the initial localiation file (before loading messsage is available) + this.loading[file].message = BASE.Message.File(file); script.onerror = timeout; // doesn't work in IE and no apparent substitute script.type = "text/javascript"; script.src = file; @@ -882,10 +884,7 @@ MathJax.fileversion = "2.1"; // The default error hook for file load failures // loadError: function (file) { - BASE.Message.Set( - BASE.Localization._(["Message", "LoadFailed"], - "File failed to load: %1", file), - null,2000); + BASE.Message.Set(["LoadFailed","File failed to load: %1",file],null,2000); BASE.Hub.signal.Post(["file load error",file]); }, @@ -1051,6 +1050,383 @@ MathJax.HTML = { }; +/**********************************************************/ + +MathJax.Localization = { + + locale: "fr", + directory: "[MathJax]/localization", + strings: {fr: {}}, + + _: function (messageId, phrase) { + + // These variables are used in string parsing + var locale = this; + var args = arguments; + var i, s, m, resultString, resultArray; + + function parseNextUnicodePoint(appendToResult) + { + var n = s.charCodeAt(i); + if (n <= 0xD7FF || 0xE000 <= n) { + // Code points U+0000 to U+D7FF and U+E000 to U+FFFF. + // Append the character. + if (appendToResult) resultString += s[i] + i++; + return; + } else if (i+1 < m) { + // Code points U+10000 to U+10FFFF + // Append the surrogate pairs. + if (appendToResult) { resultString += s[i]; resultString += s[i+1]; } + i+=2 + return; + } + // Ignore lead surrogate at the end of the string. + // This should not happen with valid unicode string. + i++; + } + + function parseArgument(appendToResult) + { + if (!(/\d/.test(s[0]))) return false; + + // %INTEGER argument substitution + var argIndex = s.match(/^\d+/)[0]; + i += argIndex.length; + var key = +argIndex+1; + if (key in args) { + if (appendToResult) { + var e = args[key]; + if (e instanceof Array) { + // if that's an array, concatenate it to the result array + resultArray.push(resultString); + resultArray = resultArray.concat(e); + resultString = ""; + } else if (typeof e === "number") { + // if that's a number, append a localized version. + resultString += locale.number(e.toString()) + } else { + // otherwise, just concatenate it to the result string + resultString += e; + } + } + return true; + } + + // invalid index: just %INTEGER and continue + if (appendToResult) { resultString += "%" + argIndex; } + i++; + return true; + } + + function parseInteger(appendToResult) + { + var number = s.match(/^\{(\d+)\}/); + if (!number) return false; + + // %{INTEGER} escaped integer + if (appendToResult) { resultString += number[1]; } + i += number[0].length; + return true; + } + + function parseChoiceBlock(blockName, choiceFunction) + { + var pattern = "^\\{"+blockName+":%(\\d)+\\|"; + var blockStart = s.match(pattern); + if (!blockStart) return false; + + var key = +blockStart[1]+1; + if (!(key in args)) return false; + + // %\{blockName:%INTEGER|form1|form2 ... \} + i = blockStart[0].length; + + var choiceIndex = choiceFunction(args[key]), j = 1; + var isChosenBlock = (j === choiceIndex); + var blockFound = isChosenBlock; + + while (i < m) { + if (s[i] == "|") { + // new choice block + i++; j++; + isChosenBlock = (j === choiceIndex); + if (isChosenBlock) blockFound = true; + continue; + } + if (s[i] == "}") { + // closing brace + i++; + break; + } + if (s[i] != "%" || i+1 == m) { + // normal char or % at the end of the string + parseNextUnicodePoint(isChosenBlock); + continue; + } + + // keep only the substring after the % + i++; s = s.substr(i); m -= i; i = 0; + + // %INTEGER argument substitution + if (parseArgument(isChosenBlock)) continue; + + // %{INTEGER} escaped integer + if (parseInteger(isChosenBlock)) continue; + + // %CHAR: escaped character + parseNextUnicodePoint(isChosenBlock); + continue; + } + + if (!blockFound) { + i = 0; + return false; + } + + return true; + } + + function transformString(string) + { + s = string; + i = 0; + m = s.length; + resultString = ""; + resultArray = []; + + while (i < m) { + if (s[i] != "%" || i+1 == m) { + // normal char or % at the end of the string + parseNextUnicodePoint(true); + continue; + } + + // keep only the substring after the % + i++; s = s.substr(i); m -= i; i = 0; + + // %INTEGER argument substitution + if (parseArgument(true)) continue; + + // %{INTEGER} escaped integer + if (parseInteger(true)) continue; + + // %\{plural:%INTEGER|form1|form2 ... \} plural forms + if (parseChoiceBlock("plural", locale.plural)) continue; + + // %CHAR: escaped character + parseNextUnicodePoint(true); + continue; + } + + if (resultArray.length == 0) return resultString; + + return resultArray; + } + + function transformHTMLSnippet(snippet) + { + for (var key in snippet) { + var e = snippet[key]; + if (typeof e === "string") { + // transform the string content + snippet[key] = transformString(e); + continue; + } + if (e[1]) { + // transform attribute values + for (var key2 in e[1]) { + snippet[key][1][key2] = transformString(e[1][key2]); + } + } + if (e[2]) { + // transform the HTML content + snippet[key][2] = transformHTMLSnippet(e[2]); + } + } + return snippet; + } + + // + // Get the domain and messageID + // + var domain = "_"; + if (messageId instanceof Array) { + domain = (messageId[0] || "_"); + messageId = (messageId[1] || ""); + } + // + // Check if the data is available and if not, + // load it and throw a restart error so the calling + // code can wait for the load and try again. + // + var load = this.loadDomain(domain); + if (load) {MathJax.Hub.RestartAfter(load)} + // + // Look up the message in the localization data + // (if not found, the original English is used) + // + var localeData = this.strings[this.locale]; + if (localeData) { + if (localeData.domains && domain in localeData.domains) { + var domainData = localeData.domains[domain]; + if (domainData.strings && messageId in domainData.strings) + {phrase = domainData.strings[messageId]} + } + } + + if (typeof phrase === "string") { + // handle the phrase as a simple string + return transformString(phrase); + } + + // handle the phrase as a HTML snippet + return transformHTMLSnippet(phrase); + }, + + // + // Load a langauge data file from the proper + // directory and file. + // + loadFile: function (file,data) { + file = (data.file || file); // the data's file name or the default name + if (!file.match(/\.js$/)) {file += ".js"} // add .js if needed + // + // Add the directory if the file doesn't + // contain a full URL already. + // + if (!file.match(/^([a-z]+:|\[MathJax\])/)) { + var dir = (this.strings[this.locale].directory || + this.directory + "/" + this.locale || + "[MathJax]/localization/" + this.locale); + file = dir + "/" + file; + } + // + // Load the file and mark the data as loaded (even if it + // failed to load, so we don't continue to try to load it + // over and over). + // + var load = MathJax.Ajax.Require(file,function () {data.isLoaded = true}); + // + // Return the callback if needed, otherwise null. + // + return (load.called ? null : load); + }, + + // + // Check to see if the localization data are loaded + // for the given domain; if not, load the data file, + // and return a callback for the loading operation. + // Otherwise return null (data are loaded). + // + loadDomain: function (domain) { + var load; + var localeData = this.strings[this.locale]; + if (localeData) { + if (!localeData.isLoaded) { + load = this.loadFile(this.locale,localeData); + if (load) {return load} + } + if (localeData.domains && domain in localeData.domains) { + var domainData = localeData.domains[domain]; + if (!domainData.isLoaded) { + load = this.loadFile(domain,domainData); + if (load) {return load} + } + } + } + return null; // localization data are loaded + }, + + // + // Perform a function, properly handling + // restarts due to localization file loads. + // + // Note that this may return before the function + // has been called successfully, so you should + // consider fn as running asynchronously. (Callbacks + // can be used to synchronize it with other actions.) + // + Try: function (fn) { + fn = MathJax.Callback(fn); fn.autoReset = true; + try {fn()} catch (err) { + if (!err.restart) {throw err} + MathJax.Callback.After(["Try",this,fn],err.restart); + } + }, + + // + // Set the current language + // + setLocale: function(locale) { + // don't set it if there isn't a definition for it + if (this.strings[locale]) {this.locale = locale} + }, + + // + // Add or update a language or domain + // + addTranslation: function (locale,domain,definition) { + var data = this.strings[locale]; + if (!data) {data = this.strings[locale] = {}} + if (!data.domains) {data.domains = {}} + if (domain) { + if (!data.domains[domain]) {data.domains[domain] = {}} + data = data.domains[domain]; + } + MathJax.Hub.Insert(data,definition); + }, + + // + // Set CSS for an element based on font requirements + // + setCSS: function (div) { + var locale = this.strings[this.locale]; + if (locale) { + if (locale.fontFamily) {div.style.fontFamily = locale.fontFamily} + if (locale.fontDirection) { + div.style.direction = locale.fontDirection; + if (locale.fontDirection === "rtl") {div.style.textAlign = "right"} + } + } + return div; + }, + + // + // Get the language's font family or direction + // + fontFamily: function () { + var locale = this.strings[this.locale]; + return (locale ? locale.fontFamily : null); + }, + fontDirection: function () { + var locale = this.strings[this.locale]; + return (locale ? locale.fontDirection : null); + }, + + // + // Get the language's plural index for a number + // + plural: function (n) { + var locale = this.strings[this.locale]; + if (locale && locale.plural) {return locale.plural(n)} + // default + if (n == 1) {return 1} // one + return 2; // other + }, + + // + // Convert a number to language-specific form + // + number: function(n) { + var locale = this.strings[this.locale]; + if (locale && locale.number) {return locale.number(n)} + // default + return n; + } +}; + + /**********************************************************/ MathJax.Message = { @@ -1135,24 +1511,21 @@ MathJax.Message = { frame = frame.firstChild; frame.style.height = body.clientHeight + 'px'; }, + + localize: function (message) { + return MathJax.Localization._(message,message); + }, - // Localization: - // - This will be a bit tedious, because some regexp matching and other - // concatenations are done. - // - In RTL languages: perhaps a "direction: rtl" style is needed somewhere ; - // the message box may need to be placed on the right hand side. - // - Perhaps related to the other messages "Loading", "Processing", - // "Typesetting" elsewhere. - filterText: function (text,n) { + filterText: function (text,n,id) { if (MathJax.Hub.config.messageStyle === "simple") { - if (text.match(/^Loading /)) { - if (!this.loading) {this.loading = "Loading "} + if (id === "LoadFile") { + if (!this.loading) {this.loading = this.localize("Loading") + " "} text = this.loading; this.loading += "."; - } else if (text.match(/^Processing /)) { - if (!this.processing) {this.processing = "Processing "} + } else if (id === "ProcessMath") { + if (!this.processing) {this.processing = this.localize("Processing") + " "} text = this.processing; this.processing += "."; - } else if (text.match(/^Typesetting /)) { - if (!this.typesetting) {this.typesetting = "Typesetting "} + } else if (id === "TypesetMath") { + if (!this.typesetting) {this.typesetting = this.localize("Typesetting") + " "} text = this.typesetting; this.typesetting += "."; } } @@ -1160,14 +1533,49 @@ MathJax.Message = { }, Set: function (text,n,clearDelay) { - if (this.timer) {clearTimeout(this.timer); delete this.timeout} if (n == null) {n = this.log.length; this.log[n] = {}} - this.log[n].text = text; this.log[n].filteredText = text = this.filterText(text,n); + // + // Translate message if it is [id,message,arguments] + // + var id = ""; + if (text instanceof Array) { + id = text[0]; if (id instanceof Array) {id = id[1]} + // + // Localization._() will throw a restart error if a localization file + // needs to be loaded, so trap that and redo the Set() call + // after it is loaded. + // + try { + text = MathJax.Localization._.apply(MathJax.Localization,text); + } catch (err) { + if (!err.restart) {throw err} + if (!err.restart.called) { + this.log[n].restarted = true; // mark it so we can tell if the Clear() comes before the message is up + MathJax.Callback.After(["Set",this,text,n,clearDelay],err.restart); + return n; + } + } + } + // + // Clear the timout timer. + // + if (this.timer) {clearTimeout(this.timer); delete this.timer} + // + // Save the message and filtered message. + // + this.log[n].text = text; this.log[n].filteredText = text = this.filterText(text,n,id); + // + // Hook the message into the message list so we can tell + // what message to put up when this one is removed. + // if (typeof(this.log[n].next) === "undefined") { this.log[n].next = this.current; if (this.current != null) {this.log[this.current].prev = n} this.current = n; } + // + // Show the message if it is the currently active one. + // if (this.current === n && MathJax.Hub.config.messageStyle !== "none") { if (this.Init()) { if (this.textNodeBug) {this.div.innerHTML = text} else {this.text.nodeValue = text} @@ -1178,24 +1586,50 @@ MathJax.Message = { this.status = true; } } + // + // Check if the message was resetarted to load a localization file + // and if it has been cleared in the meanwhile. + // + if (this.log[n].restarted) { + if (this.log[n].cleared) {clearDelay = 0} + delete this.log[n].restarted, this.log[n].cleared; + } + // + // Check if we need to clear the message automatically. + // if (clearDelay) {setTimeout(MathJax.Callback(["Clear",this,n]),clearDelay)} else if (clearDelay == 0) {this.Clear(n,0)} + // + // Return the message number. + // return n; }, Clear: function (n,delay) { + // + // Detatch the message from the active list. + // if (this.log[n].prev != null) {this.log[this.log[n].prev].next = this.log[n].next} if (this.log[n].next != null) {this.log[this.log[n].next].prev = this.log[n].prev} + // + // If it is the current message, get the next one to show. + // if (this.current === n) { this.current = this.log[n].next; if (this.text) { if (this.div.parentNode == null) {this.Init()} // see ASCIIMathML comments above if (this.current == null) { - if (this.timer) {clearTimeout(this.timer); delete this.timer} + // + // If there are no more messages, remove the message box. + // + if (this.timer) {clearTimeout(this.timer); delete this.timer} if (delay == null) {delay = 600} if (delay === 0) {this.Remove()} else {this.timer = setTimeout(MathJax.Callback(["Remove",this]),delay)} } else if (MathJax.Hub.config.messageStyle !== "none") { + // + // If there is an old message, put it in place + // if (this.textNodeBug) {this.div.innerHTML = this.log[this.current].filteredText} else {this.text.nodeValue = this.log[this.current].filteredText} } @@ -1204,8 +1638,16 @@ MathJax.Message = { window.status = (this.current == null ? "" : this.log[this.current].text); } } + // + // Clean up the log data no longer needed + // delete this.log[n].next; delete this.log[n].prev; delete this.log[n].filteredText; + // + // If this is a restarted localization message, mark that it has been cleared + // while waiting for the file to load. + // + if (this.log[n].restarted) {this.log[n].cleared = true} }, Remove: function () { @@ -1217,10 +1659,7 @@ MathJax.Message = { File: function (file) { var root = MathJax.Ajax.config.root; if (file.substr(0,root.length) === root) {file = "[MathJax]"+file.substr(root.length)} - // Localization: - // This is used in the HTML output jax, - // MathJax.Message.File("Web-Font "+...) and so needs to be adapted. - return this.Set("Loading "+file); + return this.Set(["LoadFile","Loading %1",file],null,null); }, Log: function () { @@ -1279,9 +1718,8 @@ MathJax.Hub = { }, errorSettings: { - // Localization: not defined at that point. - // should be updated when the language is changed message: ["[Math Processing Error]"], // HTML snippet structure for message to use + messageId: "MathProcessingErrorHTML", // ID of snippet for localization style: {color: "#CC0000", "font-style":"italic"} // style for message } }, @@ -1567,7 +2005,7 @@ MathJax.Hub = { // if (state.scripts.length && this.config.showProcessingMessages) // Localization: see filterText - {MathJax.Message.Set("Processing math: 100%",0)} + {MathJax.Message.Set(["ProcessMath","Processing math: %1%%",100],0)} state.start = new Date().getTime(); state.i = state.j = 0; return null; }, @@ -1619,7 +2057,7 @@ MathJax.Hub = { } } catch (err) { if (!err.restart) { - MathJax.Message.Set("Error preparing "+id+" output ("+method+")",null,600); + MathJax.Message.Set(["PrepError","Error preparing %1 output (%2)",id,method],null,600); MathJax.Hub.lastPrepError = err; state.j++; } @@ -1666,8 +2104,7 @@ MathJax.Hub = { // Put up the typesetting-complete message // if (state.scripts.length && this.config.showProcessingMessages) { - // Localization: see filterText - MathJax.Message.Set("Typesetting math: 100%",0); + MathJax.Message.Set(["TypesetMath","Typesetting math: %1%%",100],0); MathJax.Message.Clear(0); } state.i = state.j = 0; @@ -1676,9 +2113,9 @@ MathJax.Hub = { processMessage: function (state,type) { var m = Math.floor(state.i/(state.scripts.length)*100); - // Localization: see filterText - var message = (type === "Output" ? "Typesetting" : "Processing"); - if (this.config.showProcessingMessages) {MathJax.Message.Set(message+" math: "+m+"%",0)} + var message = (type === "Output" ? ["TypesetMath","Typesetting math: %1%%"] : + ["ProcessMath","Processing math: %1%%"]); + if (this.config.showProcessingMessages) {MathJax.Message.Set(message.concat(m),0)} }, processError: function (err,state,type) { @@ -1691,7 +2128,9 @@ MathJax.Hub = { }, formatError: function (script,err) { - var error = MathJax.HTML.Element("span",{className:"MathJax_Error"},this.config.errorSettings.message); + var errorSettings = this.config.errorSettings; + var errorText = MathJax.Localization._(errorSettings.messageId,errorSettings.message); + var error = MathJax.HTML.Element("span",{className:"MathJax_Error"},errorText); error.jaxID = "Error"; if (MathJax.Extension.MathEvents) { error.oncontextmenu = MathJax.Extension.MathEvents.Event.Menu; @@ -2138,6 +2577,7 @@ MathJax.Hub.Startup = { BASE.InputJax = JAX.Subclass({ elementJax: "mml", // the element jax to load for this input jax + sourceMenuTitle: /*_(MathMenu)*/ ["OriginalForm","Original Form"], copyTranslate: true, Process: function (script,state) { var queue = CALLBACK.Queue(), file; @@ -2317,14 +2757,16 @@ MathJax.Hub.Startup = { id: "Error", version: "2.1", config: {}, ContextMenu: function () {return BASE.Extension.MathEvents.Event.ContextMenu.apply(BASE.Extension.MathEvents.Event,arguments)}, Mousedown: function () {return BASE.Extension.MathEvents.Event.AltContextMenu.apply(BASE.Extension.MathEvents.Event,arguments)}, - // Localization: should this be translated? - getJaxFromMath: function () {return {inputJax:"Error", outputJax:"Error", originalText:"Math Processing Error"}} + getJaxFromMath: function () { + return { + inputJax: "Error", outputJax: "Error", + originalText: BASE.Localization._("MathProcessingError","Math Processing Error") + }; + } }; BASE.InputJax.Error = { id: "Error", version: "2.1", config: {}, - // Localization: should this be translated? - // should be updated when the language is changed - sourceMenuTitle: "Error Message" + sourceMenuTitle: /*_(MathMenu)*/ ["ErrorMessage","Error Message"] }; })("MathJax"); @@ -2498,625 +2940,3 @@ MathJax.Hub.Startup = { })("MathJax"); }} - -/**********************************************************/ - -MathJax.Localization = { - - locale: "en", - directory: "[MathJax]/localization", - strings: { - fr: { - isLoaded: true, - domains: { - "_": { - isLoaded: true, - strings: { - CookieConfig: - "MathJax a trouvé un cookie de configuration utilisateur qui inclut"+ - "du code à exécuter. Souhaitez vous l'exécuter?\n\n"+ - "(Choisissez Annuler sauf si vous avez créé ce cookie vous-même", - MathProcessingError: - "Erreur de traitement de la formule mathématique", - MathError: - "Erreur dans la formule mathématique" - } - }, - Message: { - isLoaded: true, - strings: { - LoadFailed: "Échec du téléchargement de %1", - CantLoadWebFont: "Impossible de télécharcharger la police Web %1", - FirefoxCantLoadWebFont: - "Firefox ne peut télécharger les polices Web à partir d'un hôte"+ - "distant", - CantFindFontUsing: - "Impossible de trouver une police valide en utilisant %1", - WebFontsNotAvailable: - "Polices Web non disponibles -- des images de caractères vont être"+ - "utilisées à la place", - MathJaxNotSupported: - "Votre navigateur ne supporte pas MathJax" - } - }, - FontWarnings: { - isLoaded: true, - strings: { - webFont: - "MathJax utilise les polices Web pour afficher les expressions " + - "mathématiques sur cette page. Celles-ci mettent du temps à être "+ - "téléchargées et la page serait affichée plus rapidement si vous "+ - "installiez les polices mathématiques directement dans le dossier "+ - "des polices de votre système.", - - imageFonts: - "MathJax utilise des images de caractères plutôt que les polices "+ - "Web ou locales. Ceci rend le rendu plus lent que la normale et "+ - "les expressions mathématiques peuvent ne pas s'imprimer à la "+ - "résolution maximale de votre imprimante", - - noFonts: - "MathJax n'est pas parvenu à localiser une police pour afficher "+ - "les expressions mathématiques et les images de caractères ne "+ - "sont pas disponibles. Comme solution de dernier recours, il "+ - "utilise des caractères Unicode génériques en espérant que votre "+ - "navigateur sera capable de les afficher. Certains pourront ne "+ - "être rendus de façon incorrect voire pas du tout.", - - webFonts: - "La plupart des navigateurs modernes permettent de télécharger "+ - "des polices à partir du Web. En mettant à jour pour une version "+ - "plus récente de votre navigateur (ou en changeant de navigateur) "+ - "la qualité des expressions mathématiques sur cette page pourrait "+ - "être améliorée.", - - fonts: - "%1 MathJax peut utiliser les %2 ou bien les %3. Téléchargez et"+ - "installez l'une de ces familles de polices pour améliorer votre"+ - "expérience avec MathJax.", - - PageDesigned: - "%1 Cette page est conçue pour utiliser les %2. Téléchargez "+ - " et installez ces polices pour améliorer votre expérience "+ - "avec MathJax", - - STIXfonts: - "Polices STIX", - - TeXfonts: - "Polices TeX de MathJax", - } - }, - - Menu: { - isLoaded: true, - strings: { - AboutBox: - "%1 utilisant %2", - - WebkitNativeMMLWarning: - - "Votre navigateur ne semble pas comporter de support MathML, " + - "changer le mode de rendu pourrait rendre illisibles " + - "les expressions mathématiques.", - - MSIENativeMMLWarning: - - "Internet Explorer a besoin de module complémentaire MathPlayer " + - "pour afficher le MathML.", - - OperaNativeMMLWarning: - - "Le support MathML d'Opera est limité, changer le mode de rendu " + - "pourrait entrainer un affichage médiocre de certaines expressions.", - - SafariNativeMMLWarning: - - "Le support MathML natif de votre navigateur ne comporte pas " + - "toutes les fonctionnalités requises par MathJax, certaines " + - "expressions pourront donc ne pas s'afficher correctement.", - - FirefoxNativeMMLWarning: - - "Le support MathML natif de votre navigateur ne comporte pas " + - "toutes les fonctionnalités requises par MathJax, certaines " + - "expressions pourront donc ne pas s'afficher correctement.", - - SwitchAnyway: - "Êtes vous certain de vouloir changer le mode de rendu ?\n\n" + - "Appuyez sur OK pour valider ou Annuler pour continuer avec le " + - "mode de rendu actuellement sélectionné.", - - ScaleMath: - "Mise à l'échelle des expressions mathématiques (par rapport au " + - "text environnant) de %1%%", - - NonZeroScale: - "L'échelle ne peut être nulle", - - PercentScale: - "L'échelle doit être un pourcentage (e.g. 120%%)", - - IE8warning: - "Ceci désactivera le menu de MathJax et les fonctionalités de " + - "zoom mais vous pourrez toujours obtenir le menu de MathJax " + - "en utilisant la commande Alt+Clic sur une expression.\n\n" + - "Êtes vous certain de vouloir choisir les options de MathPlayer?", - - IE9warning: - "Le menu contextuel de MathJax sera désactivé, " + - "mais vous pourrez toujours obtenir le menu de MathJax " + - "en utilisant la commande Alt-Clic sur une expression.", - - NoOriginalForm: - "Aucune forme d'origine disponible.", - - Close: - "Fermer", - - EqSource: - "Source de l'équation MathJax" - } - }, - - ConfigWarning: { - isLoaded: true, - strings: { - MissingConfig: - "%1 MathJax ne charge plus de fichier de configuration par défaut"+ - " ; vous devez spécifier ces fichiers de façons explicites. Cette"+ - " page semble utiliser l'ancien fichier de configuration par "+ - "défaut %2 and doit donc être mise à jour. Ceci est expliqué "+ - "en détails à l'addresse suivante: %3" - } - }, - - Tex: { - isLoaded: true, - strings: { - ExtraCloseMissingOpen: - "Accolade fermante non attendue ou accolade ouvrante manquante", - MissingLeftExtraRight: - "Commande \\left manquante or ou commande \\right non attendue", - MissingScript: - "Argument en exposant ou en indice manquant", - ExtraLeftMissingRight: - "Commande \\left inattendue or ou commande \\right manquante", - Misplaced: "Mauvaise position pour la commande %1", - MissingOpenForScript: - "Accolade ouvrante manquante pour le script %1", - AmbiguousUseOf: - "Usage ambigu de la commande %1", - EnvBadEnd: - "\\begin{%1} s'est terminé par un \\end{%2}", - EnvMissingEnd: - "\\end{%1} manquant", - MissingBoxFor: - "Boite manquante pour la commande %1", - MissingCloseBrace: - "Accolade fermante manquante", - UndefinedControlSequence: - "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: - "Double exposant: utilisez des accolades pour clarifier", - DoubleSubscripts: - "Double indice: utilisez des accolades pour clarifier", - DoubleExponentPrime: - "Un prime entraine un double exposant: utilisez"+ - "des accolades pour clarifier", - CantUseHash1: - "Vous ne pouvez pas utilisez le caractère #, indiquant un "+ - "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: - "La commande %1 doit être placée à l'intérieur d'une section"+ - "\\left ... \right", - MisplacedLimits: - "La commande %1 n'est autorisée que sur les opérateurs", - MisplacedMoveRoot: - "La commande %1 n'est autorisée qu'à l'intérieur d'une racine", - MultipleMoveRoot: - "Commande %1 redondante", - IntegerArg: - "L'argument de la commande %1 doit être un entier", - PositiveIntegerArg: - "L'argument de la commande %1 doit être un entier strictement"+ - "positif", - NotMathMLToken: - "L'élément %1 n'est pas un élément MathML élémentaire", - InvalidMathMLAttr: - "Attribut MathML non valide: %1", - UnknownAttrForElement: - "Attribut %1 inconnu pour l'élément %2", - 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?", - 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?", - MissingArgFor: - "Argument manquant pour la commande %1", - ExtraAlignTab: - "Tabulation d'alignement non attendu pour le texte de la commande"+ - "\\cases", - BracketMustBeDimension: - "L'argument entre crochets de la commande %1 doit être une"+ - "dimension", - InvalidEnv: - "Nom d'environnement '%1' non valide", - UnknownEnv: - "Environnement '%1' inconnu", - ExtraClose: - "Accolade fermante non attendue", - ExtraCloseInBrackets: - "Accolade fermante non attendue avant le crochet fermant.", - MissingCloseBracket: - "Impossible de trouver le crochet fermant pour l'argument de la "+ - "commande %1", - MissingOrUnrecognizedDelim: - "Délimiteur manquant ou non reconnu pour la commande %1", - MissingDimOrUnits: - "Dimension ou unité manquante pour la commande %1", - ExtraCloseBraceInUpTo: - "Accolade fermante non attendue avant la commande %1", - TokenNotFoundForCommand: - "Impossible de trouver la commande %1 pour la commande %2", - MathNotTerminated: - "Expression mathématique non terminée à l'intérieur de cette boite"+ - " de texte", - IllegalMacroParam: - "Paramètre de référence de macro non autorisé", - MaxBufferSize: - "Taille maximale du tampon interne de MathJax dépassée. " + - "Il y a t'il un appel de macro récursif?", - CommandNotAllowedInEnv: - "La commande %1 n'est pas autorisé à l'intérieur de"+ - "l'environnement %2", - MultipleCommand: "Usage multiple de la commande %1", - MultipleLabel: "Étiquette '%1' déjà définie", - CommandAtTheBeginingOfLine: - "La commande %1 doit être placée en début de ligne", - IllegalAlign: "Alignement non autorisé pour la commande %1", - BadMathStyleFor: - "Style mathématique non valide pour la commande %1", - ErroneousNestingEq: - "Emboitement incorrect des structures d'équation", - MultipleRowsOneCol: - "Les lignes multiples doivent avoir exactement une colonne", - NoClosingDelim: - "Impossible de trouver le délimiteur fermant pour la commande %1", - NoClosingChar: - "Impossible de trouver le délimiteur '%1' fermant", - MultipleBBoxProperty: - "La propriété %1 de la commande %2 spécifiée deux fois", - InvalidBboxProperty: - "La valeur '%1' ne semble pas être une couleur, une dimension ou"+ - "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 ?" - } - }, - - MathML: { - isLoaded: true, - strings: { - BadMglyph: "Élement mglyph incorrect: %1", - BadMglyphFont: "Police de caractère incorrecte: %1", - MathPlayer: - "MathJax n'est pas parvenu à configurer MathPlayer.\n\n"+ - "Vous devez d'abord installer MathPlayer. Si c'est déjà le cas,\n"+ - "vos paramètres de sécurités peuvent empêcher l'exécution des\n"+ - "contrôles ActiveX. Sélectionnez Options Internet dans le menu\n"+ - "Outils et sélectionnez l'onglet Sécurité. Appuyez ensuite sur\n"+ - "le menu Niveau Personalisé. Assurez vous que les paramètres\n"+ - "Exécution des contrôles ActiveX et Comportements des exécutables\n"+ - "et des scripts sont activés.\n\n"+ - "Actuellement, vous verez des messages d'erreur à la place des"+ - "expressions mathématiques.", - CantCreateXMLParser: - "MathJax ne peut créer un analyseur grammatical XML pour le MathML", - UnknownNodeType: "Type de noeud inconnu: %1", - UnexpectedTextNode: "Noeud de texte inattendu: %1", - ErrorParsingMathML: - "Erreur lors de l'analyse grammaticale du code MathML", - MathMLSingleElement: - "Le code MathML doit être formé d'un unique élément", - MathMLRootElement: - "Le code MathML doit être formé d'un élément et non un"+ - "élément %1" - } - } - }, - - plural: function(n) { - if (0 <= n && n < 2) return 1; // one - return 2; // other - }, - - number: function(n) { - return n.replace(".", ","); // replace dot by comma - } - - } - }, - - _: function (messageId, englishPhrase) { - - // These variables are used in string parsing - var locale = this; - var args = arguments; - var i, s, resultString, resultArray; - - function parseNextUnicodePoint(appendToResult) - { - var n = s.charCodeAt(i); - if (n <= 0xD7FF || 0xE000 <= n) { - // Code points U+0000 to U+D7FF and U+E000 to U+FFFF. - // Append the character. - if (appendToResult) resultString += s[i] - i++; - return; - } else if (i+1 < m) { - // Code points U+10000 to U+10FFFF - // Append the surrogate pairs. - if (appendToResult) { resultString += s[i]; resultString += s[i+1]; } - i+=2 - return; - } - // Ignore lead surrogate at the end of the string. - // This should not happen with valid unicode string. - i++; - } - - function parseArgument(appendToResult) - { - if (!(/\d/.test(s[0]))) return false; - - // %INTEGER argument substitution - var argIndex = s.match(/^\d+/)[0]; - i += argIndex.length; - var key = +argIndex+1; - if (key in args) { - if (appendToResult) { - var e = args[key]; - if (e instanceof Array) { - // if that's an array, concatenate it to the result array - resultArray.push(resultString); - resultArray = resultArray.concat(e); - resultString = ""; - } else if (typeof e === "number") { - // if that's a number, append a localized version. - resultString += locale.number(e.toString()) - } else { - // otherwise, just concatenate it to the result string - resultString += e; - } - } - return true; - } - - // invalid index: just %INTEGER and continue - if (appendToResult) { resultString += "%" + argIndex; } - i++; - return true; - } - - function parseInteger(appendToResult) - { - var number = s.match(/^\{(\d+)\}/); - if (!number) return false; - - // %{INTEGER} escaped integer - if (appendToResult) { resultString += number[1]; } - i += number[0].length; - return true; - } - - function parseChoiceBlock(blockName, choiceFunction) - { - var pattern = "^\\{"+blockName+":%(\\d)+\\|"; - var blockStart = s.match(pattern); - if (!blockStart) return false; - - var key = +blockStart[1]+1; - if (!(key in args)) return false; - - // %\{blockName:%INTEGER|form1|form2 ... \} - i = blockStart[0].length; - - var choiceIndex = choiceFunction(args[key]), j = 1; - var isChosenBlock = (j === choiceIndex); - var blockFound = isChosenBlock; - - while (i < m) { - if (s[i] == "|") { - // new choice block - i++; j++; - isChosenBlock = (j === choiceIndex); - if (isChosenBlock) blockFound = true; - continue; - } - if (s[i] == "}") { - // closing brace - i++; - break; - } - if (s[i] != "%" || i+1 == m) { - // normal char or % at the end of the string - parseNextUnicodePoint(isChosenBlock); - continue; - } - - // keep only the substring after the % - i++; s = s.substr(i); m -= i; i = 0; - - // %INTEGER argument substitution - if (parseArgument(isChosenBlock)) continue; - - // %{INTEGER} escaped integer - if (parseInteger(isChosenBlock)) continue; - - // %CHAR: escaped character - parseNextUnicodePoint(isChosenBlock); - continue; - } - - if (!blockFound) { - i = 0; - return false; - } - - return true; - } - - function transformString(string) - { - s = string; - i = 0; - m = s.length; - resultString = ""; - resultArray = []; - - while (i < m) { - if (s[i] != "%" || i+1 == m) { - // normal char or % at the end of the string - parseNextUnicodePoint(true); - continue; - } - - // keep only the substring after the % - i++; s = s.substr(i); m -= i; i = 0; - - // %INTEGER argument substitution - if (parseArgument(true)) continue; - - // %{INTEGER} escaped integer - if (parseInteger(true)) continue; - - // %\{plural:%INTEGER|form1|form2 ... \} plural forms - if (parseChoiceBlock("plural", locale.plural)) continue; - - // %CHAR: escaped character - parseNextUnicodePoint(true); - continue; - } - - if (resultArray.length == 0) return resultString; - - return resultArray; - } - - function transformHTMLSnippet(snippet) - { - for (var key in snippet) { - var e = snippet[key]; - if (typeof e === "string") { - // transform the string content - snippet[key] = transformString(e); - continue; - } - if (e[1]) { - // transform attribute values - for (var key2 in e[1]) { - snippet[key][1][key2] = transformString(e[1][key2]); - } - } - if (e[2]) { - // transform the HTML content - snippet[key][2] = transformHTMLSnippet(e[2]); - } - } - return snippet; - } - - // try to get the translated phrase or use the englishPhrase fallback - var phrase = englishPhrase; - var translationData = this.strings[this.locale]; - if (translationData) { - if (translationData.isLoaded) { - var domain = "_"; - if (messageId instanceof Array && messageId.length == 2) { - domain = messageId[0]; - messageId = messageId[1]; - } - if (domain in translationData.domains) { - domain = translationData.domains[domain] - if (domain.isLoaded && messageId in domain.strings) { - phrase = domain.strings[messageId]; - } - } - } - } - - if (typeof phrase === "string") { - // handle the phrase as a simple string - return transformString(phrase); - } - - // handle the phrase as a HTML snippet - return transformHTMLSnippet(phrase); - }, - - setLocale: function(locale) { - this.locale = locale; - this.plural = this.strings[locale].plural; - this.number = this.strings[locale].number; - // TODO - }, - - addTranslation: function (locale, domain, definition) { - // TODO - }, - - fontFamily: function () { - return null; - }, - - plural: function(n) { - if (n == 1) return 1; // one - return 2; // other - }, - - number: function(n) { - return n; - } -}; diff --git a/unpacked/config/Accessible-full.js b/unpacked/config/Accessible-full.js index 4aa8b06c2..b1e5bed3b 100644 --- a/unpacked/config/Accessible-full.js +++ b/unpacked/config/Accessible-full.js @@ -24,8 +24,8 @@ MathJax.Hub.Config({ mpMouse: true }, errorSettings: { - // Localization: should be updated when the language is changed - message: ["["+MathJax.Localization._("MathError", "Math Error")+"]"] + message: ["[Math Error]"], + messageId: "MathErrorHTML" } }); diff --git a/unpacked/config/Accessible.js b/unpacked/config/Accessible.js index 384c60102..41a2820e6 100644 --- a/unpacked/config/Accessible.js +++ b/unpacked/config/Accessible.js @@ -24,8 +24,8 @@ MathJax.Hub.Config({ mpMouse: true }, errorSettings: { - // Localization: should be updated when the language is changed - message: ["["+MathJax.Localization._("MathError", "Math Error")+"]"] + message: ["[Math Error]"], + messageId: "MathErrorHTML" } }); diff --git a/unpacked/config/MMLorHTML.js b/unpacked/config/MMLorHTML.js index 124d4cc7c..623acfea0 100644 --- a/unpacked/config/MMLorHTML.js +++ b/unpacked/config/MMLorHTML.js @@ -98,9 +98,9 @@ HUB.PreProcess.disabled = true; HUB.prepareScripts.disabled = true; MathJax.Message.Set( - MathJax.Localization._(["Message", MathJaxNotSupported], - "Your browser does not support MathJax"), - null,4000); + ["MathJaxNotSupported","Your browser does not support MathJax"], + null,4000 + ); HUB.Startup.signal.Post("MathJax not supported"); } }); diff --git a/unpacked/config/default.js b/unpacked/config/default.js index 008f00f31..06f1cc5a3 100644 --- a/unpacked/config/default.js +++ b/unpacked/config/default.js @@ -236,10 +236,8 @@ MathJax.Hub.Config({ // jax that prevents it from operating properly). // errorSettings: { - // Localization: - // TODO - // should be updated when the language is changed - message: ["[MathProcessingError]"], // HTML snippet structure for message to use + message: ["[Math Processing Error]"], // HTML snippet structure for message to use + messageId: "MathProcessingError", // ID of snippet for localization style: {color: "#CC0000", "font-style":"italic"} // style for message }, diff --git a/unpacked/extensions/FontWarnings.js b/unpacked/extensions/FontWarnings.js index a1cf936e2..3da586a33 100644 --- a/unpacked/extensions/FontWarnings.js +++ b/unpacked/extensions/FontWarnings.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/extensions/FontWarnings.js @@ -85,11 +86,11 @@ */ (function (HUB,HTML) { - var VERSION = "2.1"; + var VERSION = "2.1.1"; var _ = function (id) { return MathJax.Localization._.apply(MathJax.Localization, - [ ["FontWarnings",id] ].concat([].slice.call(arguments,1)) + [["FontWarnings",id]].concat([].slice.call(arguments,1)) ); } @@ -194,7 +195,7 @@ ], fonts: _("fonts", - "%1 MathJax can use either the %2 or the % "+ + "%1 MathJax can use either the %2 or the %3 "+ ". Download and install either one to improve your MathJax experience.", [["p"]], [["a",{href:"http://www.stixfonts.org/",target:"_blank"}, diff --git a/unpacked/extensions/MathEvents.js b/unpacked/extensions/MathEvents.js index 54b9119a2..074b057a2 100644 --- a/unpacked/extensions/MathEvents.js +++ b/unpacked/extensions/MathEvents.js @@ -22,8 +22,8 @@ * limitations under the License. */ -(function (HUB,HTML,AJAX,CALLBACK,OUTPUT,INPUT) { - var VERSION = "2.1"; +(function (HUB,HTML,AJAX,CALLBACK,LOCALE,OUTPUT,INPUT) { + var VERSION = "2.1.1"; var EXTENSION = MathJax.Extension; var ME = EXTENSION.MathEvents = {version: VERSION}; @@ -141,33 +141,46 @@ } // - // If the menu code is loaded, post the menu - // Otherwse lad the menu code and try again + // If the menu code is loaded, + // Check if localization needs loading; + // If not, post the menu, and return. + // Otherwise wait for the localization to load + // Otherwse load the menu code. + // Try again after the file is loaded. // - var MENU = MathJax.Menu; + var MENU = MathJax.Menu; var load, fn; if (MENU) { - MENU.jax = jax; - var source = MENU.menu.Find("Show Math As").menu; - source.items[1].name = (INPUT[jax.inputJax].sourceMenuTitle||"Original Form"); - source.items[0].hidden = (jax.inputJax === "Error"); // hide MathML choice for error messages - var MathPlayer = MENU.menu.Find("Math Settings","MathPlayer"); - MathPlayer.hidden = !(jax.outputJax === "NativeMML" && HUB.Browser.hasMathPlayer); - return MENU.menu.Post(event); - } else { - if (!AJAX.loadingMathMenu) { - AJAX.loadingMathMenu = true; - var ev = { - pageX:event.pageX, pageY:event.pageY, - clientX:event.clientX, clientY:event.clientY - }; - CALLBACK.Queue( - AJAX.Require("[MathJax]/extensions/MathMenu.js"), - function () {delete AJAX.loadingMathMenu; if (!MathJax.Menu) {MathJax.Menu = {}}}, - ["ContextMenu",this,ev,math,force] // call this function again - ); + if (MENU.loadingDomain) {return EVENT.False(event)} + load = LOCALE.loadDomain("MathMenu"); + if (!load) { + MENU.jax = jax; + var source = MENU.menu.Find("Show Math As").menu; + source.items[1].name = INPUT[jax.inputJax].sourceMenuTitle; + source.items[0].hidden = (jax.inputJax === "Error"); // hide MathML choice for error messages + var MathPlayer = MENU.menu.Find("Math Settings","MathPlayer"); + MathPlayer.hidden = !(jax.outputJax === "NativeMML" && HUB.Browser.hasMathPlayer); + return MENU.menu.Post(event); + } + MENU.loadingDomain = true; + fn = function () {delete MENU.loadingDomain}; + } else { + if (AJAX.loadingMathMenu) {return EVENT.False(event)} + AJAX.loadingMathMenu = true; + load = AJAX.Require("[MathJax]/extensions/MathMenu.js"); + fn = function () { + delete AJAX.loadingMathMenu; + if (!MathJax.Menu) {MathJax.Menu = {}} } - return EVENT.False(event); } + var ev = { + pageX:event.pageX, pageY:event.pageY, + clientX:event.clientX, clientY:event.clientY + }; + CALLBACK.Queue( + load, fn, // load the file and delete the marker when done + ["ContextMenu",EVENT,ev,math,force] // call this function again + ); + return EVENT.False(event); }, // @@ -530,4 +543,5 @@ ["loadComplete",AJAX,"[MathJax]/extensions/MathEvents.js"] ); -})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.Callback,MathJax.OutputJax,MathJax.InputJax); +})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.Callback, + MathJax.Localization,MathJax.OutputJax,MathJax.InputJax); diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index f83d5a11a..d619ee3ee 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/extensions/MathMenu.js @@ -26,7 +27,7 @@ */ (function (HUB,HTML,AJAX,CALLBACK,OUTPUT) { - var VERSION = "2.1"; + var VERSION = "2.1.1"; var SIGNAL = MathJax.Callback.Signal("menu") // signal for menu events @@ -38,7 +39,7 @@ var _ = function (id) { return MathJax.Localization._.apply( MathJax.Localization, - [ ["Menu", id] ].concat([].slice.call(arguments,1)) + [["MathMenu",id]].concat([].slice.call(arguments,1)) ); }; @@ -184,7 +185,6 @@ */ Post: function (event,parent) { if (!event) {event = window.event}; - var title = (!this.title ? null : [["div",{className: "MathJax_MenuTitle"},[this.title]]]); var div = document.getElementById("MathJax_MenuFrame"); if (!div) { div = MENU.Background(this); @@ -196,7 +196,8 @@ onmouseup: MENU.Mouseup, ondblclick: FALSE, ondragstart: FALSE, onselectstart: FALSE, oncontextmenu: FALSE, menuItem: this, className: "MathJax_Menu" - },title); + }); + MathJax.Localization.setCSS(menu); for (var i = 0, m = this.items.length; i < m; i++) {this.items[i].Create(menu)} if (MENU.isMobile) { @@ -260,16 +261,17 @@ }, /* - * Find a named item in a menu (or submenu). - * A list of names means descend into submenus. + * Find an item in a menu (or submenu) by name (Find) or ID (FindID). + * A list of names or IDs means descend into submenus. */ - Find: function (name) { - var names = [].slice.call(arguments,1); + Find: function (name) {return this.FindN(1,name,[].slice.call(arguments,1))}, + FindId: function (name) {return this.FindN(0,name,[].slice.call(arguments,1))}, + FindN: function (n,name,names) { for (var i = 0, m = this.items.length; i < m; i++) { - if (this.items[i].name === name) { + if (this.items[i].name[n] === name) { if (names.length) { if (!this.items[i].menu) {return null} - return this.items[i].menu.Find.apply(this.items[i].menu,names); + return this.items[i].menu.FindN(n,names[0],names.slice(1)); } return this.items[i]; } @@ -280,9 +282,11 @@ /* * Find the index of a menu item (so we can insert before or after it) */ - IndexOf: function (name) { + IndexOf: function (name) {return this.IndexOfN(1,name)}, + IndexOfId: function (name) {return this.IndexOfN(0,name)}, + IndexOfN: function (n,name) { for (var i = 0, m = this.items.length; i < m; i++) - {if (this.items[i].name === name) {return i}} + {if (this.items[i].name[n] === name) {return i}} return null; } @@ -370,7 +374,7 @@ * The menu item root subclass */ var ITEM = MENU.ITEM = MathJax.Object.Subclass({ - name: "", // the menu item's label + name: "", // the menu item's label as [id,label] pair Create: function (menu) { if (!this.hidden) { @@ -385,6 +389,7 @@ HTML.addElement(menu,"div",def,this.Label(def,menu)); } }, + Name: function () {return _(this.name[0],this.name[1])}, Mouseover: function (event,menu) { if (!this.disabled) {this.Activate(menu)} @@ -442,11 +447,12 @@ action: function () {}, Init: function (name,action,def) { + if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair this.name = name; this.action = action; this.With(def); }, - Label: function (def,menu) {return [this.name]}, + Label: function (def,menu) {return [this.Name()]}, Mouseup: function (event,menu) { if (!this.disabled) { this.Remove(event,menu); @@ -466,13 +472,14 @@ marker: (isPC && !HUB.Browser.isSafari ? "\u25B6" : "\u25B8"), // the menu arrow Init: function (name,def) { + if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair this.name = name; var i = 1; if (!(def instanceof MENU.ITEM)) {this.With(def), i++} this.menu = MENU.apply(MENU,[].slice.call(arguments,i)); }, Label: function (def,menu) { this.menu.posted = false; - return [this.name+" ",["span",{className:"MathJax_MenuArrow"},[this.marker]]]; + return [this.Name()+" ",["span",{className:"MathJax_MenuArrow"},[this.marker]]]; }, Timer: function (event,menu) { if (this.timer) {clearTimeout(this.timer)} @@ -515,13 +522,14 @@ marker: (isPC ? "\u25CF" : "\u2713"), // the checkmark Init: function (name,variable,def) { + if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair this.name = name; this.variable = variable; this.With(def); - if (this.value == null) {this.value = this.name} + if (this.value == null) {this.value = this.name[0]} }, Label: function (def,menu) { var span = {className:"MathJax_MenuRadioCheck"}; if (CONFIG.settings[this.variable] !== this.value) {span = {style:{display:"none"}}} - return [["span",span,[this.marker]]," "+this.name]; + return [["span",span,[this.marker]]," "+this.Name()]; }, Mouseup: function (event,menu) { if (!this.disabled) { @@ -551,12 +559,13 @@ marker: "\u2713", // the checkmark Init: function (name,variable,def) { + if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair this.name = name; this.variable = variable; this.With(def); }, Label: function (def,menu) { var span = {className:"MathJax_MenuCheck"}; if (!CONFIG.settings[this.variable]) {span = {style:{display:"none"}}} - return [["span",span,[this.marker]]," "+this.name]; + return [["span",span,[this.marker]]," "+this.Name()]; }, Mouseup: function (event,menu) { if (!this.disabled) { @@ -576,11 +585,14 @@ * A menu item that is a label */ MENU.ITEM.LABEL = MENU.ITEM.Subclass({ - Init: function (name,def) {this.name = name; this.With(def)}, + Init: function (name,def) { + if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair + this.name = name; this.With(def); + }, Label: function (def,menu) { delete def.onmouseover, delete def.onmouseout; delete def.onmousedown; def.className += " MathJax_MenuLabel"; - return [this.name]; + return [this.Name()]; } }); @@ -604,36 +616,33 @@ */ // Localization: need to be reorganized. currently, there are concatenation // of HTMLCSS.fontInUse and English strings based on the values of - // HTMLCSS.webFonts and HTMLCSS.imgFonts, HTMLCSS.allowWebFonts etc Update - // MENU.About.GetJax too. + // HTMLCSS.webFonts and HTMLCSS.imgFonts, HTMLCSS.allowWebFonts etc MENU.About = function () { - var HTMLCSS = OUTPUT["HTML-CSS"] || {fontInUse: ""}; - var local = (HTMLCSS.webFonts ? "" : "local "), web = (HTMLCSS.webFonts ? " web" : ""); - var font = (HTMLCSS.imgFonts ? "Image" : local+HTMLCSS.fontInUse+web) + " fonts"; - if (font === "local fonts" && OUTPUT.SVG) {font = "web SVG fonts"} + var HTMLCSS = OUTPUT["HTML-CSS"] || {}; + var font = + (HTMLCSS.imgFonts ? "image" : + (HTMLCSS.fontInUse ? + (HTMLCSS.webFonts ? "web" : "local")+" "+HTMLCSS.fontInUse : + (OUTPUT.SVG ? "web SVG" : "generic")) ) + " fonts"; + var format = (!HTMLCSS.webFonts || HTMLCSS.imgFonts ? null : + HTMLCSS.allowWebFonts.replace(/otf/,"woff or otf") + " fonts"); var jax = ["MathJax.js v"+MathJax.fileversion,["br"]]; jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}]); - MENU.About.GetJax(jax,MathJax.InputJax,"Input Jax"); - MENU.About.GetJax(jax,MathJax.OutputJax,"Output Jax"); - MENU.About.GetJax(jax,MathJax.ElementJax,"Element Jax"); + MENU.About.GetJax(jax,MathJax.InputJax,_("InputJax","Input Jax")); + MENU.About.GetJax(jax,MathJax.OutputJax,_("OutputJax","Output Jax")); + MENU.About.GetJax(jax,MathJax.ElementJax,_("ElementJax","Element Jax")); jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}]); - MENU.About.GetJax(jax,MathJax.Extension,"Extension",true); + MENU.About.GetJax(jax,MathJax.Extension,_("Extension","Extension"),true); jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}],["center",{},[ - HUB.Browser + " v"+HUB.Browser.version + - (HTMLCSS.webFonts && !HTMLCSS.imgFonts ? " \u2014 " + - HTMLCSS.allowWebFonts.replace(/otf/,"woff or otf") + " fonts" : "") + HUB.Browser + " v"+HUB.Browser.version + (format ? + " \u2014 " + _(format.replace(/ /g,""),format) : "") ]]); - // Localization: - // - decide HTML snippet format - // - how do we ensure it is updated when the language is changed? MENU.About.div = MENU.Background(MENU.About); var about = HTML.addElement(MENU.About.div,"div",{ id: "MathJax_About" - }, - _("AboutBox", "%1 using %2", - [["b",{style:{fontSize:"120%"}},["MathJax"]], - " v"+MathJax.version,["br"]], - [font,["br"],["br"], + },[ + ["b",{style:{fontSize:"120%"}},["MathJax"]]," v"+MathJax.version,["br"], + _(font.replace(/ /g,""),"using "+font),["br"],["br"], ["span",{style:{ display:"inline-block", "text-align":"left", "font-size":"80%", "max-height":"20em", overflow:"auto", @@ -644,8 +653,9 @@ src: CONFIG.closeImg, style: {width:"21px", height:"21px", position:"absolute", top:".2em", right:".2em"}, onclick: MENU.About.Remove - }]]) - ); + }] + ]); + MathJax.Localization.setCSS(about); var doc = (document.documentElement||{}); var H = window.innerHeight || doc.clientHeight || doc.scrollHeight || 0; if (MENU.prototype.msieAboutBug) { @@ -709,7 +719,7 @@ } } else { if (MENU.jax.originalText == null) { - alert(_("NoOriginalForm", "No original form available")); + alert(_("NoOriginalForm","No original form available")); return; } MENU.ShowSource.Text(MENU.jax.originalText,event); @@ -727,12 +737,12 @@ var w = MENU.ShowSource.Window(event); delete MENU.ShowSource.w; text = text.replace(/^\s*/,"").replace(/\s*$/,""); text = text.replace(/&/g,"&").replace(//g,">"); - var title = _("EqSource", "MathJax Equation Source"); + var title = _("EqSource","MathJax Equation Source"); if (MENU.isMobile) { w.document.open(); w.document.write(""+title+""); w.document.write("
"+text+"
"); - w.document.write("
"); + w.document.write("
"); w.document.write(""); w.document.close(); } else { @@ -774,7 +784,7 @@ MENU.cookie.scale = scale; MENU.saveCookie(); HUB.Reprocess(); } - } else {alert(_("NonZeroScale", "The scale should not be zero"))} + } else {alert(_("NonZeroScale","The scale should not be zero"))} } else {alert(_("PercentScale", "The scale should be a percentage (e.g., 120%%)"))} } @@ -800,7 +810,8 @@ switch (CONFIG.settings.renderer) { case "NativeMML": if (!CONFIG.settings.warnedMML) { - if (BROWSER.isChrome || (BROWSER.isSafari && !BROWSER.versionAtLeast("5.0"))) {message = MESSAGE.MML.WebKit} + if (BROWSER.isChrome && BROWSER.version.substr(0,3) !== "24.") {message = MESSAGE.MML.WebKit} + else if (BROWSER.isSafari && !BROWSER.versionAtLeast("5.0")) {message = MESSAGE.MML.WebKit} else if (BROWSER.isMSIE) {if (!BROWSER.hasMathPlayer) {message = MESSAGE.MML.MSIE}} else {message = MESSAGE.MML[BROWSER]} warned = "warnedMML"; @@ -814,7 +825,7 @@ break; } if (message) { - // Localization: concatenation, new line + message = _(message[0],message[1]); message += "\n\n"; message += _("SwitchAnyway", "Switch the renderer anyway?\n\n" + @@ -831,36 +842,34 @@ }; MENU.Renderer.Messages = { MML: { - // Localization: should be updated when the language is changed - // concatenation - WebKit: _("WebkitNativeMMLWarning", + WebKit: ["WebkitNativeMMLWarning", "Your browser doesn't seem to support MathML natively, " + "so switching to MathML output may cause the mathematics " + - "on the page to become unreadable."), + "on the page to become unreadable."], - MSIE: _("MSIENativeMMLWarning", + MSIE: ["MSIENativeMMLWarning", "Internet Explorer requires the MathPlayer plugin " + - "in order to process MathML output."), + "in order to process MathML output."], - Opera: _("OperaNativeMMLWarning", + Opera: ["OperaNativeMMLWarning", "Opera's support for MathML is limited, so switching to " + - "MathML output may cause some expressions to render poorly."), + "MathML output may cause some expressions to render poorly."], - Safari: _("SafariNativeMMLWarning", + Safari: ["SafariNativeMMLWarning", "Your browser's native MathML does not implement all the features " + - "used by MathJax, so some expressions may not render properly."), + "used by MathJax, so some expressions may not render properly."], - Firefox: _("FirefoxNativeMMLWarning", + Firefox: ["FirefoxNativeMMLWarning", "Your browser's native MathML does not implement all the features " + - "used by MathJax, so some expressions may not render properly.") + "used by MathJax, so some expressions may not render properly."] }, SVG: { - MSIE: _("MSIESVGWarning", + MSIE: ["MSIESVGWarning", "SVG is not implemented in Internet Explorer prior to " + "IE9, or when the browser is emulating IE8 or below. " + "Switching to SVG output will cause the mathemtics to " + - "not display properly.") + "not display properly."] } }; @@ -879,7 +888,7 @@ var discoverable = CONFIG.settings.discoverable, MESSAGE = MENU.MPEvents.Messages; if (!isIE9) { - if (CONFIG.settings.mpMouse && !confirm(MESSAGE.IE8warning)) { + if (CONFIG.settings.mpMouse && !confirm(_.apply(_,MESSAGE.IE8warning))) { delete MENU.cookie.mpContext; delete CONFIG.settings.mpContext; delete MENU.cookie.mpMouse; delete CONFIG.settings.mpMouse; MENU.saveCookie(); @@ -889,23 +898,20 @@ MENU.cookie.mpContext = MENU.cookie.mpMouse = CONFIG.settings.mpMouse; MENU.saveCookie(); MathJax.Hub.Queue(["Rerender",MathJax.Hub]) - } else if (!discoverable && item.name === "Menu Events" && CONFIG.settings.mpContext) { - alert(MESSAGE.IE9warning); + } else if (!discoverable && item.name[0] === "Menu Events" && CONFIG.settings.mpContext) { + alert(_.apply(_,MESSAGE.IE9warning)); } }; - // Localization: should be updated when the language is changed - // concatenation + MENU.MPEvents.Messages = { - IE8warning: - _("IE8warning", + IE8warning: ["IE8warning", "This will disable the MathJax menu and zoom features, " + "but you can Alt-Click on an expression to obtain the MathJax " + - "menu instead.\n\nReally change the MathPlayer settings?"), + "menu instead.\n\nReally change the MathPlayer settings?"], - IE9warning: - _("IE9warning", + IE9warning: ["IE9warning", "The MathJax contextual menu will be disabled, but you can " + - "Alt-Click on an expression to obtain the MathJax menu instead.") + "Alt-Click on an expression to obtain the MathJax menu instead."] }; /*************************************************************/ @@ -954,27 +960,27 @@ */ // Localization: items used as key, should be refactored. MENU.menu = MENU( - ITEM.SUBMENU("Show Math As", - ITEM.COMMAND("MathML Code", MENU.ShowSource, {nativeTouch: true, format: "MathML"}), - ITEM.COMMAND("Original Form", MENU.ShowSource, {nativeTouch: true}), + ITEM.SUBMENU(["Show","Show Math As"], + ITEM.COMMAND(["MathMLcode","MathML Code"], MENU.ShowSource, {nativeTouch: true, format: "MathML"}), + ITEM.COMMAND(["Original","Original Form"], MENU.ShowSource, {nativeTouch: true}), ITEM.RULE(), - ITEM.CHECKBOX("Show TeX hints in MathML", "texHints") + ITEM.CHECKBOX(["texHints","Show TeX hints in MathML"], "texHints") ), ITEM.RULE(), - ITEM.SUBMENU("Math Settings", - ITEM.SUBMENU("Zoom Trigger", - ITEM.RADIO("Hover", "zoom", {action: MENU.Zoom}), - ITEM.RADIO("Click", "zoom", {action: MENU.Zoom}), - ITEM.RADIO("Double-Click", "zoom", {action: MENU.Zoom}), - ITEM.RADIO("No Zoom", "zoom", {value: "None"}), + ITEM.SUBMENU(["Settings","Math Settings"], + ITEM.SUBMENU(["ZoomTrigger","Zoom Trigger"], + ITEM.RADIO(["Hover","Hover"], "zoom", {action: MENU.Zoom}), + ITEM.RADIO(["Click","Click"], "zoom", {action: MENU.Zoom}), + ITEM.RADIO(["DoubleClick","Double-Click"], "zoom", {action: MENU.Zoom}), + ITEM.RADIO(["NoZoom","No Zoom"], "zoom", {value: "None"}), ITEM.RULE(), - ITEM.LABEL("Trigger Requires:"), - ITEM.CHECKBOX((HUB.Browser.isMac ? "Option" : "Alt"), "ALT"), - ITEM.CHECKBOX("Command", "CMD", {hidden: !HUB.Browser.isMac}), - ITEM.CHECKBOX("Control", "CTRL", {hidden: HUB.Browser.isMac}), - ITEM.CHECKBOX("Shift", "Shift") + ITEM.LABEL(["TriggerRequires","Trigger Requires:"]), + ITEM.CHECKBOX((HUB.Browser.isMac ? ["Option","Option"] : ["Alt","Alt"]), "ALT"), + ITEM.CHECKBOX(["Command","Command"], "CMD", {hidden: !HUB.Browser.isMac}), + ITEM.CHECKBOX(["Control","Control"], "CTRL", {hidden: HUB.Browser.isMac}), + ITEM.CHECKBOX(["Shift","Shift"], "Shift") ), - ITEM.SUBMENU("Zoom Factor", + ITEM.SUBMENU(["ZoomFactor","Zoom Factor"], ITEM.RADIO("125%", "zscale"), ITEM.RADIO("133%", "zscale"), ITEM.RADIO("150%", "zscale"), @@ -985,40 +991,39 @@ ITEM.RADIO("400%", "zscale") ), ITEM.RULE(), - ITEM.SUBMENU("Math Renderer", {hidden:!CONFIG.showRenderer}, + ITEM.SUBMENU(["Renderer","Math Renderer"], {hidden:!CONFIG.showRenderer}, ITEM.RADIO("HTML-CSS", "renderer", {action: MENU.Renderer}), ITEM.RADIO("MathML", "renderer", {action: MENU.Renderer, value:"NativeMML"}), ITEM.RADIO("SVG", "renderer", {action: MENU.Renderer}) ), - ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE || - !CONFIG.showMathPlayer, - disabled:!HUB.Browser.hasMathPlayer}, - ITEM.LABEL("Let MathPlayer Handle:"), - ITEM.CHECKBOX("Menu Events", "mpContext", {action: MENU.MPEvents, hidden:!isIE9}), - ITEM.CHECKBOX("Mouse Events", "mpMouse", {action: MENU.MPEvents, hidden:!isIE9}), - ITEM.CHECKBOX("Mouse and Menu Events", "mpMouse", {action: MENU.MPEvents, hidden:isIE9}) + ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE || !CONFIG.showMathPlayer, + disabled:!HUB.Browser.hasMathPlayer}, + ITEM.LABEL(["MPHandles","Let MathPlayer Handle:"]), + ITEM.CHECKBOX(["MenuEvents","Menu Events"], "mpContext", {action: MENU.MPEvents, hidden:!isIE9}), + ITEM.CHECKBOX(["MouseEvents","Mouse Events"], "mpMouse", {action: MENU.MPEvents, hidden:!isIE9}), + ITEM.CHECKBOX(["MenuAndMouse","Mouse and Menu Events"], "mpMouse", {action: MENU.MPEvents, hidden:isIE9}) ), - ITEM.SUBMENU("Font Preference", {hidden:!CONFIG.showFontMenu}, - ITEM.LABEL("For HTML-CSS:"), - ITEM.RADIO("Auto", "font", {action: MENU.Font}), + ITEM.SUBMENU(["FontPrefs","Font Preference"], {hidden:!CONFIG.showFontMenu}, + ITEM.LABEL(["ForHTMLCSS","For HTML-CSS:"]), + ITEM.RADIO(["Auto","Auto"], "font", {action: MENU.Font}), ITEM.RULE(), - ITEM.RADIO("TeX (local)", "font", {action: MENU.Font}), - ITEM.RADIO("TeX (web)", "font", {action: MENU.Font}), - ITEM.RADIO("TeX (image)", "font", {action: MENU.Font}), + ITEM.RADIO(["TeXLocal","TeX (local)"], "font", {action: MENU.Font}), + ITEM.RADIO(["TeXWeb","TeX (web)"], "font", {action: MENU.Font}), + ITEM.RADIO(["TeXImage","TeX (image)"], "font", {action: MENU.Font}), ITEM.RULE(), - ITEM.RADIO("STIX (local)", "font", {action: MENU.Font}) + ITEM.RADIO(["STIXlocal","STIX (local)"], "font", {action: MENU.Font}) ), - ITEM.SUBMENU("Contextual Menu", {hidden:!CONFIG.showContext}, + ITEM.SUBMENU(["ContextMenu","Contextual Menu"], {hidden:!CONFIG.showContext}, ITEM.RADIO("MathJax", "context"), - ITEM.RADIO("Browser", "context") + ITEM.RADIO(["Browser","Browser"], "context") ), - ITEM.COMMAND("Scale All Math ...",MENU.Scale), - ITEM.RULE().With({hidden:!CONFIG.showDiscoverable, name:"discover_rule"}), - ITEM.CHECKBOX("Highlight on Hover", "discoverable", {hidden:!CONFIG.showDiscoverable}) + ITEM.COMMAND(["Scale","Scale All Math ..."],MENU.Scale), + ITEM.RULE().With({hidden:!CONFIG.showDiscoverable, name:["","discover_rule"]}), + ITEM.CHECKBOX(["Discoverable","Highlight on Hover"], "discoverable", {hidden:!CONFIG.showDiscoverable}) ), ITEM.RULE(), - ITEM.COMMAND("About MathJax",MENU.About), - ITEM.COMMAND("MathJax Help",MENU.Help) + ITEM.COMMAND(["About","About MathJax"],MENU.About), + ITEM.COMMAND(["Help","MathJax Help"],MENU.Help) ); if (MENU.isMobile) { diff --git a/unpacked/extensions/TeX/AMSmath.js b/unpacked/extensions/TeX/AMSmath.js index 133f35464..c5bc4ce86 100644 --- a/unpacked/extensions/TeX/AMSmath.js +++ b/unpacked/extensions/TeX/AMSmath.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/extensions/TeX/AMSmath.js @@ -24,7 +25,7 @@ */ MathJax.Extension["TeX/AMSmath"] = { - version: "2.1", + version: "2.1.1", number: 0, // current equation number startNumber: 0, // current starting equation number (for when equation is restarted) @@ -162,15 +163,12 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (!star) {arg = CONFIG.formatTag(arg)} var global = this.stack.global; global.tagID = tag; if (global.notags) { - TEX.Error(MathJax.Localization._(["TeX", "CommandNotAllowedInEnv"], - "%1 not allowed in %2 environment", - name, global.notags) - ) - } - if (global.tag) { - TEX.Error(MathJax.Localization._(["TeX", "MultipleCommand"], - "Multiple %1", name)) + TEX.Error(["CommandNotAllowedInEnv", + "%1 not allowed in %2 environment", + name,global.notags] + ); } + if (global.tag) {TEX.Error(["MultipleCommand","Multiple %1",name])} global.tag = MML.mtd.apply(MML,this.InternalMath(arg)).With({id:CONFIG.formatID(tag)}); }, HandleNoTag: function (name) { @@ -185,16 +183,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { var global = this.stack.global, label = this.GetArgument(name); if (label === "") return; if (!AMS.refUpdate) { - if (global.label) { - TEX.Error(MathJax.Localization._(["TeX", "MultipleCommand"], - "Multiple %1", name)) - } + if (global.label) {TEX.Error(["MultipleCommand","Multiple %1",name])} global.label = label; - if (AMS.labels[label] || AMS.eqlabels[label]) { - TEX.Error(MathJax.Localization._(["TeX", "MultipleLabel"], - "Label '%1' mutiply defined", - label) - } + if (AMS.labels[label] || AMS.eqlabels[label]) + {TEX.Error(["MultipleLabel","Label '%1' mutiply defined",label])} AMS.eqlabels[label] = "???"; // will be replaced by tag value later } }, @@ -239,8 +231,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { HandleShove: function (name,shove) { var top = this.stack.Top(); if (top.type !== "multline" || top.data.length) { - TEX.Error(MathJax.Localization._(["TeX", "CommandAtTheBeginingOfLine", - "%1 must come at the beginning of the line")) + TEX.Error(["CommandAtTheBeginingOfLine", + "%1 must come at the beginning of the line",name]); } top.data.shove = shove; }, @@ -255,11 +247,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { var frac = MML.mfrac(TEX.Parse('\\strut\\textstyle{'+num+'}',this.stack.env).mml(), TEX.Parse('\\strut\\textstyle{'+den+'}',this.stack.env).mml()); lr = ({l:MML.ALIGN.LEFT, r:MML.ALIGN.RIGHT,"":""})[lr]; - if (lr == null) { - TEX.Error(MathJax.Localization._(["TeX", "IllegalAlign"], - "Illegal alignment specified in %1", - name)) - } + if (lr == null) + {TEX.Error(["IllegalAlign","Illegal alignment specified in %1",name])} if (lr) {frac.numalign = frac.denomalign = lr} this.Push(frac); }, @@ -279,10 +268,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (left || right) {frac = MML.mfenced(frac).With({open: left, close: right})} if (style !== "") { var STYLE = (["D","T","S","SS"])[style]; - if (STYLE == null) { - TEX.Error(MathJax.Localization._(["TeX", "BadMathStyleFor"], - "Bad math style for %1", name) - } + if (STYLE == null) + {TEX.Error(["BadMathStyleFor","Bad math style for %1",name])} frac = MML.mstyle(frac); if (STYLE === "D") {frac.displaystyle = true; frac.scriptlevel = 0} else {frac.displaystyle = false; frac.scriptlevel = style - 1} @@ -334,9 +321,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (!taggable) {valign = this.GetBrackets("\\begin{"+begin.name+"}")} n = this.GetArgument("\\begin{"+begin.name+"}"); if (n.match(/[^0-9]/)) { - TEX.Error(MathJax.Localization._(["TeX", "PositiveIntegerArg"], - "Argument to %1 must me a positive integer"), - "\\begin{"+begin.name+"}") + TEX.Error(["PositiveIntegerArg","Argument to %1 must me a positive integer", + "\\begin{"+begin.name+"}"]); } while (n > 0) {align += "rl"; spacing.push("0em 0em"); n--} spacing = spacing.join(" "); @@ -362,12 +348,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { * Check for bad nesting of equation environments */ checkEqnEnv: function () { - if (this.stack.global.eqnenv) { - TEX.Error( - MathJax.Localization._(["TeX", "ErroneousNestingEq"], - "Erroneous nesting of equation structures") - ) - } + if (this.stack.global.eqnenv) + {TEX.Error(["ErroneousNestingEq","Erroneous nesting of equation structures"])} this.stack.global.eqnenv = true; }, @@ -413,9 +395,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { var c = this.trimSpaces(this.GetArgument(name)); if (c == "") {return null} if (TEXDEF.delimiter[c] == null) { - TEX.Error(MathJax.Localization._(["TeX", - "MissingOrUnrecognizedDelim"], - "Missing or unrecognized delimiter for %1", name)) + TEX.Error(["MissingOrUnrecognizedDelim", + "Missing or unrecognized delimiter for %1",name]); } return this.convertDelimiter(c); }, @@ -479,10 +460,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { }, EndRow: function () { if (this.row.length != 1) { - TEX.Error( - MathJax.Localization._(["TeX", "MultipleRowsOneCol"], - "multline rows must have exactly one column") - ) + TEX.Error(["MultipleRowsOneCol", + "multline rows must have exactly one column"]); } this.table.push(this.row); this.row = []; }, diff --git a/unpacked/extensions/TeX/bbox.js b/unpacked/extensions/TeX/bbox.js index d30026d24..86fdc2018 100644 --- a/unpacked/extensions/TeX/bbox.js +++ b/unpacked/extensions/TeX/bbox.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/extensions/TeX/bbox.js @@ -45,7 +46,7 @@ */ MathJax.Extension["TeX/bbox"] = { - version: "2.1" + version: "2.1.1" }; MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { @@ -64,39 +65,24 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { var part = parts[i].replace(/^\s+/,'').replace(/\s+$/,''); var match = part.match(/^(\.\d+|\d+(\.\d*)?)(pt|em|ex|mu|px|in|cm|mm)$/); if (match) { + if (def) + {TEX.Error(["MultipleBBoxProperty","%1 specified twice in %2","Padding",name])} var pad = match[1]+match[3]; - if (def) { - TEX.Error( - MathJax.Localization._( - ["TeX", "MultipleBboxProperty"], - "%1 specified twice in %2", "Padding", name) - ) - } def = {height:"+"+pad, depth:"+"+pad, lspace:pad, width:"+"+(2*match[1])+match[3]}; } else if (part.match(/^([a-z0-9]+|\#[0-9a-f]{6}|\#[0-9a-f]{3})$/i)) { - if (background) { - TEX.Error( - MathJax.Localization._( - ["TeX", "MultipleBboxProperty"], - "%1 specified twice in %2", "Background", name) - ) - } + if (background) + {TEX.Error(["MultipleBBoxProperty","%1 specified twice in %2","Background",name])} background = part; } else if (part.match(/^[-a-z]+:/i)) { - if (style) { - TEX.Error( - MathJax.Localization._( - ["TeX", "MultipleBboxProperty"], - "%1 specified twice in %2", "Style", name) - ) - } + if (style) + {TEX.Error(["MultipleBBoxProperty","%1 specified twice in %2", "Style",name])} style = part; } else if (part !== "") { TEX.Error( - MathJax.Localization._( - ["TeX", "InvalidBboxProperty"], - "'%1' doesn't look like a color, a padding dimension, or a style", - part); + ["InvalidBBoxProperty", + "'%1' doesn't look like a color, a padding dimension, or a style", + part] + ); } } if (def) {math = MML.mpadded(math).With(def)} diff --git a/unpacked/extensions/TeX/begingroup.js b/unpacked/extensions/TeX/begingroup.js index 11126f7d9..20f1cb4ab 100644 --- a/unpacked/extensions/TeX/begingroup.js +++ b/unpacked/extensions/TeX/begingroup.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/extensions/TeX/begingroup.js @@ -25,7 +26,7 @@ */ MathJax.Extension["TeX/begingroup"] = { - version: "2.1" + version: "2.1.1" }; MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { @@ -215,12 +216,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (TEX.eqnStack.top > 1) { TEX.eqnStack.Pop(); } else if (TEX.rootStack.top === 1) { - TEX.Error( - MathJax.Localization._( - ["TeX", "ExtraEndMissingBegin"], - "Extra %1 or missing \\begingroup", name - ) - ) + TEX.Error(["ExtraEndMissingBegin","Extra %1 or missing \\begingroup",name]); } else { TEX.eqnStack.Clear(); TEX.rootStack.Pop(); @@ -296,11 +292,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { Global: function (name) { var i = this.i; var cs = this.GetCSname(name); this.i = i; if (cs !== "let" && cs !== "def" && cs !== "newcommand") { - TEX.Error( - MathJax.Localization._( - ["TeX", "GlobalNotFollowedBy"], - "%1 not followed by \\let, \\def, or \\newcommand", name) - ) + TEX.Error(["GlobalNotFollowedBy", + "%1 not followed by \\let, \\def, or \\newcommand",name]); } this.stack.env.isGlobal = true; } diff --git a/unpacked/extensions/TeX/color.js b/unpacked/extensions/TeX/color.js index 696e223ab..7b5bab00c 100644 --- a/unpacked/extensions/TeX/color.js +++ b/unpacked/extensions/TeX/color.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/extensions/TeX/color.js @@ -30,7 +31,7 @@ // The configuration defaults, augmented by the user settings // MathJax.Extension["TeX/color"] = { - version: "2.1", + version: "2.1.1", config: MathJax.Hub.CombineConfig("TeX.color",{ padding: "5px", @@ -114,12 +115,7 @@ MathJax.Extension["TeX/color"] = { getColor: function (model,def) { if (!model) {model = "named"} var fn = this["get_"+model]; - if (!fn) { - this.TEX.Error( - MathJax.Localization._(["TeX", "UndefinedColorModel"], - "Color model '%1' not defined", model) - ) - } + if (!fn) {this.TEX.Error(["UndefinedColorModel","Color model '%1' not defined",model])} return fn.call(this,def); }, @@ -128,24 +124,14 @@ MathJax.Extension["TeX/color"] = { */ get_rgb: function (rgb) { rgb = rgb.split(/,/); var RGB = "#"; - if (rgb.length !== 3) { - this.TEX.Error(MathJax.Localization._(["TeX", "rgbArg1"], - "rgb colors require 3 decimal numbers")) - } + if (rgb.length !== 3) + {this.TEX.Error(["rgbArg1","rgb colors require 3 decimal numbers"])} for (var i = 0; i < 3; i++) { - if (!rgb[i].match(/^(\d+(\.\d*)?|\.\d+)$/)) { - this.TEX.Error( - MathJax.Localization._(["TeX", "InvalidDecimalNumber"], - "Invalid decimal number") - ) - } + if (!rgb[i].match(/^(\d+(\.\d*)?|\.\d+)$/)) + {this.TEX.Error(["InvalidDecimalNumber","Invalid decimal number"])} var n = parseFloat(rgb[i]); - if (n < 0 || n > 1) { - this.TEX.Error( - MathJax.Localization._(["TeX", "rgbArg2"], - "rgb values must be between 0 and 1") - ) - } + if (n < 0 || n > 1) + {this.TEX.Error(["rgbArg2","rgb values must be between 0 and 1"])} n = Math.floor(n*255).toString(16); if (n.length < 2) {n = "0"+n} RGB += n; } @@ -157,22 +143,14 @@ MathJax.Extension["TeX/color"] = { */ get_RGB: function (rgb) { rgb = rgb.split(/,/); var RGB = "#"; - if (rgb.length !== 3) { - this.TEX.Error(MathJax.Localization._(["TeX", "RGBArg1"], - "RGB colors require 3 numbers")) - } + if (rgb.length !== 3) + {this.TEX.Error(["RGBArg1","RGB colors require 3 numbers"])} for (var i = 0; i < 3; i++) { - if (!rgb[i].match(/^\d+$/)) { - this.TEX.Error(MathJax.Localization._(["TeX", "InvalidNumber"], - "Invalid number")) - } + if (!rgb[i].match(/^\d+$/)) + {this.TEX.Error(["InvalidNumber","Invalid number"])} var n = parseInt(rgb[i]); - if (n > 255) { - this.TEX.Error( - MathJax.Localization._(["TeX", "RGBArg2"], - "RGB values must be between 0 and 255") - ) - } + if (n > 255) + {this.TEX.Error(["RGBArg2","RGB values must be between 0 and 255"])} n = n.toString(16); if (n.length < 2) {n = "0"+n} RGB += n; } @@ -183,18 +161,11 @@ MathJax.Extension["TeX/color"] = { * Get a gray-scale value */ get_gray: function (gray) { - if (!gray.match(/^(\d+(\.\d*)?|\.\d+)$/)) { - this.TEX.Error( - MathJax.Localization._(["TeX", "InvalidDecimalNumber"], - "Invalid decimal number") - ) - } + if (!gray.match(/^(\d+(\.\d*)?|\.\d+)$/)) + {this.TEX.Error(["InvalidDecimalNumber","Invalid decimal number"])} var n = parseFloat(gray); - if (n < 0 || n > 1) { - this.TEX.Error( - MathJax.Localization._(["TeX", "GrayScalerArg"], - "Grey-scale values must be between 0 and 1")) - } + if (n < 0 || n > 1) + {this.TEX.Error(["GrayScalerArg","Grey-scale values must be between 0 and 1"])} n = Math.floor(n*255).toString(16); if (n.length < 2) {n = "0"+n} return "#"+n+n+n; }, diff --git a/unpacked/extensions/TeX/extpfeil.js b/unpacked/extensions/TeX/extpfeil.js index 717ca75ac..8a047f54e 100644 --- a/unpacked/extensions/TeX/extpfeil.js +++ b/unpacked/extensions/TeX/extpfeil.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/extensions/TeX/extpfeil.js @@ -24,7 +25,7 @@ */ MathJax.Extension["TeX/extpfeil"] = { - version: "2.1" + version: "2.1.1" }; MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { @@ -73,23 +74,22 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { space = this.GetArgument(name), chr = this.GetArgument(name); if (!cs.match(/^\\([a-z]+|.)$/i)) { - TEX.Error( - MathJax.Localization._(["TeX", "NewextarrowArg1"] - "First argument to %1 must be a control sequence name", name) - ) + TEX.Error(["NewextarrowArg1", + "First argument to %1 must be a control sequence name",name]); } if (!space.match(/^(\d+),(\d+)$/)) { TEX.Error( - MathJax.Localization._(["TeX", "NewextarrowArg2"] - "Second argument to %1 must be two integers separated by a comma", - name) - ) + ["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) - ) + ["NewextarrowArg3", + "Third argument to %1 must be a unicode character number", + name] + ); } cs = cs.substr(1); space = space.split(","); chr = parseInt(chr); TEXDEF.macros[cs] = ['xArrow',chr,parseInt(space[0]),parseInt(space[1])]; diff --git a/unpacked/extensions/TeX/mhchem.js b/unpacked/extensions/TeX/mhchem.js index 02007806e..2e2e1fd42 100644 --- a/unpacked/extensions/TeX/mhchem.js +++ b/unpacked/extensions/TeX/mhchem.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/extensions/TeX/mhchem.js @@ -25,7 +26,7 @@ */ MathJax.Extension["TeX/mhchem"] = { - version: "2.1" + version: "2.1.1" }; MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { @@ -353,21 +354,12 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (C === "}") { if (braces) {braces--} else { - TEX.Error( - MathJax.Localization._( - ["TeX", "ExtraCloseMissingOpen"], - "Extra close brace or missing open brace" - ) - ) + TEX.Error(["ExtraCloseMissingOpen","Extra close brace or missing open brace"]) } } } - if (braces) { - TEX.Error(MathJax.Localization._(["TeX", "MissingCloseBrace"], - "Missing close brace")) - }; - TEX.Error(MathJax.Localization._(["TeX", "NoClosingChar"], - "Can't find closing %1", c) + if (braces) {TEX.Error(["MissingCloseBrace","Missing close brace"])} + TEX.Error(["NoClosingChar","Can't find closing %1",c]); } }); diff --git a/unpacked/extensions/TeX/newcommand.js b/unpacked/extensions/TeX/newcommand.js index a0eb655be..420ec19fe 100644 --- a/unpacked/extensions/TeX/newcommand.js +++ b/unpacked/extensions/TeX/newcommand.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/extensions/TeX/newcommand.js @@ -25,16 +26,11 @@ */ MathJax.Extension["TeX/newcommand"] = { - version: "2.1" + version: "2.1.1" }; 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 TEXDEF = TEX.Definitions; @@ -61,14 +57,14 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { def = this.GetArgument(name); if (cs.charAt(0) === "\\") {cs = cs.substr(1)} if (!cs.match(/^(.|[a-z]+)$/i)) { - TEX.Error(_("IllegalControlSequenceName", - "Illegal control sequence name for %1", name)) + TEX.Error(["IllegalControlSequenceName", + "Illegal control sequence name for %1",name]); } if (n) { n = this.trimSpaces(n); if (!n.match(/^[0-9]+$/)) { - TEX.Error(_("IllegalParamNumber" - "Illegal number of parameters specified in %1", name)) + TEX.Error(["IllegalParamNumber", + "Illegal number of parameters specified in %1",name]); } } this.setDef(cs,['Macro',def,n,opt]); @@ -85,8 +81,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (n) { n = this.trimSpaces(n); if (!n.match(/^[0-9]+$/)) { - TEX.Error(_("IllegalParamNumber" - "Illegal number of parameters specified in %1", name)) + TEX.Error(["IllegalParamNumber", + "Illegal number of parameters specified in %1",name]); } } this.setEnv(env,['BeginEnv','EndEnv',bdef,edef,n]); @@ -145,8 +141,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { GetCSname: function (cmd) { var c = this.GetNext(); if (c !== "\\") { - TEX.Error(_("DoubleBackSlash", - "\\ must be followed by a control sequence")) + TEX.Error(["DoubleBackSlash", + "\\ must be followed by a control sequence"]) } var cs = this.trimSpaces(this.GetArgument(cmd)); return cs.substr(1); @@ -164,13 +160,12 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (i !== this.i) {params[n] = this.string.substr(i,this.i-i)} c = this.string.charAt(++this.i); if (!c.match(/^[1-9]$/)) { - TEX.Error(_("CantUseHash2", - "Illegal use of # in template for %1", cs)) + 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)) + TEX.Error(["SequentialParam", + "Parameters for %1 must be numbered sequentially",cs]); } i = this.i+1; } else if (c === '{') { @@ -179,8 +174,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { } this.i++; } - TEX.Error(_("MissingReplacementString", - "Missing replacement string for definition of %1", cmd)); + TEX.Error(["MissingReplacementString", + "Missing replacement string for definition of %1",cmd]); }, /* @@ -190,10 +185,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (n) { var args = []; this.GetNext(); if (params[0] && !this.MatchParam(params[0])) { - TEX.Error( - _("MismatchUseDef", - "Use of %1 doesn't match its definition", name)) - ) + 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]))} text = this.SubstituteArgs(args,text); @@ -201,10 +194,9 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { this.string = this.AddArgs(text,this.string.slice(this.i)); this.i = 0; if (++this.macroCount > TEX.config.MAXMACROS) { - TEX.Error( - _("MaxMacroSub1", - "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?"]); } }, @@ -244,9 +236,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { this.i++; j++; hasBraces = 0; } } - TEX.Error( - _("RunawayArgument", "Runaway argument for %1?", name) - ); + TEX.Error(["RunawayArgument","Runaway argument for %1?",name]); }, /* diff --git a/unpacked/extensions/TeX/verb.js b/unpacked/extensions/TeX/verb.js index 2fc756e27..10a07abb4 100644 --- a/unpacked/extensions/TeX/verb.js +++ b/unpacked/extensions/TeX/verb.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/extensions/TeX/verb.js @@ -25,7 +26,7 @@ */ MathJax.Extension["TeX/verb"] = { - version: "2.1" + version: "2.1.1" }; MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { @@ -43,19 +44,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { */ Verb: function (name) { var c = this.GetNext(); var start = ++this.i; - if (c == "" ) { - TEX.Error( - MathJax.Localization._( - ["TeX", "MissingArgFor"], - "Argument manquant pour la commande %1", name)) - } + if (c == "" ) {TEX.Error(["MissingArgFor","Missing argument for %1",name])} while (this.i < this.string.length && this.string.charAt(this.i) != c) {this.i++} - if (this.i == this.string.length) { - TEX.Error( - MathJax.Localization._( - ["TeX", "NoClosinDelim"], - "Can't find closing delimiter for %1", name)) - } + if (this.i == this.string.length) + {TEX.Error(["NoClosingDelim","Can't find closing delimiter for %1", name])} var text = this.string.slice(start,this.i); this.i++; this.Push(MML.mtext(text).With({mathvariant:MML.VARIANT.MONOSPACE})); } diff --git a/unpacked/jax/input/AsciiMath/config.js b/unpacked/jax/input/AsciiMath/config.js index 94f4e473a..5b198432f 100644 --- a/unpacked/jax/input/AsciiMath/config.js +++ b/unpacked/jax/input/AsciiMath/config.js @@ -27,7 +27,7 @@ MathJax.InputJax.AsciiMath = MathJax.InputJax({ id: "AsciiMath", - version: "2.1", + version: "2.1.1", directory: MathJax.InputJax.directory + "/AsciiMath", extensionDir: MathJax.InputJax.extensionDir + "/AsciiMath", diff --git a/unpacked/jax/input/AsciiMath/jax.js b/unpacked/jax/input/AsciiMath/jax.js index eb32db3bc..7748342d3 100644 --- a/unpacked/jax/input/AsciiMath/jax.js +++ b/unpacked/jax/input/AsciiMath/jax.js @@ -1268,7 +1268,7 @@ junk = null; var MML; ASCIIMATH.Augment({ - sourceMenuTitle: "AsciiMath Input", + sourceMenuTitle: /*_(MathMenu)*/ ["AsciiMathInput","AsciiMath Input"], prefilterHooks: MathJax.Callback.Hooks(true), // hooks to run before processing AsciiMath postfilterHooks: MathJax.Callback.Hooks(true), // hooks to run after processing AsciiMath diff --git a/unpacked/jax/input/MathML/config.js b/unpacked/jax/input/MathML/config.js index 77d7e0217..508cfdfb9 100644 --- a/unpacked/jax/input/MathML/config.js +++ b/unpacked/jax/input/MathML/config.js @@ -24,7 +24,7 @@ MathJax.InputJax.MathML = MathJax.InputJax({ id: "MathML", - version: "2.1", + version: "2.1.1", directory: MathJax.InputJax.directory + "/MathML", extensionDir: MathJax.InputJax.extensionDir + "/MathML", entityDir: MathJax.InputJax.directory + "/MathML/entities", diff --git a/unpacked/jax/input/MathML/jax.js b/unpacked/jax/input/MathML/jax.js index 31f3bcf13..dcb3ef2d2 100644 --- a/unpacked/jax/input/MathML/jax.js +++ b/unpacked/jax/input/MathML/jax.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/jax/input/MathML/jax.js @@ -29,8 +30,8 @@ var MML; var _ = function (id) { - return MathJax.Localization._.apply(MathJax.Localization,[ - ["MathML",id] ].concat([].slice.call(arguments,1))) + return MathJax.Localization._.apply(MathJax.Localization, + [["MathML",id]].concat([].slice.call(arguments,1))) }; MATHML.Parse = MathJax.Object.Subclass({ @@ -54,33 +55,23 @@ math = math.replace(/^\s*(?:\/\/)?\s*$/,"$2"); math = math.replace(/&([a-z][a-z0-9]*);/ig,this.replaceEntity); doc = MATHML.ParseXML(math); - if (doc == null) { - MATHML.Error(_("ErrorParsingMathML", "Error parsing MathML")) - } + if (doc == null) {MATHML.Error(["ErrorParsingMathML","Error parsing MathML"])} } var err = doc.getElementsByTagName("parsererror")[0]; - // Localization: This seems to replace error messages produced - // by browsers. Does that work in all languages? - if (err) MATHML.Error("Error parsing MathML: "+err.textContent.replace(/This page.*?errors:|XML Parsing Error: |Below is a rendering of the page.*/g,"")); - if (doc.childNodes.length !== 1) { - MATHML.Error( - _("MathMLSingleElement", "MathML must be formed by a single element") - ); - } + if (err) MATHML.Error(["ParsingError","Error parsing MathML: %1", + err.textContent.replace(/This page.*?errors:|XML Parsing Error: |Below is a rendering of the page.*/g,"")]); + if (doc.childNodes.length !== 1) + {MATHML.Error(["MathMLSingleElement","MathML must be formed by a single element"])} if (doc.firstChild.nodeName.toLowerCase() === "html") { var h1 = doc.getElementsByTagName("h1")[0]; if (h1 && h1.textContent === "XML parsing error" && h1.nextSibling) - // Localization: This seems to replace error messages produced - // by browsers. Does that work in all languages? - MATHML.Error("Error parsing MathML: "+String(h1.nextSibling.nodeValue).replace(/fatal parsing error: /,"")); + MATHML.Error(["ParsingError","Error parsing MathML: %1", + String(h1.nextSibling.nodeValue).replace(/fatal parsing error: /,"")]); } - if (doc.firstChild.nodeName.toLowerCase().replace(/^[a-z]+:/,"") !== - "math") { - MATHML.Error( - _("MathMLRootElement", + if (doc.firstChild.nodeName.toLowerCase().replace(/^[a-z]+:/,"") !== "math") { + MATHML.Error(["MathMLRootElement", "MathML must be formed by a element, not %1", - "<"+doc.firstChild.nodeName+">") - ); + "<"+doc.firstChild.nodeName+">"]); } this.mml = this.MakeMML(doc.firstChild); }, @@ -96,10 +87,7 @@ mml = this.TeXAtom(match[2]); } else if (!(MML[type] && MML[type].isa && MML[type].isa(MML.mbase))) { MathJax.Hub.signal.Post(["MathML Jax - unknown node type",type]); - return MML.merror( - MathJax.Localization._( - "UnknownNodeType", "Unknown node type: %1", type) - ); + return MML.merror(_("UnknownNodeType","Unknown node type: %1",type)); } else { mml = MML[type](); } @@ -175,10 +163,8 @@ var text = child.nodeValue.replace(/&([a-z][a-z0-9]*);/ig,this.replaceEntity); mml.Append(MML.chars(this.trimSpace(text))); } else if (child.nodeValue.match(/\S/)) { - MATHML.Error( - _("UnexpectedTextNode", "Unexpected text node: %1", - "'"+child.nodeValue+"'") - ); + MATHML.Error(["UnexpectedTextNode", + "Unexpected text node: %1","'"+child.nodeValue+"'"]); } } else if (mml.type === "annotation-xml") { mml.Append(MML.xml(child)); @@ -223,7 +209,7 @@ /************************************************************************/ MATHML.Augment({ - sourceMenuTitle: "Original MathML", + sourceMenuTitle: /*_(MathMenu)*/ ["OriginalMathML","Original MathML"], prefilterHooks: MathJax.Callback.Hooks(true), // hooks to run before processing MathML postfilterHooks: MathJax.Callback.Hooks(true), // hooks to run after processing MathML @@ -257,6 +243,10 @@ return MML.merror(message); }, Error: function (message) { + // + // Translate message if it is ["id","message",args] + // + if (message instanceof Array) {message = _.apply(_,message)} throw MathJax.Hub.Insert(Error(message),{mathmlError: true}); }, // @@ -282,12 +272,7 @@ for (var i = 0, m = xml.length; i < m && !this.parser; i++) {try {this.parser = new ActiveXObject(xml[i])} catch (err) {}} if (!this.parser) { - alert("MathJax can't create an XML parser for MathML. Check that\n"+ - "the 'Script ActiveX controls marked safe for scripting' security\n"+ - "setting is enabled (use the Internet Options item in the Tools\n"+ - "menu, and select the Security panel, then press the Custom Level\n"+ - "button to check this).\n\n"+ - "MathML equations will not be able to be processed by MathJax."); + MathJax.Localization.Try(this.parserCreationError); return(this.parseError); } this.parser.async = false; @@ -301,6 +286,15 @@ else {document.body.insertBefore(this.div,document.body.firstChild)} return(this.parseDIV); }, + parserCreationError: function () { + alert(_("MathPlayer", + "MathJax can't create an XML parser for MathML. Check that\n"+ + "the 'Script ActiveX controls marked safe for scripting' security\n"+ + "setting is enabled (use the Internet Options item in the Tools\n"+ + "menu, and select the Security panel, then press the Custom Level\n"+ + "button to check this).\n\n"+ + "MathML equations will not be able to be processed by MathJax.")); + }, // // Initialize the parser object (whichever type is used) // diff --git a/unpacked/jax/input/TeX/config.js b/unpacked/jax/input/TeX/config.js index 4850a6a53..774511b8e 100644 --- a/unpacked/jax/input/TeX/config.js +++ b/unpacked/jax/input/TeX/config.js @@ -24,7 +24,7 @@ MathJax.InputJax.TeX = MathJax.InputJax({ id: "TeX", - version: "2.1", + version: "2.1.1", directory: MathJax.InputJax.directory + "/TeX", extensionDir: MathJax.InputJax.extensionDir + "/TeX", diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index c31c4947f..642a643cd 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/jax/input/TeX/jax.js @@ -30,7 +31,7 @@ var _ = function (id) { return MathJax.Localization._.apply(MathJax.Localization, - [ ["TeX", id] ].concat([].slice.call(arguments,1))) + [["TeX", id]].concat([].slice.call(arguments,1))); }; var STACK = MathJax.Object.Subclass({ @@ -79,14 +80,8 @@ var STACKITEM = STACK.Item = MathJax.Object.Subclass({ type: "base", - // Localization: should be updated when the language is changed - // This is used in TEX.Error(this[item.type+"Error"]) below, perhaps a if - // could just be used directly, or make the messageID contains close/right - // Add a note about the \\ syntax. - closeError: _("ExtraCloseMissingOpen", - "Extra close brace or missing open brace"), - rightError: _("MissingLeftExtraRight", - "Missing \\left or extra \\right"), + closeError: ["ExtraCloseMissingOpen","Extra close brace or missing open brace"], + rightError: ["MissingLeftExtraRight","Missing \\left or extra \\right"], Init: function () { if (this.isOpen) {this.env = {}} this.data = []; @@ -103,7 +98,7 @@ if (item.type === "over" && this.isOpen) {item.num = this.mmlData(false); this.data = []} if (item.type === "cell" && this.isOpen) { if (item.linebreak) {return false} - TEX.Error(_("Misplaced %1", "Misplaced ", item.name)); + TEX.Error(["Misplaced %1","Misplaced ",item.name]); } if (item.isClose && this[item.type+"Error"]) {TEX.Error(this[item.type+"Error"])} if (!item.isNotStack) {return true} @@ -134,12 +129,10 @@ STACKITEM.open = STACKITEM.Subclass({ type: "open", isOpen: true, - // Localization: should be updated when the language is changed - stopError: _("ExtraOpenMissingClose", - "Extra open brace or missing close brace"), + stopError: ["ExtraOpenMissingClose","Extra open brace or missing close brace"], checkItem: function (item) { if (item.type === "close") { - var mml = this.mmlData(); // this.mmlData(true,true); // force row + var mml = this.mmlData(); return STACKITEM.mml(MML.TeXAtom(mml)); // TeXAtom make it an ORD to prevent spacing (FIXME: should be another way) } return this.SUPER(arguments).checkItem.call(this,item); @@ -162,9 +155,7 @@ STACKITEM.subsup = STACKITEM.Subclass({ type: "subsup", - // Localization: should be updated when the language is changed - stopError: _("MissingScript", - "Missing superscript or subscript argument"), + stopError: ["MissingScript","Missing superscript or subscript argument"], checkItem: function (item) { var script = ["","subscript","superscript"][this.position]; if (item.type === "open" || item.type === "left") {return true} @@ -176,10 +167,8 @@ this.data[0].SetData(this.position,item.data[0]); return STACKITEM.mml(this.data[0]); } - if (this.SUPER(arguments).checkItem.call(this,item)) { - TEX.Error(_("MissingOpenForScript", - "Missing open brace for %1", script)) - } + if (this.SUPER(arguments).checkItem.call(this,item)) + {TEX.Error(["MissingOpenForScript","Missing open brace for %1",script])} }, Pop: function () {} }); @@ -187,9 +176,8 @@ STACKITEM.over = STACKITEM.Subclass({ type: "over", isClose: true, name: "\\over", checkItem: function (item,stack) { - if (item.type === "over") { - TEX.Error(_("AmbiguousUseOf", "Ambiguous use of %1", item.name)) - } + if (item.type === "over") + {TEX.Error(["AmbiguousUseOf","Ambiguous use of %1",item.name])} if (item.isClose) { var mml = MML.mfrac(this.num,this.mmlData(false)); if (this.thickness != null) {mml.linethickness = this.thickness} @@ -207,9 +195,7 @@ STACKITEM.left = STACKITEM.Subclass({ type: "left", isOpen: true, delim: '(', - // Localization: should be updated when the language is changed - // Add a note about the \\ syntax. - stopError: _("ExtraLeftMissingRight", "Extra \\left or missing \\right"), + stopError: ["ExtraLeftMissingRight", "Extra \\left or missing \\right"], checkItem: function (item) { if (item.type === "right") { var mml = MML.mfenced(this.data.length === 1 ? this.data[0] : MML.mrow.apply(MML,this.data)); @@ -227,17 +213,13 @@ type: "begin", isOpen: true, checkItem: function (item) { if (item.type === "end") { - if (item.name !== this.name) { - TEX.Error(_("EnvBadEnd", - "\\begin{%1} ended with \\end{%2}", - this.name, item.name)) - } + if (item.name !== this.name) + {TEX.Error(["EnvBadEnd","\\begin{%1} ended with \\end{%2}",this.name,item.name])} if (!this.end) {return STACKITEM.mml(this.mmlData())} return this.parse[this.end].call(this.parse,this,this.data); } - if (item.type === "stop") { - TEX.Error(_("EnvMissingEnd", "Missing \\end{%1}", this.name)) - } + if (item.type === "stop") + {TEX.Error(["EnvMissingEnd","Missing \\end{%1}",this.name])} return this.SUPER(arguments).checkItem.call(this,item); } }); @@ -258,9 +240,7 @@ STACKITEM.position = STACKITEM.Subclass({ type: "position", checkItem: function (item) { - if (item.isClose) { - TEX.Error(_("MissingBoxFor", "Missing box for %1")) - } + if (item.isClose) {TEX.Error(["MissingBoxFor","Missing box for %1"])} if (item.isNotStack) { var mml = item.mmlData(); switch (this.move) { @@ -302,7 +282,7 @@ mml = STACKITEM.mml(mml); if (this.requireClose) { if (item.type === 'close') {return mml} - TEX.Error(_("MissingCloseBrace", "Missing close brace")); + TEX.Error(["MissingCloseBrace","Missing close brace"]); } return [mml,item]; } @@ -1146,8 +1126,7 @@ // (overridden in noUndefined extension) // csUndefined: function (name) { - TEX.Error(_("UndefinedControlSequence", - "Undefined control sequence %1", name)); + TEX.Error(["UndefinedControlSequence","Undefined control sequence %1",name]); }, /* @@ -1192,10 +1171,8 @@ else {base = this.stack.Prev(); if (!base) {base = MML.mi("")}} if (base.isEmbellishedWrapper) {base = base.data[0].data[0]} if (base.type === "msubsup") { - if (base.data[base.sup]) { - TEX.Error(_("DoubleExponent", - "Double exponent: use braces to clarify")) - } + if (base.data[base.sup]) + {TEX.Error(["DoubleExponent","Double exponent: use braces to clarify"])} position = base.sup; } else if (base.movesupsub) { if (base.type !== "munderover" || base.data[base.over]) { @@ -1217,10 +1194,8 @@ else {base = this.stack.Prev(); if (!base) {base = MML.mi("")}} if (base.isEmbellishedWrapper) {base = base.data[0].data[0]} if (base.type === "msubsup") { - if (base.data[base.sub]) { - TEX.Error(_("DoubleSubscripts", - "Double subscripts: use braces to clarify")) - } + if (base.data[base.sub]) + {TEX.Error(["DoubleSubscripts","Double subscripts: use braces to clarify"])} position = base.sub; } else if (base.movesupsub) { if (base.type !== "munderover" || base.data[base.under]) { @@ -1238,8 +1213,8 @@ Prime: function (c) { var base = this.stack.Prev(); if (!base) {base = MML.mi()} if (base.type === "msubsup" && base.data[base.sup]) { - TEX.Error(_("DoubleExponentPrime", - "Prime causes double exponent: use braces to clarify")) + TEX.Error(["DoubleExponentPrime", + "Prime causes double exponent: use braces to clarify"]); } var sup = ""; this.i--; do {sup += this.PRIME; this.i++, c = this.GetNext()} @@ -1267,8 +1242,8 @@ * Handle hash marks outside of definitions */ Hash: function (c) { - TEX.Error(_("CantUseHash1", - "You can't use 'macro parameter character #' in math mode")); + TEX.Error(["CantUseHash1", + "You can't use 'macro parameter character #' in math mode"]); }, /* @@ -1321,9 +1296,8 @@ Middle: function (name) { var delim = this.GetDelimiter(name); - if (this.stack.Top().type !== "left") { - TEX.Error(_("MisplacedMiddle", - "%1 must be within \\left and \\right", name))} + if (this.stack.Top().type !== "left") + {TEX.Error(["MisplacedMiddle","%1 must be within \\left and \\right",name])} this.Push(MML.mo(delim).With({stretchy:true})); }, @@ -1346,10 +1320,8 @@ }, Limits: function (name,limits) { var op = this.stack.Prev("nopop"); - if (!op || op.texClass !== MML.TEXCLASS.OP) { - TEX.Error(_("MisplacedLimits", - "%1 is allowed only on operators", name)) - } + if (!op || op.texClass !== MML.TEXCLASS.OP) + {TEX.Error(["MisplacedLimits","%1 is allowed only on operators",name])} op.movesupsub = (limits ? true : false); op.movablelimits = false; }, @@ -1398,18 +1370,13 @@ return n; }, MoveRoot: function (name,id) { - if (!this.stack.env.inRoot) { - TEX.Error(_("BadMoveRoot", "%1 can appear only within a root")); - } - if (this.stack.global[id]) { - TEX.Error(_("MultipleMoveRoot", - "Multiple use of %1", name)); - } + if (!this.stack.env.inRoot) + {TEX.Error(["BadMoveRoot","%1 can appear only within a root"])} + if (this.stack.global[id]) + {TEX.Error(["MultipleMoveRoot","Multiple use of %1",name])} var n = this.GetArgument(name); - if (!n.match(/-?[0-9]+/)) { - TEX.Error(_("IntegerArg", - "The argument to %1 must be an integer", name)); - } + if (!n.match(/-?[0-9]+/)) + {TEX.Error(["IntegerArg","The argument to %1 must be an integer",name])} n = (n/15)+"em"; if (n.substr(0,1) !== "-") {n = "+"+n} this.stack.global[id] = n; @@ -1464,20 +1431,17 @@ attr = this.GetBrackets(name,"").replace(/^\s+/,""), data = this.GetArgument(name), def = {attrNames:[]}, match; - if (!MML[type] || !MML[type].prototype.isToken) { - TEX.Error(_("NotMathMLToken", "%1 is not a token element", type)) - } + if (!MML[type] || !MML[type].prototype.isToken) + {TEX.Error(["NotMathMLToken", "%1 is not a token element",type])} while (attr !== "") { - match = attr.match(/^([a-z]+)\s*=\s*('[^']*'|"[^"]*"|[^ ]*)\s*/i); - if (!match) { - TEX.Error("InvalidMathMLAttr", - "Invalid MathML attribute: %1", attr) - } + match = attr.match(/^([a-z]+)\s*=\s*('[^']*'|\"[^"]*"|[^ ]*)\s*/i); + if (!match) + {TEX.Error("InvalidMathMLAttr","Invalid MathML attribute: %1",attr)} if (!MML[type].prototype.defaults[match[1]] && !this.MmlTokenAllow[match[1]]) { - TEX.Error(_("UnknownAttrForElement", - "%1 is not a recognized attribute for %2", - match[1], type)) + TEX.Error(["UnknownAttrForElement", + "%1 is not a recognized attribute for %2", + match[1],type]); } def[match[1]] = match[2].replace(/^(['"])(.*)\1$/,"$2"); def.attrNames.push(match[1]); @@ -1625,16 +1589,16 @@ this.string = this.AddArgs(macro,this.string.slice(this.i)); this.i = 0; if (++this.macroCount > TEX.config.MAXMACROS) { - TEX.Error(_("MaxMacroSub", - "MathJax maximum macro substitution count exceeded; is there a recursive macro call?")) + TEX.Error(["MaxMacroSub", + "MathJax maximum macro substitution count exceeded; " + + "is there a recursive macro call?"]); } }, Matrix: function (name,open,close,align,spacing,vspacing,style,cases) { var c = this.GetNext(); - if (c === "") { - TEX.Error(_("MissingArgFor", "Missing argument for %1", name)) - } + if (c === "") + {TEX.Error(["MissingArgFor","Missing argument for %1",name])} if (c === "{") {this.i++} else {this.string = c+"}"+this.string.slice(this.i+1); this.i = 0} var array = STACKITEM.array().With({ requireClose: true, @@ -1660,8 +1624,7 @@ if (c === "{") {braces++; i++} else if (c === "}") {if (braces === 0) {m = 0} else {braces--; i++}} else if (c === "&" && braces === 0) { - TEX.Error(_("ExtraAlignTab", - "Extra alignment tab in \\cases text")) + TEX.Error(["ExtraAlignTab","Extra alignment tab in \\cases text"]); } else if (c === "\\") { if (string.substr(i).match(/^((\\cr)[^a-zA-Z]|\\\\)/)) {m = 0} else {i += 2} } else {i++} @@ -1684,8 +1647,8 @@ n = this.GetBrackets(name,"").replace(/ /g,""); if (n && !n.match(/^((-?(\.\d+|\d+(\.\d*)?))(pt|em|ex|mu|mm|cm|in|pc))$/)) { - TEX.Error(_("BracketMustBeDimension", - "Bracket argument to %1 must be a dimension", name)) + TEX.Error(["BracketMustBeDimension", + "Bracket argument to %1 must be a dimension",name]); } } this.Push(STACKITEM.cell().With({isCR: true, name: name, linebreak: true})); @@ -1725,9 +1688,8 @@ HLine: function (name,style) { if (style == null) {style = "solid"} var top = this.stack.Top(); - if (!top.isa(STACKITEM.array) || top.data.length) { - TEX.Error(_("Misplaced", "Misplaced %1", name)) - } + if (!top.isa(STACKITEM.array) || top.data.length) + {TEX.Error(["Misplaced","Misplaced %1",name])} if (top.table.length == 0) { top.frame.push("top"); } else { @@ -1745,18 +1707,15 @@ Begin: function (name) { var env = this.GetArgument(name); - if (env.match(/[^a-z*]/i)) { - TEX.Error(_("InvalidEnv", - "Invalid environment name '%1'", env)) - } + if (env.match(/[^a-z*]/i)) + {TEX.Error(["InvalidEnv","Invalid environment name '%1'",env])} var cmd = this.envFindName(env); - if (!cmd) { - TEX.Error(_("UnknownEnv", - "Unknown environment '%1'", env)) - } + if (!cmd) + {TEX.Error(["UnknownEnv","Unknown environment '%1'",env])} if (++this.macroCount > TEX.config.MAXMACROS) { - TEX.Error(_("MaxMacroSub2", - "MathJax maximum substitution count exceeded; is there a recursive latex environment?")) + TEX.Error(["MaxMacroSub2", + "MathJax maximum substitution count exceeded; " + + "is there a recursive latex environment?"]); } if (!(cmd instanceof Array)) {cmd = [cmd]} var mml = STACKITEM.begin().With({name: env, end: cmd[1], parse:this}); @@ -1867,14 +1826,12 @@ GetArgument: function (name,noneOK) { switch (this.GetNext()) { case "": - if (!noneOK) { - TEX.Error(_("MissingArgFor", "Missing argument for %1", name)) - } + if (!noneOK) {TEX.Error(["MissingArgFor","Missing argument for %1",name])} return null; case '}': if (!noneOK) { - TEX.Error(_("ExtraCloseMissingOpen", - "Extra close brace or missing open brace")) + TEX.Error(["ExtraCloseMissingOpen", + "Extra close brace or missing open brace"]); } return null; case '\\': @@ -1886,14 +1843,12 @@ case '\\': this.i++; break; case '{': parens++; break; case '}': - if (parens == 0) { - TEX.Error(_("ExtraClose", "Extra close brace")) - } + if (parens == 0) {TEX.Error(["ExtraClose","Extra close brace"])} if (--parens == 0) {return this.string.slice(j,this.i-1)} break; } } - TEX.Error(_("MissingCloseBrace", "Missing close brace")); + TEX.Error(["MissingCloseBrace","Missing close brace"]); break; } return this.string.charAt(this.i++); @@ -1911,8 +1866,8 @@ case '\\': this.i++; break; case '}': if (parens-- <= 0) { - TEX.Error(_("ExtraCloseInBrackets", - "Extra close brace while looking for ']'")) + TEX.Error(["ExtraCloseBrace", + "Extra close brace while looking for %1","']'"]); } break; case ']': @@ -1920,9 +1875,8 @@ break; } } - TEX.Error( - _("MissingCloseBracket", - "Couldn't find closing ']' for argument to %1", name)); + TEX.Error(["MissingCloseBracket", + "Couldn't find closing ']' for argument to %1",name]); }, /* @@ -1935,8 +1889,8 @@ this.i++; if (c == "\\") {c += this.GetCS(name)} if (TEXDEF.delimiter[c] != null) {return this.convertDelimiter(c)} } - TEX.Error(_("MissingOrUnrecognizedDelim", - "Missing or unrecognized delimiter for %1", name)); + TEX.Error(["MissingOrUnrecognizedDelim", + "Missing or unrecognized delimiter for %1",name]); }, /* @@ -1957,8 +1911,8 @@ return match[1].replace(/ /g,""); } } - TEX.Error(_("MissingDimOrUnits", - "Missing dimension or its units for %1", name)); + TEX.Error(["MissingDimOrUnits", + "Missing dimension or its units for %1",name]); }, /* @@ -1974,16 +1928,16 @@ case '{': parens++; break; case '}': if (parens == 0) { - TEX.Error(_("ExtraCloseBraceInUpTo", - "Extra close brace while looking for %1", token)) + TEX.Error(["ExtraCloseBrace", + "Extra close brace while looking for %1",token]) } parens--; break; } if (parens == 0 && c == token) {return this.string.slice(j,k)} } - TEX.Error(_("TokenNotFoundForCommand", - "Couldn't find %1 for %2", token, name)); + TEX.Error(["TokenNotFoundForCommand", + "Couldn't find %1 for %2",token,name]); }, /* @@ -2032,9 +1986,8 @@ } } } - if (match !== '') { - TEX.Error(_("MathNotTerminated", "Math not terminated in text box")) - } + if (match !== '') + {TEX.Error(["MathNotTerminated","Math not terminated in text box"])} if (k < text.length) {mml.push(this.InternalText(text.slice(k),def))} return mml; }, @@ -2055,8 +2008,8 @@ c = string.charAt(i++); if (c === '#') {text += c} else { if (!c.match(/[1-9]/) || c > args.length) { - TEX.Error(_("IllegalMacroParam", - "Illegal macro parameter reference")) + TEX.Error(["IllegalMacroParam", + "Illegal macro parameter reference"]); } newstring = this.AddArgs(this.AddArgs(newstring,text),args[c-1]); text = ''; @@ -2073,8 +2026,8 @@ AddArgs: function (s1,s2) { if (s2.match(/^[a-z]/i) && s1.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)) {s1 += ' '} if (s1.length + s2.length > TEX.config.MAXBUFFER) { - TEX.Error(_("MaxBufferSize", - "MathJax internal buffer size exceeded; is there a recursive macro call?")) + TEX.Error(["MaxBufferSize", + "MathJax internal buffer size exceeded; is there a recursive macro call?"]); } return s1+s2; } @@ -2091,7 +2044,7 @@ MAXBUFFER: 5*1024 // maximum size of TeX string to process }, - sourceMenuTitle: "TeX Commands", + sourceMenuTitle: /*_(MathMenu)*/ ["TeXCommands","TeX Commands"], prefilterHooks: MathJax.Callback.Hooks(true), // hooks to run before processing TeX postfilterHooks: MathJax.Callback.Hooks(true), // hooks to run after processing TeX @@ -2147,6 +2100,10 @@ // Produce an error and stop processing this equation // Error: function (message) { + // + // Translate message if it is ["id","message",args] + // + if (message instanceof Array) {message = _.apply(_,message)} throw HUB.Insert(Error(message),{texError: true}); }, diff --git a/unpacked/jax/output/HTML-CSS/autoload/mglyph.js b/unpacked/jax/output/HTML-CSS/autoload/mglyph.js index 9c6837f01..ea5e16b7f 100644 --- a/unpacked/jax/output/HTML-CSS/autoload/mglyph.js +++ b/unpacked/jax/output/HTML-CSS/autoload/mglyph.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/jax/output/HTML-CSS/autoload/mglyph.js @@ -24,9 +25,10 @@ */ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { - var VERSION = "2.1"; + var VERSION = "2.1.1"; var MML = MathJax.ElementJax.mml, - HTMLCSS = MathJax.OutputJax["HTML-CSS"]; + HTMLCSS = MathJax.OutputJax["HTML-CSS"], + LOCALE = MathJax.Localization; MML.mglyph.Augment({ toHTML: function (span,variant) { @@ -41,11 +43,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { if (HTMLCSS.Font.testFont(font)) { this.HTMLhandleVariant(span,variant,String.fromCharCode(index)); } else { - if (values.alt === "") { - values.alt = - MathJax.Localization._(["MathML", "BadMglyphFont"], - "Bad font: %1", font.family); - } + if (values.alt === "") + {values.alt = LOCALE._(["MathML","BadMglyphFont"],"Bad font: %1",font.family)} err = MML.merror(values.alt).With({mathsize:"75%"}); this.Append(err); err.toHTML(span); this.data.pop(); span.bbox = err.HTMLspanElement().bbox; @@ -64,8 +63,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { } if (this.img.status !== "OK") { err = MML.merror( - MathJax.Localization._(["MathML", "BadMglyph"], - "Bad mglyph: %1", values.src) + LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src) ).With({mathsize:"75%"}); this.Append(err); err.toHTML(span); this.data.pop(); span.bbox = err.HTMLspanElement().bbox; diff --git a/unpacked/jax/output/HTML-CSS/config.js b/unpacked/jax/output/HTML-CSS/config.js index a142f3a23..523d2d17d 100644 --- a/unpacked/jax/output/HTML-CSS/config.js +++ b/unpacked/jax/output/HTML-CSS/config.js @@ -26,7 +26,7 @@ MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({ id: "HTML-CSS", - version: "2.1", + version: "2.1.1", directory: MathJax.OutputJax.directory + "/HTML-CSS", extensionDir: MathJax.OutputJax.extensionDir + "/HTML-CSS", autoloadDir: MathJax.OutputJax.directory + "/HTML-CSS/autoload", @@ -147,10 +147,8 @@ MathJax.Hub.Register.StartupHook("End Config",[function (HUB,HTMLCSS) { !HUB.Browser.versionAtLeast(CONFIG.minBrowserVersion[HUB.Browser]||0.0)) { HTMLCSS.Translate = CONFIG.minBrowserTranslate; HUB.Config({showProcessingMessages: false}); - MathJax.Message.Set( - MathJax.Localization._(["Message", "MathJaxNotSupported"], - "Your browser does not support MathJax"), - null,4000); + MathJax.Message.Set(["MathJaxNotSupported", + "Your browser does not support MathJax"],null,4000); HUB.Startup.signal.Post("MathJax not supported"); } diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index eae80fae3..3739619fe 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -28,6 +28,12 @@ (function (AJAX,HUB,HTMLCSS) { var MML, isMobile = HUB.Browser.isMobile; + + var MESSAGE = function () { + var data = [].slice.call(arguments,0); + data[0][0] = ["HTML-CSS",data[0][0]]; + return MathJax.Message.Set.apply(MathJax.Message,data); + }; var FONTTEST = MathJax.Object.Subclass({ timeout: (isMobile? 15:8)*1000, // timeout for loading web fonts @@ -131,12 +137,7 @@ loadWebFont: function (font) { HUB.Startup.signal.Post("HTML-CSS Jax - Web-Font "+HTMLCSS.fontInUse+"/"+font.directory); - var n = MathJax.Message.File( - // Localization: Message.File(fileName) will write "Loading "+fileName - // Here, this will become "Loading Web-Font "+fileName. Does it work - // for all languages (word order might be different)? - "Web-Font "+HTMLCSS.fontInUse+"/"+font.directory - ); + var n = MESSAGE(["LoadWebFont","Loading webfont %1",HTMLCSS.fontInUse+"/"+font.directory]); var done = MathJax.Callback({}); // called when font is loaded var callback = MathJax.Callback(["loadComplete",this,font,n,done]); AJAX.timer.start(AJAX,[this.checkWebFont,font,callback],0,this.timeout); @@ -156,17 +157,11 @@ if (!this.webFontLoaded) {HTMLCSS.loadWebFontError(font,done)} else {done()} }, loadError: function (font) { - MathJax.Message.Set( - MathJax.Localization._("Message", "CantLoadWebFont", - "Can't load web font %1", HTMLCSS.fontInUse+"/"+font.directory), - null,2000); + MESSAGE(["CantLoadWebFont","Can't load web font %1",HTMLCSS.fontInUse+"/"+font.directory],null,2000); HUB.Startup.signal.Post(["HTML-CSS Jax - web font error",HTMLCSS.fontInUse+"/"+font.directory,font]); }, firefoxFontError: function (font) { - MathJax.Message.Set( - MathJax.Localization._(["Message", "FirefoxCantLoadWebFont"], - "Firefox can't load web fonts from a remote host"), - null,3000); + MESSAGE(["FirefoxCantLoadWebFont","Firefox can't load web fonts from a remote host"],null,3000); HUB.Startup.signal.Post("HTML-CSS Jax - Firefox web fonts on remote host error"); }, @@ -334,11 +329,8 @@ HUB.Startup.signal.Post("HTML-CSS Jax - using image fonts"); } } else { - MathJax.Message.Set( - MathJax.Localization._(["Message", "CantFindFontUsing"], - "Can't find a valid font using %1", - "["+this.config.availableFonts.join(", ")+"]"), - null,3000); + MESSAGE(["CantFindFontUsing","Can't find a valid font using %1", + "["+this.config.availableFonts.join(", ")+"]"],null,3000); this.FONTDATA = { TeX_factor: 1, baselineskip: 1.2, lineH: .8, lineD: .2, ffLineH: .8, FONTS: {}, VARIANT: {normal: {fonts:[]}}, RANGES: [], @@ -1486,10 +1478,7 @@ this.imgFonts = true; HUB.Startup.signal.Post("HTML-CSS Jax - switch to image fonts"); HUB.Startup.signal.Post("HTML-CSS Jax - using image fonts"); - MathJax.Message.Set( - MathJax.Localization._(["Message", "WebFontNotAvailable"], - "Web-Fonts not available -- using image fonts instead"), - null,3000); + MESSAGE(["WebFontNotAvailable","Web-Fonts not available -- using image fonts instead"],null,3000); AJAX.Require(this.directory+"/imageFonts.js",done); } else { this.allowWebFonts = false; diff --git a/unpacked/jax/output/SVG/autoload/mglyph.js b/unpacked/jax/output/SVG/autoload/mglyph.js index 7a46b84a1..40fee2d86 100644 --- a/unpacked/jax/output/SVG/autoload/mglyph.js +++ b/unpacked/jax/output/SVG/autoload/mglyph.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/jax/output/SVG/autoload/mglyph.js @@ -27,7 +28,8 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () { var VERSION = "2.1"; var MML = MathJax.ElementJax.mml, SVG = MathJax.OutputJax.SVG, - BBOX = SVG.BBOX; + BBOX = SVG.BBOX, + LOCALE = MathJax.Localization; var XLINKNS = "http://www.w3.org/1999/xlink"; @@ -73,8 +75,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () { } if (this.img.status !== "OK") { err = MML.merror( - MathJax.Localization._(["MathML", "BadMglyph"], - "Bad mglyph: %1", values.src) + LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src) ).With({mathsize:"75%"}); this.Append(err); svg = err.toSVG(); this.data.pop(); } else { diff --git a/unpacked/localization/fr/FontWarnings.js b/unpacked/localization/fr/FontWarnings.js new file mode 100644 index 000000000..18f87ef93 --- /dev/null +++ b/unpacked/localization/fr/FontWarnings.js @@ -0,0 +1,53 @@ +MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ + FontWarnings: { + isLoaded: true, + strings: { + + webFont: + "MathJax utilise les polices Web pour afficher les expressions " + + "mathématiques sur cette page. Celles-ci mettent du temps à être "+ + "téléchargées et la page serait affichée plus rapidement si vous "+ + "installiez les polices mathématiques directement dans le dossier "+ + "des polices de votre système.", + + imageFonts: + "MathJax utilise des images de caractères plutôt que les polices "+ + "Web ou locales. Ceci rend le rendu plus lent que la normale et "+ + "les expressions mathématiques peuvent ne pas s'imprimer à la "+ + "résolution maximale de votre imprimante", + + noFonts: + "MathJax n'est pas parvenu à localiser une police pour afficher "+ + "les expressions mathématiques et les images de caractères ne "+ + "sont pas disponibles. Comme solution de dernier recours, il "+ + "utilise des caractères Unicode génériques en espérant que votre "+ + "navigateur sera capable de les afficher. Certains pourront ne "+ + "être rendus de façon incorrect voire pas du tout.", + + webFonts: + "La plupart des navigateurs modernes permettent de télécharger "+ + "des polices à partir du Web. En mettant à jour pour une version "+ + "plus récente de votre navigateur (ou en changeant de navigateur) "+ + "la qualité des expressions mathématiques sur cette page pourrait "+ + "être améliorée.", + + fonts: + "%1 MathJax peut utiliser les %2 ou bien les %3. Téléchargez et"+ + "installez l'une de ces familles de polices pour améliorer votre"+ + "expérience avec MathJax.", + + PageDesigned: + "%1 Cette page est conçue pour utiliser les %2. Téléchargez "+ + " et installez ces polices pour améliorer votre expérience "+ + "avec MathJax", + + STIXfonts: + "Polices STIX", + + TeXfonts: + "Polices TeX de MathJax" + } + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/FontWarnings.js"); \ No newline at end of file diff --git a/unpacked/localization/fr/MathML.js b/unpacked/localization/fr/MathML.js new file mode 100644 index 000000000..2e53b2436 --- /dev/null +++ b/unpacked/localization/fr/MathML.js @@ -0,0 +1,49 @@ +MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ + MathML: { + isLoaded: true, + strings: { + + BadMglyph: + "Élement mglyph incorrect: %1", + + BadMglyphFont: + "Police de caractère incorrecte: %1", + + MathPlayer: + "MathJax n'est pas parvenu à configurer MathPlayer.\n\n"+ + "Vous devez d'abord installer MathPlayer. Si c'est déjà le cas,\n"+ + "vos paramètres de sécurités peuvent empêcher l'exécution des\n"+ + "contrôles ActiveX. Sélectionnez Options Internet dans le menu\n"+ + "Outils et sélectionnez l'onglet Sécurité. Appuyez ensuite sur\n"+ + "le menu Niveau Personalisé. Assurez vous que les paramètres\n"+ + "Exécution des contrôles ActiveX et Comportements des exécutables\n"+ + "et des scripts sont activés.\n\n"+ + "Actuellement, vous verez des messages d'erreur à la place des\n"+ + "expressions mathématiques.", + + CantCreateXMLParser: + "MathJax ne peut créer un analyseur grammatical XML pour le MathML", + + UnknownNodeType: + "Type de noeud inconnu: %1", + + UnexpectedTextNode: + "Noeud de texte inattendu: %1", + + ErrorParsingMathML: + "Erreur lors de l'analyse grammaticale du code MathML", + + ParsingError: + "Erreur lors de l'analyse du code MathML: %1", + + MathMLSingleElement: + "Le code MathML doit être formé d'un unique élément", + + MathMLRootElement: + "Le code MathML doit être formé d'un élément et non un élément %1" + + } + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/MathML.js"); \ No newline at end of file diff --git a/unpacked/localization/fr/MathMenu.js b/unpacked/localization/fr/MathMenu.js new file mode 100644 index 000000000..5d252526a --- /dev/null +++ b/unpacked/localization/fr/MathMenu.js @@ -0,0 +1,118 @@ +MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ + MathMenu: { + isLoaded: true, + strings: { + + Show: "Voir Maths Comme", + MathMLcode: "du Code MathML", + OriginalMathML: "d'Origine MathML", + TeXCommands: "Commandes TeX", + AsciiMathInput: "AsciiMathml Entrée", + Original: "Forme Originale", + ErrorMessage: "Message d'Erreur", + texHints: "Voir les notes TeX dans MathML", + Settings: "Paramètres Maths", + ZoomTrigger: "Trigger Zoom", + Hover: "Flotter", + Click: "Clic de Souris", + DoubleClick: "Double-Clic", + NoZoom: "Pas de Zoom", + TriggerRequires: "Trigger Nécessite", + Option: "Option", + Alt: "Alt", + Command: "Command", + Control: "Control", + Shift: "Shift", + ZoomFactor: "Facteur de Zoom", + Renderer: "Traduire Maths", + MPHandles: "Laissez MathPlayer Gérer:", + MenuEvents: "Sélections du menu", + MouseEvents: "Êvénements de la Souris", + MenuAndMouse: "Les Êvénements de Menu et de la Souris", + FontPrefs: "Préférences des Polices", + ForHTMLCSS: "Pour le HTML-CSS:", + Auto: "Auto", + TeXLocal: "TeX (local)", + TeXWeb: "TeX (web)", + TeXImage: "TeX (image)", + STIXLocal: "STIX (local)", + ContextMenu: "Menu Contextuel", + Browser: "Navigateur", + Scale: "Ajuster tous les Maths ...", + Discoverable: "Mettez en Surbrillance lors de Survol", + About: "À propos de MathJax", + Help: "Aide MathJax", + + localTeXfonts: "utilisant les polices locales TeX", + webTeXfonts: "utilisant les polices internet TeX", + imagefonts: "utilisant les polices d'image", + localSTIXfonts: "utilisant les polices locales STIX", + webSVGfonts: "utilisant les polices internet SVG", + genericfonts: "utilisant les polices locales génériques", + + wofforotffonts: "les polices woff ou otf", + eotffonts: "les polices eot", + svgfonts: "les polices svg", + + WebkitNativeMMLWarning: + "Votre navigateur ne semble pas comporter de support MathML, " + + "changer le mode de rendu pourrait rendre illisibles " + + "les expressions mathématiques.", + + MSIENativeMMLWarning: + "Internet Explorer a besoin de module complémentaire MathPlayer " + + "pour afficher le MathML.", + + OperaNativeMMLWarning: + "Le support MathML d'Opera est limité, changer le mode de rendu " + + "pourrait entrainer un affichage médiocre de certaines expressions.", + + SafariNativeMMLWarning: + "Le support MathML natif de votre navigateur ne comporte pas " + + "toutes les fonctionnalités requises par MathJax, certaines " + + "expressions pourront donc ne pas s'afficher correctement.", + + FirefoxNativeMMLWarning: + "Le support MathML natif de votre navigateur ne comporte pas " + + "toutes les fonctionnalités requises par MathJax, certaines " + + "expressions pourront donc ne pas s'afficher correctement.", + + SwitchAnyway: + "Êtes vous certain de vouloir changer le mode de rendu ?\n\n" + + "Appuyez sur OK pour valider ou Annuler pour continuer avec le " + + "mode de rendu actuellement sélectionné.", + + ScaleMath: + "Mise à l'échelle des expressions mathématiques (par rapport au " + + "text environnant) de %1%%", + + NonZeroScale: + "L'échelle ne peut être nulle", + + PercentScale: + "L'échelle doit être un pourcentage (e.g. 120%%)", + + IE8warning: + "Ceci désactivera le menu de MathJax et les fonctionalités de " + + "zoom mais vous pourrez toujours obtenir le menu de MathJax " + + "en utilisant la commande Alt+Clic sur une expression.\n\n" + + "Êtes vous certain de vouloir choisir les options de MathPlayer?", + + IE9warning: + "Le menu contextuel de MathJax sera désactivé, " + + "mais vous pourrez toujours obtenir le menu de MathJax " + + "en utilisant la commande Alt-Clic sur une expression.", + + NoOriginalForm: + "Aucune forme d'origine disponible.", + + Close: + "Fermer", + + EqSource: + "Source de l'équation MathJax" + } + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/MathMenu.js"); \ No newline at end of file diff --git a/unpacked/localization/fr/TeX.js b/unpacked/localization/fr/TeX.js new file mode 100644 index 000000000..33a83eea8 --- /dev/null +++ b/unpacked/localization/fr/TeX.js @@ -0,0 +1,254 @@ +MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ + TeX: { + isLoaded: true, + strings: { + ExtraOpenMissingClose: + "Accolade ouvrant manquante ou accolade fermante non attendue", + + ExtraCloseMissingOpen: + "Accolade fermante non attendue ou accolade ouvrante manquante", + + MissingLeftExtraRight: + "Commande \\left manquante or ou commande \\right non attendue", + + MissingScript: + "Argument en exposant ou en indice manquant", + + ExtraLeftMissingRight: + "Commande \\left inattendue or ou commande \\right manquante", + + Misplaced: + "Mauvaise position pour la commande %1", + + MissingOpenForScript: + "Accolade ouvrante manquante pour le script %1", + + AmbiguousUseOf: + "Usage ambigu de la commande %1", + + EnvBadEnd: + "\\begin{%1} s'est terminé par un \\end{%2}", + + EnvMissingEnd: + "\\end{%1} manquant", + + MissingBoxFor: + "Boite manquante pour la commande %1", + + MissingCloseBrace: + "Accolade fermante manquante", + + UndefinedControlSequence: + "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: + "Double exposant: utilisez des accolades pour clarifier", + + DoubleSubscripts: + "Double indice: utilisez des accolades pour clarifier", + + DoubleExponentPrime: + "Un prime entraine un double exposant: utilisez "+ + "des accolades pour clarifier", + + CantUseHash1: + "Vous ne pouvez pas utilisez le caractère #, indiquant un "+ + "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: + "La commande %1 doit être placée à l'intérieur d'une section "+ + "\\left ... \right", + + MisplacedLimits: + "La commande %1 n'est autorisée que sur les opérateurs", + + MisplacedMoveRoot: + "La commande %1 n'est autorisée qu'à l'intérieur d'une racine", + + MultipleMoveRoot: + "Commande %1 redondante", + + IntegerArg: + "L'argument de la commande %1 doit être un entier", + + PositiveIntegerArg: + "L'argument de la commande %1 doit être un entier strictement "+ + "positif", + + NotMathMLToken: + "L'élément %1 n'est pas un élément MathML élémentaire", + + InvalidMathMLAttr: + "Attribut MathML non valide: %1", + + UnknownAttrForElement: + "Attribut %1 inconnu pour l'élément %2", + + 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?", + + 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?", + + MissingArgFor: + "Argument manquant pour la commande %1", + + ExtraAlignTab: + "Tabulation d'alignement non attendu pour le texte de la commande "+ + "\\cases", + + BracketMustBeDimension: + "L'argument entre crochets de la commande %1 doit être une "+ + "dimension", + + InvalidEnv: + "Nom d'environnement '%1' non valide", + + UnknownEnv: + "Environnement '%1' inconnu", + + ExtraClose: + "Accolade fermante non attendue", + + ExtraCloseInBrackets: + "Accolade fermante non attendue avant le crochet fermant.", + + MissingCloseBracket: + "Impossible de trouver le crochet fermant pour l'argument de la "+ + "commande %1", + + MissingOrUnrecognizedDelim: + "Délimiteur manquant ou non reconnu pour la commande %1", + + MissingDimOrUnits: + "Dimension ou unité manquante pour la commande %1", + + ExtraCloseBraceInUpTo: + "Accolade fermante non attendue avant la commande %1", + + TokenNotFoundForCommand: + "Impossible de trouver la commande %1 pour la commande %2", + + MathNotTerminated: + "Expression mathématique non terminée à l'intérieur de cette boite "+ + "de texte", + + IllegalMacroParam: + "Paramètre de référence de macro non autorisé", + + MaxBufferSize: + "Taille maximale du tampon interne de MathJax dépassée. " + + "Il y a t'il un appel de macro récursif?", + + CommandNotAllowedInEnv: + "La commande %1 n'est pas autorisé à l'intérieur de "+ + "l'environnement %2", + + MultipleCommand: + "Usage multiple de la commande %1", + + MultipleLabel: + "Étiquette '%1' déjà définie", + + CommandAtTheBeginingOfLine: + "La commande %1 doit être placée en début de ligne", + + IllegalAlign: + "Alignement non autorisé pour la commande %1", + + BadMathStyleFor: + "Style mathématique non valide pour la commande %1", + + ErroneousNestingEq: + "Emboitement incorrect des structures d'équation", + + MultipleRowsOneCol: + "Les lignes multiples doivent avoir exactement une colonne", + + NoClosingDelim: + "Impossible de trouver le délimiteur fermant pour la commande %1", + + NoClosingChar: + "Impossible de trouver le délimiteur '%1' fermant", + + MultipleBBoxProperty: + "La propriété %1 de la commande %2 spécifiée deux fois", + + InvalidBBoxProperty: + "La valeur '%1' ne semble pas être une couleur, une dimension ou "+ + "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?" + } + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/TeX.js"); \ No newline at end of file diff --git a/unpacked/localization/fr/fr.js b/unpacked/localization/fr/fr.js new file mode 100644 index 000000000..e48d29b37 --- /dev/null +++ b/unpacked/localization/fr/fr.js @@ -0,0 +1,72 @@ +MathJax.Hub.Insert(MathJax.Localization.strings.fr,{ + isLoaded: true, + domains: { + "_": { + isLoaded: true, + strings: { + + CookieConfig: + "MathJax a trouvé un cookie de configuration utilisateur qui inclut"+ + "du code à exécuter. Souhaitez vous l'exécuter?\n\n"+ + "(Choisissez Annuler sauf si vous avez créé ce cookie vous-même", + + MathProcessingError: + "Erreur de traitement de la formule mathématique", + + MathProcessingErrorHTML: + ["[Erreur de traitement de la formule mathématique]"], + + MathErrorHTML: + ["[Erreur dans la formule mathématique]"], + + LoadFile: "Téléchargement %1", + + Loading: "Téléchargement", + + LoadFailed: "Échec du téléchargement de %1", + + CantLoadWebFont: "Impossible de télécharcharger la police Web %1", + + ProcessMath: "Traitement des maths: %1%%", + + Processing: "Traitement", + + TypesetMath: "Composition des maths: %1%%", + + Typesetting: "Composition", + + FirefoxCantLoadWebFont: + "Firefox ne peut télécharger les polices Web à partir d'un hôte"+ + "distant", + + CantFindFontUsing: + "Impossible de trouver une police valide en utilisant %1", + + WebFontsNotAvailable: + "Polices Web non disponibles -- des images de caractères vont être"+ + "utilisées à la place", + + MathJaxNotSupported: + "Votre navigateur ne supporte pas MathJax" + + } + }, + MathMenu: {}, + FontWarnings: {}, + "v1.0-warning": {}, + TeX: {}, + MathML: {} + }, + + plural: function(n) { + if (0 <= n && n < 2) {return 1} // one + return 2; // other + }, + + number: function(n) { + return n.replace(".", ","); // replace dot by comma + } + +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/fr.js"); \ No newline at end of file diff --git a/unpacked/localization/fr/v1.0-warning.js b/unpacked/localization/fr/v1.0-warning.js new file mode 100644 index 000000000..203ca9aeb --- /dev/null +++ b/unpacked/localization/fr/v1.0-warning.js @@ -0,0 +1,15 @@ +MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ + "v1.0-warning": { + isLoaded: true, + strings: { + MissingConfig: + "%1 MathJax ne charge plus de fichier de configuration par défaut; "+ + "vous devez spécifier ces fichiers de façons explicites. Cette "+ + "page semble utiliser l'ancien fichier de configuration par "+ + "défaut %2 and doit donc être mise à jour. Ceci est expliqué "+ + "en détails à l'addresse suivante: %3" + } + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/v1.0-warning.js"); \ No newline at end of file From 535c033e24090510883f708c6f9bc613a0cd08ee Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Fri, 5 Apr 2013 18:45:50 -0400 Subject: [PATCH 09/41] Handle HTML snippets better, and fix up messages in FontWarnings and v1.0-warning extensions. Fix French menu items and a few others (thanks Fred). Fix scale-all-math dialog. --- unpacked/MathJax.js | 312 +++++++++-------------- unpacked/extensions/FontWarnings.js | 128 ++++++---- unpacked/extensions/MathMenu.js | 4 +- unpacked/extensions/v1.0-warning.js | 68 ++--- unpacked/jax/output/HTML-CSS/jax.js | 2 +- unpacked/localization/fr/FontWarnings.js | 6 +- unpacked/localization/fr/HTML-CSS.js | 26 ++ unpacked/localization/fr/MathML.js | 2 +- unpacked/localization/fr/MathMenu.js | 48 ++-- unpacked/localization/fr/TeX.js | 2 +- unpacked/localization/fr/fr.js | 26 +- unpacked/localization/fr/v1.0-warning.js | 8 +- 12 files changed, 292 insertions(+), 340 deletions(-) create mode 100644 unpacked/localization/fr/HTML-CSS.js diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 1e0033d68..207097708 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax.js @@ -1056,205 +1057,127 @@ MathJax.Localization = { locale: "fr", directory: "[MathJax]/localization", - strings: {fr: {}}, + strings: { + en: {isLoaded: true}, // nothing needs to be loaded for this + fr: {} + }, - _: function (messageId, phrase) { - - // These variables are used in string parsing - var locale = this; - var args = arguments; - var i, s, m, resultString, resultArray; - - function parseNextUnicodePoint(appendToResult) - { - var n = s.charCodeAt(i); - if (n <= 0xD7FF || 0xE000 <= n) { - // Code points U+0000 to U+D7FF and U+E000 to U+FFFF. - // Append the character. - if (appendToResult) resultString += s[i] - i++; - return; - } else if (i+1 < m) { - // Code points U+10000 to U+10FFFF - // Append the surrogate pairs. - if (appendToResult) { resultString += s[i]; resultString += s[i+1]; } - i+=2 - return; - } - // Ignore lead surrogate at the end of the string. - // This should not happen with valid unicode string. - i++; + // + // The pattern for substitution escapes: + // %n or %{n} or %{plural:%n|option1|option1|...} or %c + // + pattern: /%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%(?:\d+|\{\d+\}|.)|[^\}])*)+\}|.)/g, + + _: function (id,phrase) { + if (phrase instanceof Array) {return this.processSnippet(id,phrase)} + return this.processString(this.lookupPhrase(id,phrase),[].slice.call(arguments,2)); + }, + + processString: function (string,args,domain) { + // + // Process arguments for substitution + // If the argument is a snippet (and we are processing snippets) do so, + // Otherwise, if it is a number, convert it for the lacale + // + for (var i = 0, m = args.length; i < m; i++) { + if (domain && args[i] instanceof Array) {args[i] = this.processSnippet(domain,args[i])} } - - function parseArgument(appendToResult) - { - if (!(/\d/.test(s[0]))) return false; - - // %INTEGER argument substitution - var argIndex = s.match(/^\d+/)[0]; - i += argIndex.length; - var key = +argIndex+1; - if (key in args) { - if (appendToResult) { - var e = args[key]; - if (e instanceof Array) { - // if that's an array, concatenate it to the result array - resultArray.push(resultString); - resultArray = resultArray.concat(e); - resultString = ""; - } else if (typeof e === "number") { - // if that's a number, append a localized version. - resultString += locale.number(e.toString()) - } else { - // otherwise, just concatenate it to the result string - resultString += e; - } + // + // Split string at escapes and process them individually + // + var parts = string.split(this.pattern); + for (var i = 1, m = parts.length; i < m; i += 2) { + var c = parts[i].charAt(0); // first char will be { or \d or a char to be kept literally + if (c >= "0" && c <= "9") { // %n + parts[i] = args[parts[i]-1] || "???"; + if (typeof parts[i] === "number") parts[i] = this.number(parts[i]); + } else if (c === "{") { // %{n} or %{plural:%n|...} + c = parts[i].substr(1); + if (c >= "0" && c <= "9") { // %{n} + parts[i] = args[parts[i].substr(1,parts[i].length-2)-1] || "???"; + if (typeof parts[i] === "number") parts[i] = this.number(parts[i]); + } else { // %{plural:%n|...} + var match = parts[i].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/); + if (match[1] === "plural") { + var n = args[match[2]-1]; + if (typeof n === "undefined") { + parts[i] = "???"; // argument doesn't exist + } else { + n = this.plural(n) - 1; // index of the form to use + var plurals = match[3].replace(/%\|/g,"%\uEFEF").split(/\|/); // the parts (replacing %| with a special character) + if (n >= 0 && n < plurals.length) { + parts[i] = this.processString(plurals[n].replace(/\uEFEF/g,"|"),args,domain); + } else { + parts[i] = "???"; // no string for this index + } + } + } else {parts[i] = "%"+parts[i]} // not "plural:put back the % and leave unchanged } - return true; } - - // invalid index: just %INTEGER and continue - if (appendToResult) { resultString += "%" + argIndex; } - i++; - return true; - } - - function parseInteger(appendToResult) - { - var number = s.match(/^\{(\d+)\}/); - if (!number) return false; - - // %{INTEGER} escaped integer - if (appendToResult) { resultString += number[1]; } - i += number[0].length; - return true; } - - function parseChoiceBlock(blockName, choiceFunction) - { - var pattern = "^\\{"+blockName+":%(\\d)+\\|"; - var blockStart = s.match(pattern); - if (!blockStart) return false; - - var key = +blockStart[1]+1; - if (!(key in args)) return false; - - // %\{blockName:%INTEGER|form1|form2 ... \} - i = blockStart[0].length; - - var choiceIndex = choiceFunction(args[key]), j = 1; - var isChosenBlock = (j === choiceIndex); - var blockFound = isChosenBlock; - - while (i < m) { - if (s[i] == "|") { - // new choice block - i++; j++; - isChosenBlock = (j === choiceIndex); - if (isChosenBlock) blockFound = true; - continue; + // + // If we are not forming a snippet, return the completed string + // + if (!domain) {return parts.join("")} + // + // We need to return an HTML snippet, so buld it from the + // broken up string with inserted parts (that could be snippets) + // + var snippet = [], part = ""; + for (i = 0; i < m; i++) { + part += parts[i]; i++; // add the string and move on to substitution result + if (i < m) { + if (parts[i] instanceof Array) { // substitution was a snippet + snippet.push(part); // add the accumulated string + snippet = snippet.concat(parts[i]); // concatenate the substution snippet + part = ""; // start accumulating a new string + } else { // substitution was a string + part += parts[i]; // add to accumulating string } - if (s[i] == "}") { - // closing brace - i++; - break; - } - if (s[i] != "%" || i+1 == m) { - // normal char or % at the end of the string - parseNextUnicodePoint(isChosenBlock); - continue; - } - - // keep only the substring after the % - i++; s = s.substr(i); m -= i; i = 0; - - // %INTEGER argument substitution - if (parseArgument(isChosenBlock)) continue; - - // %{INTEGER} escaped integer - if (parseInteger(isChosenBlock)) continue; - - // %CHAR: escaped character - parseNextUnicodePoint(isChosenBlock); - continue; } - - if (!blockFound) { - i = 0; - return false; - } - - return true; } - - function transformString(string) - { - s = string; - i = 0; - m = s.length; - resultString = ""; - resultArray = []; - - while (i < m) { - if (s[i] != "%" || i+1 == m) { - // normal char or % at the end of the string - parseNextUnicodePoint(true); - continue; - } - - // keep only the substring after the % - i++; s = s.substr(i); m -= i; i = 0; - - // %INTEGER argument substitution - if (parseArgument(true)) continue; - - // %{INTEGER} escaped integer - if (parseInteger(true)) continue; - - // %\{plural:%INTEGER|form1|form2 ... \} plural forms - if (parseChoiceBlock("plural", locale.plural)) continue; - - // %CHAR: escaped character - parseNextUnicodePoint(true); - continue; + if (part !== "") {snippet.push(part)} // add final string + return snippet; + }, + + processSnippet: function (domain,snippet) { + var result = []; // the new snippet + // + // Look through the original snippet for + // strings or snippets to translate + // + for (var i = 0, m = snippet.length; i < m; i++) { + if (snippet[i] instanceof Array) { + // + // This could be a sub-snippet: + // ["tag"] or ["tag",{properties}] or ["tag",{properties},snippet] + // Or it could be something to translate: + // [id,string,args] or [domain,snippet] + var data = snippet[i]; + if (typeof data[1] === "string") { // [id,string,args] + var id = data[0]; if (!(id instanceof Array)) {id = [domain,id]} + var phrase = this.lookupPhrase(id,data[1]); + result = result.concat(this.processString(phrase,data.slice(2),domain)); + } else if (data[1] instanceof Array) { // [domain,snippet] + result = result.concat(this.processSnippet.apply(this,data)); + } else if (data.length >= 3) { // ["tag",{properties},snippet] + result.push([data[0],data[1],this.processSnippet(domain,data[2])]); + } else { // ["tag"] or ["tag",{properties}] + result.push(snippet[i]); + } + } else { // a string + result.push(snippet[i]); } - - if (resultArray.length == 0) return resultString; - - return resultArray; - } - - function transformHTMLSnippet(snippet) - { - for (var key in snippet) { - var e = snippet[key]; - if (typeof e === "string") { - // transform the string content - snippet[key] = transformString(e); - continue; - } - if (e[1]) { - // transform attribute values - for (var key2 in e[1]) { - snippet[key][1][key2] = transformString(e[1][key2]); - } - } - if (e[2]) { - // transform the HTML content - snippet[key][2] = transformHTMLSnippet(e[2]); - } - } - return snippet; } + return result; + }, + lookupPhrase: function (id,phrase,domain) { // // Get the domain and messageID // - var domain = "_"; - if (messageId instanceof Array) { - domain = (messageId[0] || "_"); - messageId = (messageId[1] || ""); - } + if (!domain) {domain = "_"} + if (id instanceof Array) {domain = (id[0] || "_"); id = (id[1] || "")} // // Check if the data is available and if not, // load it and throw a restart error so the calling @@ -1270,18 +1193,14 @@ MathJax.Localization = { if (localeData) { if (localeData.domains && domain in localeData.domains) { var domainData = localeData.domains[domain]; - if (domainData.strings && messageId in domainData.strings) - {phrase = domainData.strings[messageId]} + if (domainData.strings && id in domainData.strings) + {phrase = domainData.strings[id]} } } - - if (typeof phrase === "string") { - // handle the phrase as a simple string - return transformString(phrase); - } - - // handle the phrase as a HTML snippet - return transformHTMLSnippet(phrase); + // + // return the translated phrase + // + return phrase; }, // @@ -2004,8 +1923,7 @@ MathJax.Hub = { // Put up final message, reset the state and return // if (state.scripts.length && this.config.showProcessingMessages) - // Localization: see filterText - {MathJax.Message.Set(["ProcessMath","Processing math: %1%%",100],0)} + {MathJax.Message.Set(["ProcessMath","Processing math: %1%%",100],0)} state.start = new Date().getTime(); state.i = state.j = 0; return null; }, diff --git a/unpacked/extensions/FontWarnings.js b/unpacked/extensions/FontWarnings.js index 3da586a33..9350456bf 100644 --- a/unpacked/extensions/FontWarnings.js +++ b/unpacked/extensions/FontWarnings.js @@ -88,11 +88,8 @@ (function (HUB,HTML) { var VERSION = "2.1.1"; - var _ = function (id) { - return MathJax.Localization._.apply(MathJax.Localization, - [["FontWarnings",id]].concat([].slice.call(arguments,1)) - ); - } + var STIXURL = "http://www.stixfonts.org/"; + var MATHJAXURL = "http://www.mathjax.org/help-v2/fonts"; var CONFIG = HUB.CombineConfig("FontWarnings",{ // @@ -119,37 +116,35 @@ // The messages for the various situations // Message: { - // Localization: - // how do we ensure it is updated when the language is changed? + webFont: [ ["closeBox"], - _("webFont", + ["webFont", "MathJax is using web-based fonts to display the mathematics "+ "on this page. These take time to download, so the page would "+ "render faster if you installed math fonts directly in your "+ - "system's font folder."), + "system's font folder."], ["fonts"] ], imageFonts: [ ["closeBox"], - _("imageFonts", - "MathJax is using its image fonts rather than local or web-based fonts. "+ - "This will render slower than usual, and the mathematics may not print "+ - "at the full resolution of your printer."), - + ["imageFonts", + "MathJax is using its image fonts rather than local or web-based fonts. "+ + "This will render slower than usual, and the mathematics may not print "+ + "at the full resolution of your printer."], ["fonts"], ["webfonts"] ], noFonts: [ ["closeBox"], - _("noFonts", - "MathJax is unable to locate a font to use to display "+ - "its mathematics, and image fonts are not available, so it "+ - "is falling back on generic unicode characters in hopes that "+ - "your browser will be able to display them. Some characters "+ - "may not show up properly, or possibly not at all."), + ["noFonts", + "MathJax is unable to locate a font to use to display "+ + "its mathematics, and image fonts are not available, so it "+ + "is falling back on generic unicode characters in hopes that "+ + "your browser will be able to display them. Some characters "+ + "may not show up properly, or possibly not at all."], ["fonts"], ["webfonts"] ] @@ -183,40 +178,48 @@ [["span",{style:{position:"relative", bottom:".2em"}},["x"]]] ]], - // Localization: - // - decide HTML snippet format - // how do we ensure it is updated when the language is changed? - webFonts: [ - ["p"], - _("webFonts", - "Most modern browsers allow for fonts to be downloaded over the web. "+ - "Updating to a more recent version of your browser (or changing"+ - "browsers) could improve the quality of the mathematics on this page.") - ], + webfonts: [ + ["p"], + ["webfonts", + "Most modern browsers allow for fonts to be downloaded over the web. "+ + "Updating to a more recent version of your browser (or changing "+ + "browsers) could improve the quality of the mathematics on this page." + ] + ], + + fonts: [ + ["p"], + ["fonts", + "MathJax can use either the %1 or the %2", + [["a",{href:STIXURL,target:"_blank"},[["STIXfonts","STIX fonts"]]]], + [["a",{href:MATHJAXURL,target:"_blank"},[["TeXfonts","MathJax TeX fonts"]]]] + ] + ], + +// fonts: [ +// ["p"], +// ["fonts", +// "MathJax can use either the [STIX fonts](%1) or the [MathJax TeX fonts](%2)", +// "http://www.stixfonts.org/","http://www.mathjax.org/help-v2/fonts/"] +// ], - fonts: _("fonts", - "%1 MathJax can use either the %2 or the %3 "+ - ". Download and install either one to improve your MathJax experience.", - [["p"]], - [["a",{href:"http://www.stixfonts.org/",target:"_blank"}, - _("STIXfonts", "STIX fonts")]], - [["a",{href:"http://www.mathjax.org/help-v2/fonts/",target:"_blank"}, - [_("TeXfonts", "MathJax TeX fonts")]]] - ), - - STIXfonts: _("PageDesigned", - "%1 This page is designed to use the %2."+ - " Download and install those fonts to improve your MathJax experience.", - [["p"]], - [["a",{href:"http://www.mathjax.org/help-v2/fonts/",target:"_blank"}, - [_("STIXfonts", "STIX fonts")]]]), + STIXfonts: [ + ["p"], + ["PageDesigned", + "This page is designed to use the %1. " + + "Download and install those fonts to improve your MathJax experience.", + [["a",{href:STIXURL,target:"_blank"},[["STIXfonts","STIX fonts"]]]] + ] + ], - TeXfonts: _("PageDesigned", - "%1 This page is designed to use the %2."+ - " Download and install those fonts to improve your MathJax experience.", - [["p"]], - [["a",{href:"http://www.mathjax.org/help-v2/fonts/",target:"_blank"}, - [_("TeXfonts", "MathJax TeX fonts")]]]) + TeXfonts: [ + ["p"], + ["PageDesigned", + "This page is designed to use the %1. " + + "Download and install those fonts to improve your MathJax experience.", + [["a",{href:MATHJAXURL,target:"_blank"},[["TeXfonts","MathJax TeX fonts"]]]] + ] + ] }, @@ -251,10 +254,17 @@ } else {delete CONFIG.messageStyle.filter} CONFIG.messageStyle.maxWidth = (document.body.clientWidth-75) + "px"; var i = 0; while (i < data.length) { - if (data[i] instanceof Array && CONFIG.HTML[data[i][0]]) - {data.splice.apply(data,[i,1].concat(CONFIG.HTML[data[i][0]]))} else {i++} + if (data[i] instanceof Array) { + if (data[i].length === 1 && CONFIG.HTML[data[i][0]]) { + data.splice.apply(data,[i,1].concat(CONFIG.HTML[data[i][0]])); + } else if (typeof data[i][1] === "string") { + data.splice.apply(data,[i,1].concat(message)); + i += message.length; + } else {i++} + } else {i++} } - DATA.div = HTMLCSS.addElement(frame,"div",{id:"MathJax_FontWarning",style:CONFIG.messageStyle},data); + DATA.div = HTMLCSS.addElement(frame,"div", + {id:"MathJax_FontWarning",style:CONFIG.messageStyle},data); if (CONFIG.removeAfter) { HUB.Register.StartupHook("End",function () {DATA.timer = setTimeout(FADEOUT,CONFIG.removeAfter)}); @@ -296,7 +306,13 @@ if (message.match(/- Web-Font/)) {if (localFonts) {MSG = "webFont"}} else if (message.match(/- using image fonts/)) {MSG = "imageFonts"} else if (message.match(/- no valid font/)) {MSG = "noFonts"} - if (MSG && CONFIG.Message[MSG]) {CREATEMESSAGE(CONFIG.Message[MSG])} + if (MSG && CONFIG.Message[MSG]) { + MathJax.Callback.Queue( + ["loadDomain",MathJax.Localization,"FontWarnings"], // load locale + ["loadDomain",MathJax.Localization,"FontWarnings"], // load domain + [CREATEMESSAGE,CONFIG.Message[MSG]] + ); + } } }); } diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index d619ee3ee..4e9ba3a0c 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -772,7 +772,7 @@ MENU.Scale = function () { var HTMLCSS = OUTPUT["HTML-CSS"], nMML = OUTPUT.NativeMML, SVG = OUTPUT.SVG; var SCALE = (HTMLCSS||nMML||SVG||{config:{scale:100}}).config.scale; - var scale = prompt(_("ScaleMath", "Scale all mathematics (compared to surrounding text) by %1%%",SCALE)); + var scale = prompt(_("ScaleMath", "Scale all mathematics (compared to surrounding text) by"),SCALE+"%"); if (scale) { if (scale.match(/^\s*\d+(\.\d*)?\s*%?\s*$/)) { scale = parseFloat(scale); @@ -898,7 +898,7 @@ MENU.cookie.mpContext = MENU.cookie.mpMouse = CONFIG.settings.mpMouse; MENU.saveCookie(); MathJax.Hub.Queue(["Rerender",MathJax.Hub]) - } else if (!discoverable && item.name[0] === "Menu Events" && CONFIG.settings.mpContext) { + } else if (!discoverable && item.name[1] === "Menu Events" && CONFIG.settings.mpContext) { alert(_.apply(_,MESSAGE.IE9warning)); } }; diff --git a/unpacked/extensions/v1.0-warning.js b/unpacked/extensions/v1.0-warning.js index 0f7a41bab..f09e3eab5 100644 --- a/unpacked/extensions/v1.0-warning.js +++ b/unpacked/extensions/v1.0-warning.js @@ -58,39 +58,43 @@ CONFIG.style.position = "absolute"; } else {delete CONFIG.style.filter} CONFIG.style.maxWidth = (document.body.clientWidth-75) + "px"; - DIV = HTML.addElement(frame,"div",{id:"MathJax_ConfigWarning",style:CONFIG.style}, - // Localization: - // - decide HTML snippet format - // - how do we ensure it is updated when the language is changed? - MathJax.Localization._(["ConfigWarning", "MissingConfig"], - "%1 MathJax no longer loads a default configuration file; " + - "you must specify such files explicitly. " + - "This page seems to use the older default %2 file"+ - ", and so needs to be updated. This is explained further at %3", - [[ - "div",{ - style: { - position:"absolute", overflow:"hidden", top:".1em", right:".1em", - border: "1px outset", width:"1em", height:"1em", - "text-align": "center", cursor: "pointer", - "background-color": "#EEEEEE", color:"#606060", + MathJax.Localization.Try(function () { + DIV = HTML.addElement(frame,"div",{id:"MathJax_ConfigWarning",style:CONFIG.style}, + MathJax.Localization._("v1.0-warning", + [ + [ + "div",{ + style: { + position:"absolute", overflow:"hidden", top:".1em", right:".1em", + border: "1px outset", width:"1em", height:"1em", + "text-align": "center", cursor: "pointer", + "background-color": "#EEEEEE", color:"#606060", - "border-radius": ".5em", // Opera 10.5 - "-webkit-border-radius": ".5em", // Safari and Chrome - "-moz-border-radius": ".5em", // Firefox - "-khtml-border-radius": ".5em" // Konqueror - }, - onclick: function () {DIV.style.display = "none"} - }, - [["span",{style:{position:"relative", bottom:".2em"}},["x"]]] - ]], - [["code",{},["config/MathJax.js"]]], - [["p",{style:{"text-align":"center"}},[ - ["a", - {href:"http://www.mathjax.org/help/configuration"}, - ["http://www.mathjax.org/help/configuration"] - ] - ]]])) + "border-radius": ".5em", // Opera 10.5 + "-webkit-border-radius": ".5em", // Safari and Chrome + "-moz-border-radius": ".5em", // Firefox + "-khtml-border-radius": ".5em" // Konqueror + }, + onclick: function () {DIV.style.display = "none"} + }, + [["span",{style:{position:"relative", bottom:".2em"}},["x"]]] + ], + ["MissingConfig", + "MathJax no longer loads a default configuration file; " + + "you must specify such files explicitly. " + + "This page seems to use the older default %1 " + + "file, and so needs to be updated. This is explained further at %1", + [["code",{},["config/MathJax.js"]]], + [["p",{style:{"text-align":"center"}},[ + ["a", + {href:"http://www.mathjax.org/help-v2/configuration"}, + ["http://www.mathjax.org/help-v2/configuration"] + ] + ]]] + ] + ]) + ); + }); }); })(MathJax.Hub,MathJax.HTML); diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index 3739619fe..5fe6cc20f 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -137,7 +137,7 @@ loadWebFont: function (font) { HUB.Startup.signal.Post("HTML-CSS Jax - Web-Font "+HTMLCSS.fontInUse+"/"+font.directory); - var n = MESSAGE(["LoadWebFont","Loading webfont %1",HTMLCSS.fontInUse+"/"+font.directory]); + var n = MESSAGE(["LoadWebFont","Loading web-font %1",HTMLCSS.fontInUse+"/"+font.directory]); var done = MathJax.Callback({}); // called when font is loaded var callback = MathJax.Callback(["loadComplete",this,font,n,done]); AJAX.timer.start(AJAX,[this.checkWebFont,font,callback],0,this.timeout); diff --git a/unpacked/localization/fr/FontWarnings.js b/unpacked/localization/fr/FontWarnings.js index 18f87ef93..f0f5b1117 100644 --- a/unpacked/localization/fr/FontWarnings.js +++ b/unpacked/localization/fr/FontWarnings.js @@ -32,12 +32,12 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ "être améliorée.", fonts: - "%1 MathJax peut utiliser les %2 ou bien les %3. Téléchargez et"+ + "MathJax peut utiliser les %1 ou bien les %2. Téléchargez et"+ "installez l'une de ces familles de polices pour améliorer votre"+ "expérience avec MathJax.", PageDesigned: - "%1 Cette page est conçue pour utiliser les %2. Téléchargez "+ + "Cette page est conçue pour utiliser les %1. Téléchargez "+ " et installez ces polices pour améliorer votre expérience "+ "avec MathJax", @@ -50,4 +50,4 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ } }); -MathJax.Ajax.loadComplete("[MathJax]/localization/fr/FontWarnings.js"); \ No newline at end of file +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/FontWarnings.js"); diff --git a/unpacked/localization/fr/HTML-CSS.js b/unpacked/localization/fr/HTML-CSS.js new file mode 100644 index 000000000..bacab5151 --- /dev/null +++ b/unpacked/localization/fr/HTML-CSS.js @@ -0,0 +1,26 @@ +MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ + "HTML-CSS": { + isLoaded: true, + strings: { + + LoadWebFont: "Téléchargement la police Web %1", + + CantLoadWebFont: "Impossible de télécharcharger la police Web %1", + + FirefoxCantLoadWebFont: + "Firefox ne peut télécharger les polices Web à partir d'un hôte "+ + "distant", + + CantFindFontUsing: + "Impossible de trouver une police valide en utilisant %1", + + WebFontsNotAvailable: + "Polices Web non disponibles -- des images de caractères vont être "+ + "utilisées à la place" + + } + } + +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/HTML-CSS.js"); diff --git a/unpacked/localization/fr/MathML.js b/unpacked/localization/fr/MathML.js index 2e53b2436..01123fc55 100644 --- a/unpacked/localization/fr/MathML.js +++ b/unpacked/localization/fr/MathML.js @@ -46,4 +46,4 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ } }); -MathJax.Ajax.loadComplete("[MathJax]/localization/fr/MathML.js"); \ No newline at end of file +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/MathML.js"); diff --git a/unpacked/localization/fr/MathMenu.js b/unpacked/localization/fr/MathMenu.js index 5d252526a..185e6fb07 100644 --- a/unpacked/localization/fr/MathMenu.js +++ b/unpacked/localization/fr/MathMenu.js @@ -3,44 +3,44 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ isLoaded: true, strings: { - Show: "Voir Maths Comme", - MathMLcode: "du Code MathML", - OriginalMathML: "d'Origine MathML", - TeXCommands: "Commandes TeX", - AsciiMathInput: "AsciiMathml Entrée", - Original: "Forme Originale", - ErrorMessage: "Message d'Erreur", - texHints: "Voir les notes TeX dans MathML", - Settings: "Paramètres Maths", - ZoomTrigger: "Trigger Zoom", - Hover: "Flotter", + Show: "Afficher la Formule sous Forme", + MathMLcode: "de Code MathML", + OriginalMathML: "de Code MathML d'Origine", + TeXCommands: "de Commandes TeX", + AsciiMathInput: "de code AsciiMathml", + Original: "d'Origine", + ErrorMessage: "de Message d'Erreur", + texHints: "Afficher les indications TeX dans le code MathML", + Settings: "Paramètres des formules", + ZoomTrigger: "Déclenchement du Zoom par", + Hover: "Survol de la Souris", Click: "Clic de Souris", DoubleClick: "Double-Clic", NoZoom: "Pas de Zoom", - TriggerRequires: "Trigger Nécessite", + TriggerRequires: "Le déclenchement nécessite l'appui sur la touche", Option: "Option", Alt: "Alt", Command: "Command", Control: "Control", Shift: "Shift", ZoomFactor: "Facteur de Zoom", - Renderer: "Traduire Maths", - MPHandles: "Laissez MathPlayer Gérer:", - MenuEvents: "Sélections du menu", + Renderer: "Mode de Rendu", + MPHandles: "Laissez MathPlayer Gérer les", + MenuEvents: "Êvénements du menu", MouseEvents: "Êvénements de la Souris", - MenuAndMouse: "Les Êvénements de Menu et de la Souris", + MenuAndMouse: "Êvénements de Menu et de la Souris", FontPrefs: "Préférences des Polices", ForHTMLCSS: "Pour le HTML-CSS:", Auto: "Auto", - TeXLocal: "TeX (local)", + TeXLocal: "TeX (locales)", TeXWeb: "TeX (web)", TeXImage: "TeX (image)", - STIXLocal: "STIX (local)", + STIXLocal: "STIX (locales)", ContextMenu: "Menu Contextuel", Browser: "Navigateur", - Scale: "Ajuster tous les Maths ...", - Discoverable: "Mettez en Surbrillance lors de Survol", - About: "À propos de MathJax", + Scale: "Mise à l'échelle des formules ...", + Discoverable: "Mettez en Surbrillance lors du Survol", + About: "À Propos de MathJax", Help: "Aide MathJax", localTeXfonts: "utilisant les polices locales TeX", @@ -60,7 +60,7 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ "les expressions mathématiques.", MSIENativeMMLWarning: - "Internet Explorer a besoin de module complémentaire MathPlayer " + + "Internet Explorer a besoin du module complémentaire MathPlayer " + "pour afficher le MathML.", OperaNativeMMLWarning: @@ -84,7 +84,7 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ ScaleMath: "Mise à l'échelle des expressions mathématiques (par rapport au " + - "text environnant) de %1%%", + "text environnant) de", NonZeroScale: "L'échelle ne peut être nulle", @@ -115,4 +115,4 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ } }); -MathJax.Ajax.loadComplete("[MathJax]/localization/fr/MathMenu.js"); \ No newline at end of file +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/MathMenu.js"); diff --git a/unpacked/localization/fr/TeX.js b/unpacked/localization/fr/TeX.js index 33a83eea8..6943e9637 100644 --- a/unpacked/localization/fr/TeX.js +++ b/unpacked/localization/fr/TeX.js @@ -251,4 +251,4 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ } }); -MathJax.Ajax.loadComplete("[MathJax]/localization/fr/TeX.js"); \ No newline at end of file +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/TeX.js"); diff --git a/unpacked/localization/fr/fr.js b/unpacked/localization/fr/fr.js index e48d29b37..20a0caa89 100644 --- a/unpacked/localization/fr/fr.js +++ b/unpacked/localization/fr/fr.js @@ -6,7 +6,7 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr,{ strings: { CookieConfig: - "MathJax a trouvé un cookie de configuration utilisateur qui inclut"+ + "MathJax a trouvé un cookie de configuration utilisateur qui inclut "+ "du code à exécuter. Souhaitez vous l'exécuter?\n\n"+ "(Choisissez Annuler sauf si vous avez créé ce cookie vous-même", @@ -25,27 +25,14 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr,{ LoadFailed: "Échec du téléchargement de %1", - CantLoadWebFont: "Impossible de télécharcharger la police Web %1", - - ProcessMath: "Traitement des maths: %1%%", + ProcessMath: "Traitement des formules: %1%%", Processing: "Traitement", - TypesetMath: "Composition des maths: %1%%", + TypesetMath: "Composition des formules: %1%%", Typesetting: "Composition", - FirefoxCantLoadWebFont: - "Firefox ne peut télécharger les polices Web à partir d'un hôte"+ - "distant", - - CantFindFontUsing: - "Impossible de trouver une police valide en utilisant %1", - - WebFontsNotAvailable: - "Polices Web non disponibles -- des images de caractères vont être"+ - "utilisées à la place", - MathJaxNotSupported: "Votre navigateur ne supporte pas MathJax" @@ -55,7 +42,8 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr,{ FontWarnings: {}, "v1.0-warning": {}, TeX: {}, - MathML: {} + MathML: {}, + "HTML-CSS": {} }, plural: function(n) { @@ -64,9 +52,9 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr,{ }, number: function(n) { - return n.replace(".", ","); // replace dot by comma + return String(n).replace(".", ","); // replace dot by comma } }); -MathJax.Ajax.loadComplete("[MathJax]/localization/fr/fr.js"); \ No newline at end of file +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/fr.js"); diff --git a/unpacked/localization/fr/v1.0-warning.js b/unpacked/localization/fr/v1.0-warning.js index 203ca9aeb..c2c6568da 100644 --- a/unpacked/localization/fr/v1.0-warning.js +++ b/unpacked/localization/fr/v1.0-warning.js @@ -3,13 +3,13 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ isLoaded: true, strings: { MissingConfig: - "%1 MathJax ne charge plus de fichier de configuration par défaut; "+ + "MathJax ne charge plus de fichier de configuration par défaut; "+ "vous devez spécifier ces fichiers de façons explicites. Cette "+ "page semble utiliser l'ancien fichier de configuration par "+ - "défaut %2 and doit donc être mise à jour. Ceci est expliqué "+ - "en détails à l'addresse suivante: %3" + "défaut %1 and doit donc être mise à jour. Ceci est expliqué "+ + "en détails à l'addresse suivante: %2" } } }); -MathJax.Ajax.loadComplete("[MathJax]/localization/fr/v1.0-warning.js"); \ No newline at end of file +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/v1.0-warning.js"); From 9ee925dfbbfb86f1698c5f26c54a0427fea15896 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 6 Apr 2013 10:47:47 -0400 Subject: [PATCH 10/41] Fix up some issues with plural processing. Make loadDomain handle both loads if there are any. Fix up Math Processing Error snippets to use new snippet code. --- unpacked/MathJax.js | 35 ++++++++++++++++------------- unpacked/config/Accessible-full.js | 3 +-- unpacked/config/Accessible.js | 3 +-- unpacked/extensions/FontWarnings.js | 3 +-- unpacked/localization/fr/fr.js | 7 ++---- 5 files changed, 24 insertions(+), 27 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 207097708..46aaad3d3 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1066,7 +1066,7 @@ MathJax.Localization = { // The pattern for substitution escapes: // %n or %{n} or %{plural:%n|option1|option1|...} or %c // - pattern: /%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%(?:\d+|\{\d+\}|.)|[^\}])*)+\}|.)/g, + pattern: /%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g, _: function (id,phrase) { if (phrase instanceof Array) {return this.processSnippet(id,phrase)} @@ -1098,20 +1098,22 @@ MathJax.Localization = { if (typeof parts[i] === "number") parts[i] = this.number(parts[i]); } else { // %{plural:%n|...} var match = parts[i].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/); - if (match[1] === "plural") { - var n = args[match[2]-1]; - if (typeof n === "undefined") { - parts[i] = "???"; // argument doesn't exist - } else { - n = this.plural(n) - 1; // index of the form to use - var plurals = match[3].replace(/%\|/g,"%\uEFEF").split(/\|/); // the parts (replacing %| with a special character) - if (n >= 0 && n < plurals.length) { - parts[i] = this.processString(plurals[n].replace(/\uEFEF/g,"|"),args,domain); + if (match) { + if (match[1] === "plural") { + var n = args[match[2]-1]; + if (typeof n === "undefined") { + parts[i] = "???"; // argument doesn't exist } else { - parts[i] = "???"; // no string for this index + n = this.plural(n) - 1; // index of the form to use + var plurals = match[3].replace(/(^|[^%])(%%)*%\|/g,"$1$2%\uEFEF").split(/\|/); // the parts (replacing %| with a special character) + if (n >= 0 && n < plurals.length) { + parts[i] = this.processString(plurals[n].replace(/\uEFEF/g,"|"),args,domain); + } else { + parts[i] = "???"; // no string for this index + } } - } - } else {parts[i] = "%"+parts[i]} // not "plural:put back the % and leave unchanged + } else {parts[i] = "%"+parts[i]} // not "plural:put back the % and leave unchanged + } } } } @@ -1244,7 +1246,8 @@ MathJax.Localization = { if (localeData) { if (!localeData.isLoaded) { load = this.loadFile(this.locale,localeData); - if (load) {return load} + // if the main file must be loaded, call us again to load domain + if (load) {return MathJax.Callback.After(["loadDomain",this,domain],load)} } if (localeData.domains && domain in localeData.domains) { var domainData = localeData.domains[domain]; @@ -1637,8 +1640,8 @@ MathJax.Hub = { }, errorSettings: { - message: ["[Math Processing Error]"], // HTML snippet structure for message to use - messageId: "MathProcessingErrorHTML", // ID of snippet for localization + // localized HTML snippet structure for message to use + message: ["[",["MathProcessingError","Math Processing Error"],"]"], style: {color: "#CC0000", "font-style":"italic"} // style for message } }, diff --git a/unpacked/config/Accessible-full.js b/unpacked/config/Accessible-full.js index b1e5bed3b..213030c70 100644 --- a/unpacked/config/Accessible-full.js +++ b/unpacked/config/Accessible-full.js @@ -24,8 +24,7 @@ MathJax.Hub.Config({ mpMouse: true }, errorSettings: { - message: ["[Math Error]"], - messageId: "MathErrorHTML" + message: ["[",["MathError","Math Error],"]"] } }); diff --git a/unpacked/config/Accessible.js b/unpacked/config/Accessible.js index 41a2820e6..34fa337bc 100644 --- a/unpacked/config/Accessible.js +++ b/unpacked/config/Accessible.js @@ -24,8 +24,7 @@ MathJax.Hub.Config({ mpMouse: true }, errorSettings: { - message: ["[Math Error]"], - messageId: "MathErrorHTML" + message: ["[",["MathError","Math Error],"]"] } }); diff --git a/unpacked/extensions/FontWarnings.js b/unpacked/extensions/FontWarnings.js index 9350456bf..cc4868ee6 100644 --- a/unpacked/extensions/FontWarnings.js +++ b/unpacked/extensions/FontWarnings.js @@ -308,8 +308,7 @@ else if (message.match(/- no valid font/)) {MSG = "noFonts"} if (MSG && CONFIG.Message[MSG]) { MathJax.Callback.Queue( - ["loadDomain",MathJax.Localization,"FontWarnings"], // load locale - ["loadDomain",MathJax.Localization,"FontWarnings"], // load domain + ["loadDomain",MathJax.Localization,"FontWarnings"], // make sure these are available [CREATEMESSAGE,CONFIG.Message[MSG]] ); } diff --git a/unpacked/localization/fr/fr.js b/unpacked/localization/fr/fr.js index 20a0caa89..ee95a6941 100644 --- a/unpacked/localization/fr/fr.js +++ b/unpacked/localization/fr/fr.js @@ -13,11 +13,8 @@ MathJax.Hub.Insert(MathJax.Localization.strings.fr,{ MathProcessingError: "Erreur de traitement de la formule mathématique", - MathProcessingErrorHTML: - ["[Erreur de traitement de la formule mathématique]"], - - MathErrorHTML: - ["[Erreur dans la formule mathématique]"], + MathError: + "Erreur dans la formule mathématique", LoadFile: "Téléchargement %1", From c9578c7a0b7a5eadeebcab0a05e53676342098c6 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 6 Apr 2013 20:04:48 -0400 Subject: [PATCH 11/41] Add localization submenu, and set locale via menu. Allow locale= configuration parameter on script to load MathJax.js. Load MathMenu domain automatically (so it is ready when needed). --- unpacked/MathJax.js | 32 +++++++++++++++++++++++++++----- unpacked/extensions/MathMenu.js | 24 ++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 7 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 46aaad3d3..adcf16590 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1055,7 +1055,7 @@ MathJax.HTML = { MathJax.Localization = { - locale: "fr", + locale: "en", directory: "[MathJax]/localization", strings: { en: {isLoaded: true}, // nothing needs to be loaded for this @@ -1283,6 +1283,7 @@ MathJax.Localization = { setLocale: function(locale) { // don't set it if there isn't a definition for it if (this.strings[locale]) {this.locale = locale} + if (MathJax.Menu) {this.loadDomain("MathMenu")} }, // @@ -1634,6 +1635,7 @@ MathJax.Hub = { renderer: "", // set when Jax are loaded font: "Auto", // what font HTML-CSS should use context: "MathJax", // or "Browser" for pass-through to browser menu + locale: "en", // the language to use for messages mpContext: false, // true means pass menu events to MathPlayer in IE mpMouse: false, // true means pass mouse events to MathPlayer in IE texHints: true // include class names for TeXAtom elements @@ -2131,15 +2133,23 @@ MathJax.Hub.Startup = { Config: function () { this.queue.Push(["Post",this.signal,"Begin Config"]); // + // If a locale is given as a parameter, + // set the locale and the default menu value for the locale + // + if (this.params.locale) { + MathJax.Localization.locale = this.params.locale; + MathJax.Hub.config.menuSettings.locale = this.params.locale; + } + // // Check for user cookie configuration // var user = MathJax.HTML.Cookie.Get("user"); if (user.URL || user.Config) { if (confirm( MathJax.Localization._("CookieConfig", - "MathJax has found a user-configuration cookie that includes code to"+ - "be run. Do you want to run it?\n\n"+ - "(You should press Cancel unless you set up the cookie yourself.)") + "MathJax has found a user-configuration cookie that includes code to "+ + "be run. Do you want to run it?\n\n"+ + "(You should press Cancel unless you set up the cookie yourself.)") )) { if (user.URL) {this.queue.Push(["Require",MathJax.Ajax,user.URL])} if (user.Config) {this.queue.Push(new Function(user.Config))} @@ -2207,6 +2217,7 @@ MathJax.Hub.Startup = { // // Read cookie and set up menu defaults + // (set the locale according to the cookie) // (adjust the jax to accommodate renderer preferences) // Cookie: function () { @@ -2214,6 +2225,8 @@ MathJax.Hub.Startup = { ["Post",this.signal,"Begin Cookie"], ["Get",MathJax.HTML.Cookie,"menu",MathJax.Hub.config.menuSettings], [function (config) { + if (config.menuSettings.locale) + {MathJax.Localization.locale = config.menuSettings.locale} var renderer = config.menuSettings.renderer, jax = config.jax; if (renderer) { var name = "output/"+renderer; jax.sort(); @@ -2332,7 +2345,16 @@ MathJax.Hub.Startup = { MenuZoom: function () { if (!MathJax.Extension.MathMenu) { setTimeout( - MathJax.Callback(["Require",MathJax.Ajax,"[MathJax]/extensions/MathMenu.js",{}]), + function () { + MathJax.Callback.Queue( + ["Require",MathJax.Ajax,"[MathJax]/extensions/MathMenu.js",{}], + ["loadDomain",MathJax.Localization,"MathMenu"] + ) + },1000 + ); + } else { + setTimeout( + MathJax.Callback(["loadDomain",MathJax.Localization,"MathMenu"]), 1000 ); } diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index 4e9ba3a0c..fea3c6043 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -56,6 +56,7 @@ showFontMenu: false, // show the "Font Preference" menu? showContext: false, // show the "Context Menu" menu? showDiscoverable: false, // show the "Discoverable" menu? + showLocale: true, // show the "Locale" menu? windowSettings: { // for source window status: "no", toolbar: "no", locationbar: "no", menubar: "no", @@ -881,6 +882,15 @@ document.location.reload(); }; + /* + * Handle selection of locale + */ + MENU.Locale = function () { + MathJax.Localization.setLocale(CONFIG.settings.locale); + // FIXME: Rerender the page? (To force error messages to change?) + // Just rerender error messages? + } + /* * Handle setting MathPlayer events */ @@ -1019,7 +1029,12 @@ ), ITEM.COMMAND(["Scale","Scale All Math ..."],MENU.Scale), ITEM.RULE().With({hidden:!CONFIG.showDiscoverable, name:["","discover_rule"]}), - ITEM.CHECKBOX(["Discoverable","Highlight on Hover"], "discoverable", {hidden:!CONFIG.showDiscoverable}) + ITEM.CHECKBOX(["Discoverable","Highlight on Hover"], "discoverable", {hidden:!CONFIG.showDiscoverable}), + ITEM.RULE().With({hidden:!CONFIG.showLocale, name:["","locale_rule"]}), + ITEM.SUBMENU(["Locale","Locale"], {hidden:!CONFIG.showLocale}, + ITEM.RADIO("en", "locale", {action: MENU.Locale}), + ITEM.RADIO("fr", "locale", {action: MENU.Locale}) + ) ), ITEM.RULE(), ITEM.COMMAND(["About","About MathJax"],MENU.About), @@ -1059,10 +1074,15 @@ MENU.menu.Find("Math Settings","Contextual Menu").hidden = !show; }; MENU.showDiscoverable = function (show) { - MENU.cookie.showContext = CONFIG.showContext = show; MENU.saveCookie(); + MENU.cookie.showDiscoverable = CONFIG.showDiscoverable = show; MENU.saveCookie(); MENU.menu.Find("Math Settings","Highlight on Hover").hidden = !show; MENU.menu.Find("Math Settings","discover_rule").hidden = !show; }; + MENU.showLocale = function (show) { + MENU.cookie.showLocale = CONFIG.showLocale = show; MENU.saveCookie(); + MENU.menu.Find("Math Settings","Locale").hidden = !show; + MENU.menu.Find("Math Settings","locale_rule").hidden = !show; + }; MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { if (!MathJax.OutputJax["HTML-CSS"].config.imageFont) From c4d47bb10ded2604c5284d61641d2381d2db0b2e Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 7 Apr 2013 10:44:29 -0400 Subject: [PATCH 12/41] Add callback to loadDomain to make it easier to use --- unpacked/MathJax.js | 22 +++++++++++++--------- unpacked/extensions/FontWarnings.js | 8 ++------ unpacked/extensions/v1.0-warning.js | 1 + 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index adcf16590..c2377bb18 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1209,7 +1209,8 @@ MathJax.Localization = { // Load a langauge data file from the proper // directory and file. // - loadFile: function (file,data) { + loadFile: function (file,data,callback) { + callback = MathJax.Callback(callback||{}); file = (data.file || file); // the data's file name or the default name if (!file.match(/\.js$/)) {file += ".js"} // add .js if needed // @@ -1227,7 +1228,7 @@ MathJax.Localization = { // failed to load, so we don't continue to try to load it // over and over). // - var load = MathJax.Ajax.Require(file,function () {data.isLoaded = true}); + var load = MathJax.Ajax.Require(file,function () {data.isLoaded = true; return callback()}); // // Return the callback if needed, otherwise null. // @@ -1240,24 +1241,27 @@ MathJax.Localization = { // and return a callback for the loading operation. // Otherwise return null (data are loaded). // - loadDomain: function (domain) { - var load; - var localeData = this.strings[this.locale]; + loadDomain: function (domain,callback) { + var load, localeData = this.strings[this.locale]; if (localeData) { if (!localeData.isLoaded) { load = this.loadFile(this.locale,localeData); - // if the main file must be loaded, call us again to load domain - if (load) {return MathJax.Callback.After(["loadDomain",this,domain],load)} + if (load) { + return MathJax.Callback.Queue( + load,["loadDomain",this,domain] // call again to load domain + ).Push(callback); + } } if (localeData.domains && domain in localeData.domains) { var domainData = localeData.domains[domain]; if (!domainData.isLoaded) { load = this.loadFile(domain,domainData); - if (load) {return load} + if (load) {return MathJax.Callback.Queue(load).Push(callback)} } } } - return null; // localization data are loaded + // localization data are loaded, so just do the callback + return MathJax.Callback(callback)(); }, // diff --git a/unpacked/extensions/FontWarnings.js b/unpacked/extensions/FontWarnings.js index cc4868ee6..d633684f1 100644 --- a/unpacked/extensions/FontWarnings.js +++ b/unpacked/extensions/FontWarnings.js @@ -306,12 +306,8 @@ if (message.match(/- Web-Font/)) {if (localFonts) {MSG = "webFont"}} else if (message.match(/- using image fonts/)) {MSG = "imageFonts"} else if (message.match(/- no valid font/)) {MSG = "noFonts"} - if (MSG && CONFIG.Message[MSG]) { - MathJax.Callback.Queue( - ["loadDomain",MathJax.Localization,"FontWarnings"], // make sure these are available - [CREATEMESSAGE,CONFIG.Message[MSG]] - ); - } + if (MSG && CONFIG.Message[MSG]) + {MathJax.Localization.loadDomain("FontWarnings",[CREATEMESSAGE,CONFIG.Message[MSG]])} } }); } diff --git a/unpacked/extensions/v1.0-warning.js b/unpacked/extensions/v1.0-warning.js index f09e3eab5..b269f24bf 100644 --- a/unpacked/extensions/v1.0-warning.js +++ b/unpacked/extensions/v1.0-warning.js @@ -1,5 +1,6 @@ /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ + /************************************************************* * * MathJax/extensions/v1.0-warning.js From f23cb8a6b2c5526a894dc290a04334adb1a49728 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 7 Apr 2013 11:44:58 -0400 Subject: [PATCH 13/41] Create list of locales from the localization data, and allow data to specify menu title. Update menu when new translations are added. Allow loading of third-party translation data by URL. Fix transaltion files to use addTranslation(). --- unpacked/MathJax.js | 5 +- unpacked/extensions/MathMenu.js | 45 ++- unpacked/localization/fr/FontWarnings.js | 80 +++--- unpacked/localization/fr/HTML-CSS.js | 31 +- unpacked/localization/fr/MathML.js | 66 +++-- unpacked/localization/fr/MathMenu.js | 193 +++++++------ unpacked/localization/fr/TeX.js | 347 +++++++++++------------ unpacked/localization/fr/fr.js | 2 +- unpacked/localization/fr/v1.0-warning.js | 22 +- 9 files changed, 412 insertions(+), 379 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index c2377bb18..d7a70fa8d 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1058,8 +1058,8 @@ MathJax.Localization = { locale: "en", directory: "[MathJax]/localization", strings: { - en: {isLoaded: true}, // nothing needs to be loaded for this - fr: {} + en: {isLoaded: true, menuTitle: "English"}, // nothing needs to be loaded for this + fr: {menuTitle: "French"} }, // @@ -1302,6 +1302,7 @@ MathJax.Localization = { data = data.domains[domain]; } MathJax.Hub.Insert(data,definition); + if (!domain && MathJax.Menu) {MathJax.Menu.CreateLocaleMenu()} }, // diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index fea3c6043..f6ffeaa30 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -889,7 +889,21 @@ MathJax.Localization.setLocale(CONFIG.settings.locale); // FIXME: Rerender the page? (To force error messages to change?) // Just rerender error messages? - } + }; + MENU.LoadLocale = function () { + var url = prompt(_("LoadURL","Load translation data from this URL:")); + if (url) { + if (!url.match(/\.js$/)) { + alert(_("BadURL", + "The URL should be for a javascript file that defines MathJax translation data. " + + "Javascript file names should end with '.js'" + )); + } + AJAX.Require(url,function (status) { + if (status != AJAX.STATUS.OK) {alert(_("BadData","Failed to load translation data from %1",url))} + }); + } + }; /* * Handle setting MathPlayer events @@ -1033,7 +1047,8 @@ ITEM.RULE().With({hidden:!CONFIG.showLocale, name:["","locale_rule"]}), ITEM.SUBMENU(["Locale","Locale"], {hidden:!CONFIG.showLocale}, ITEM.RADIO("en", "locale", {action: MENU.Locale}), - ITEM.RADIO("fr", "locale", {action: MENU.Locale}) + ITEM.RULE(), + ITEM.COMMAND(["LoadLocale","Load from URL ..."], MENU.LoadLocale) ) ), ITEM.RULE(), @@ -1056,6 +1071,32 @@ } }); + + // + // Creates the locale menu from the list of locales in MathJax.Localization.strings + // + MENU.CreateLocaleMenu = function () { + var menu = MENU.menu.Find("Math Settings","Locale").menu, items = menu.items; + // + // Get the names of the languages and sort them + // + var locales = [], LOCALE = MathJax.Localization.strings; + for (var id in LOCALE) {if (LOCALE.hasOwnProperty(id)) {locales.push(id)}} + locales = locales.sort(); menu.items = []; + // + // Add a menu item for each + // + for (var i = 0, m = locales.length; i < m; i++) { + var title = LOCALE[locales[i]].menuTitle; + if (title) {title += " ("+locales[i]+")"} else {title = locales[i]} + menu.items.push(ITEM.RADIO([locales[i],title],"locale",{action:MENU.Locale})); + } + // + // Add the rule and "Load from URL" items + // + menu.items.push(items[items.length-2],items[items.length-1]); + }; + MENU.CreateLocaleMenu(); MENU.showRenderer = function (show) { MENU.cookie.showRenderer = CONFIG.showRenderer = show; MENU.saveCookie(); diff --git a/unpacked/localization/fr/FontWarnings.js b/unpacked/localization/fr/FontWarnings.js index f0f5b1117..2320234d4 100644 --- a/unpacked/localization/fr/FontWarnings.js +++ b/unpacked/localization/fr/FontWarnings.js @@ -1,52 +1,50 @@ -MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ - FontWarnings: { - isLoaded: true, - strings: { +MathJax.Localization.addTranslation("fr","FontWarnings",{ + isLoaded: true, + strings: { - webFont: - "MathJax utilise les polices Web pour afficher les expressions " + - "mathématiques sur cette page. Celles-ci mettent du temps à être "+ - "téléchargées et la page serait affichée plus rapidement si vous "+ - "installiez les polices mathématiques directement dans le dossier "+ - "des polices de votre système.", + webFont: + "MathJax utilise les polices Web pour afficher les expressions " + + "mathématiques sur cette page. Celles-ci mettent du temps à être "+ + "téléchargées et la page serait affichée plus rapidement si vous "+ + "installiez les polices mathématiques directement dans le dossier "+ + "des polices de votre système.", - imageFonts: - "MathJax utilise des images de caractères plutôt que les polices "+ - "Web ou locales. Ceci rend le rendu plus lent que la normale et "+ - "les expressions mathématiques peuvent ne pas s'imprimer à la "+ - "résolution maximale de votre imprimante", + imageFonts: + "MathJax utilise des images de caractères plutôt que les polices "+ + "Web ou locales. Ceci rend le rendu plus lent que la normale et "+ + "les expressions mathématiques peuvent ne pas s'imprimer à la "+ + "résolution maximale de votre imprimante", - noFonts: - "MathJax n'est pas parvenu à localiser une police pour afficher "+ - "les expressions mathématiques et les images de caractères ne "+ - "sont pas disponibles. Comme solution de dernier recours, il "+ - "utilise des caractères Unicode génériques en espérant que votre "+ - "navigateur sera capable de les afficher. Certains pourront ne "+ - "être rendus de façon incorrect voire pas du tout.", + noFonts: + "MathJax n'est pas parvenu à localiser une police pour afficher "+ + "les expressions mathématiques et les images de caractères ne "+ + "sont pas disponibles. Comme solution de dernier recours, il "+ + "utilise des caractères Unicode génériques en espérant que votre "+ + "navigateur sera capable de les afficher. Certains pourront ne "+ + "être rendus de façon incorrect voire pas du tout.", - webFonts: - "La plupart des navigateurs modernes permettent de télécharger "+ - "des polices à partir du Web. En mettant à jour pour une version "+ - "plus récente de votre navigateur (ou en changeant de navigateur) "+ - "la qualité des expressions mathématiques sur cette page pourrait "+ - "être améliorée.", + webFonts: + "La plupart des navigateurs modernes permettent de télécharger "+ + "des polices à partir du Web. En mettant à jour pour une version "+ + "plus récente de votre navigateur (ou en changeant de navigateur) "+ + "la qualité des expressions mathématiques sur cette page pourrait "+ + "être améliorée.", - fonts: - "MathJax peut utiliser les %1 ou bien les %2. Téléchargez et"+ - "installez l'une de ces familles de polices pour améliorer votre"+ - "expérience avec MathJax.", + fonts: + "MathJax peut utiliser les %1 ou bien les %2. Téléchargez et"+ + "installez l'une de ces familles de polices pour améliorer votre"+ + "expérience avec MathJax.", - PageDesigned: - "Cette page est conçue pour utiliser les %1. Téléchargez "+ - " et installez ces polices pour améliorer votre expérience "+ - "avec MathJax", + PageDesigned: + "Cette page est conçue pour utiliser les %1. Téléchargez "+ + " et installez ces polices pour améliorer votre expérience "+ + "avec MathJax", - STIXfonts: - "Polices STIX", + STIXfonts: + "Polices STIX", - TeXfonts: - "Polices TeX de MathJax" - } + TeXfonts: + "Polices TeX de MathJax" } }); diff --git a/unpacked/localization/fr/HTML-CSS.js b/unpacked/localization/fr/HTML-CSS.js index bacab5151..7beb0eae6 100644 --- a/unpacked/localization/fr/HTML-CSS.js +++ b/unpacked/localization/fr/HTML-CSS.js @@ -1,26 +1,25 @@ -MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ - "HTML-CSS": { - isLoaded: true, - strings: { +MathJax.Localization.addTranslation("fr","HTML-CSS",{ + isLoaded: true, + strings: { - LoadWebFont: "Téléchargement la police Web %1", + LoadWebFont: + "Téléchargement la police Web %1", - CantLoadWebFont: "Impossible de télécharcharger la police Web %1", + CantLoadWebFont: + "Impossible de télécharcharger la police Web %1", - FirefoxCantLoadWebFont: - "Firefox ne peut télécharger les polices Web à partir d'un hôte "+ - "distant", + FirefoxCantLoadWebFont: + "Firefox ne peut télécharger les polices Web à partir d'un hôte "+ + "distant", - CantFindFontUsing: - "Impossible de trouver une police valide en utilisant %1", + CantFindFontUsing: + "Impossible de trouver une police valide en utilisant %1", - WebFontsNotAvailable: - "Polices Web non disponibles -- des images de caractères vont être "+ - "utilisées à la place" + WebFontsNotAvailable: + "Polices Web non disponibles -- des images de caractères vont être "+ + "utilisées à la place" - } } - }); MathJax.Ajax.loadComplete("[MathJax]/localization/fr/HTML-CSS.js"); diff --git a/unpacked/localization/fr/MathML.js b/unpacked/localization/fr/MathML.js index 01123fc55..8caf8fab9 100644 --- a/unpacked/localization/fr/MathML.js +++ b/unpacked/localization/fr/MathML.js @@ -1,48 +1,46 @@ -MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ - MathML: { - isLoaded: true, - strings: { +MathJax.Localization.addTranslation("fr","MathML",{ + isLoaded: true, + 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: - "MathJax n'est pas parvenu à configurer MathPlayer.\n\n"+ - "Vous devez d'abord installer MathPlayer. Si c'est déjà le cas,\n"+ - "vos paramètres de sécurités peuvent empêcher l'exécution des\n"+ - "contrôles ActiveX. Sélectionnez Options Internet dans le menu\n"+ - "Outils et sélectionnez l'onglet Sécurité. Appuyez ensuite sur\n"+ - "le menu Niveau Personalisé. Assurez vous que les paramètres\n"+ - "Exécution des contrôles ActiveX et Comportements des exécutables\n"+ - "et des scripts sont activés.\n\n"+ - "Actuellement, vous verez des messages d'erreur à la place des\n"+ - "expressions mathématiques.", + MathPlayer: + "MathJax n'est pas parvenu à configurer MathPlayer.\n\n"+ + "Vous devez d'abord installer MathPlayer. Si c'est déjà le cas,\n"+ + "vos paramètres de sécurités peuvent empêcher l'exécution des\n"+ + "contrôles ActiveX. Sélectionnez Options Internet dans le menu\n"+ + "Outils et sélectionnez l'onglet Sécurité. Appuyez ensuite sur\n"+ + "le menu Niveau Personalisé. Assurez vous que les paramètres\n"+ + "Exécution des contrôles ActiveX et Comportements des exécutables\n"+ + "et des scripts sont activés.\n\n"+ + "Actuellement, vous verez des messages d'erreur à la place des\n"+ + "expressions mathématiques.", - CantCreateXMLParser: - "MathJax ne peut créer un analyseur grammatical XML pour le MathML", + CantCreateXMLParser: + "MathJax ne peut créer un analyseur grammatical XML pour le MathML", - UnknownNodeType: - "Type de noeud inconnu: %1", + UnknownNodeType: + "Type de noeud inconnu: %1", - UnexpectedTextNode: - "Noeud de texte inattendu: %1", + UnexpectedTextNode: + "Noeud de texte inattendu: %1", - ErrorParsingMathML: - "Erreur lors de l'analyse grammaticale du code MathML", + ErrorParsingMathML: + "Erreur lors de l'analyse grammaticale du code MathML", - ParsingError: - "Erreur lors de l'analyse du code MathML: %1", + ParsingError: + "Erreur lors de l'analyse du code MathML: %1", - MathMLSingleElement: - "Le code MathML doit être formé d'un unique élément", + MathMLSingleElement: + "Le code MathML doit être formé d'un unique élément", - MathMLRootElement: - "Le code MathML doit être formé d'un élément et non un élément %1" + MathMLRootElement: + "Le code MathML doit être formé d'un élément et non un élément %1" - } } }); diff --git a/unpacked/localization/fr/MathMenu.js b/unpacked/localization/fr/MathMenu.js index 185e6fb07..03f2efde4 100644 --- a/unpacked/localization/fr/MathMenu.js +++ b/unpacked/localization/fr/MathMenu.js @@ -1,117 +1,116 @@ -MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ - MathMenu: { - isLoaded: true, - strings: { +MathJax.Localization.addTranslation("fr","MathMenu",{ + isLoaded: true, + strings: { - Show: "Afficher la Formule sous Forme", - MathMLcode: "de Code MathML", - OriginalMathML: "de Code MathML d'Origine", - TeXCommands: "de Commandes TeX", - AsciiMathInput: "de code AsciiMathml", - Original: "d'Origine", - ErrorMessage: "de Message d'Erreur", - texHints: "Afficher les indications TeX dans le code MathML", - Settings: "Paramètres des formules", - ZoomTrigger: "Déclenchement du Zoom par", - Hover: "Survol de la Souris", - Click: "Clic de Souris", - DoubleClick: "Double-Clic", - NoZoom: "Pas de Zoom", - TriggerRequires: "Le déclenchement nécessite l'appui sur la touche", - Option: "Option", - Alt: "Alt", - Command: "Command", - Control: "Control", - Shift: "Shift", - ZoomFactor: "Facteur de Zoom", - Renderer: "Mode de Rendu", - MPHandles: "Laissez MathPlayer Gérer les", - MenuEvents: "Êvénements du menu", - MouseEvents: "Êvénements de la Souris", - MenuAndMouse: "Êvénements de Menu et de la Souris", - FontPrefs: "Préférences des Polices", - ForHTMLCSS: "Pour le HTML-CSS:", - Auto: "Auto", - TeXLocal: "TeX (locales)", - TeXWeb: "TeX (web)", - TeXImage: "TeX (image)", - STIXLocal: "STIX (locales)", - ContextMenu: "Menu Contextuel", - Browser: "Navigateur", - Scale: "Mise à l'échelle des formules ...", - Discoverable: "Mettez en Surbrillance lors du Survol", - About: "À Propos de MathJax", - Help: "Aide MathJax", + Show: "Afficher la Formule sous Forme", + MathMLcode: "de Code MathML", + OriginalMathML: "de Code MathML d'Origine", + TeXCommands: "de Commandes TeX", + AsciiMathInput: "de code AsciiMathml", + Original: "d'Origine", + ErrorMessage: "de Message d'Erreur", + texHints: "Afficher les indications TeX dans le code MathML", + Settings: "Paramètres des formules", + ZoomTrigger: "Déclenchement du Zoom par", + Hover: "Survol de la Souris", + Click: "Clic de Souris", + DoubleClick: "Double-Clic", + NoZoom: "Pas de Zoom", + TriggerRequires: "Le déclenchement nécessite l'appui sur la touche", + Option: "Option", + Alt: "Alt", + Command: "Command", + Control: "Control", + Shift: "Shift", + ZoomFactor: "Facteur de Zoom", + Renderer: "Mode de Rendu", + MPHandles: "Laissez MathPlayer Gérer les", + MenuEvents: "Êvénements du menu", + MouseEvents: "Êvénements de la Souris", + MenuAndMouse: "Êvénements de Menu et de la Souris", + FontPrefs: "Préférences des Polices", + ForHTMLCSS: "Pour le HTML-CSS:", + Auto: "Auto", + TeXLocal: "TeX (locales)", + TeXWeb: "TeX (web)", + TeXImage: "TeX (image)", + STIXLocal: "STIX (locales)", + ContextMenu: "Menu Contextuel", + Browser: "Navigateur", + Scale: "Mise à l'échelle des formules ...", + Discoverable: "Mettez en Surbrillance lors du Survol", + About: "À Propos de MathJax", + Help: "Aide MathJax", - localTeXfonts: "utilisant les polices locales TeX", - webTeXfonts: "utilisant les polices internet TeX", - imagefonts: "utilisant les polices d'image", - localSTIXfonts: "utilisant les polices locales STIX", - webSVGfonts: "utilisant les polices internet SVG", - genericfonts: "utilisant les polices locales génériques", + localTeXfonts: "utilisant les polices locales TeX", + webTeXfonts: "utilisant les polices internet TeX", + imagefonts: "utilisant les polices d'image", + localSTIXfonts: "utilisant les polices locales STIX", + webSVGfonts: "utilisant les polices internet SVG", + genericfonts: "utilisant les polices locales génériques", - wofforotffonts: "les polices woff ou otf", - eotffonts: "les polices eot", - svgfonts: "les polices svg", + wofforotffonts: "les polices woff ou otf", + eotffonts: "les polices eot", + svgfonts: "les polices svg", - WebkitNativeMMLWarning: - "Votre navigateur ne semble pas comporter de support MathML, " + - "changer le mode de rendu pourrait rendre illisibles " + - "les expressions mathématiques.", + WebkitNativeMMLWarning: + "Votre navigateur ne semble pas comporter de support MathML, " + + "changer le mode de rendu pourrait rendre illisibles " + + "les expressions mathématiques.", - MSIENativeMMLWarning: - "Internet Explorer a besoin du module complémentaire MathPlayer " + - "pour afficher le MathML.", + MSIENativeMMLWarning: + "Internet Explorer a besoin du module complémentaire MathPlayer " + + "pour afficher le MathML.", - OperaNativeMMLWarning: - "Le support MathML d'Opera est limité, changer le mode de rendu " + - "pourrait entrainer un affichage médiocre de certaines expressions.", + OperaNativeMMLWarning: + "Le support MathML d'Opera est limité, changer le mode de rendu " + + "pourrait entrainer un affichage médiocre de certaines expressions.", - SafariNativeMMLWarning: - "Le support MathML natif de votre navigateur ne comporte pas " + - "toutes les fonctionnalités requises par MathJax, certaines " + - "expressions pourront donc ne pas s'afficher correctement.", + SafariNativeMMLWarning: + "Le support MathML natif de votre navigateur ne comporte pas " + + "toutes les fonctionnalités requises par MathJax, certaines " + + "expressions pourront donc ne pas s'afficher correctement.", - FirefoxNativeMMLWarning: - "Le support MathML natif de votre navigateur ne comporte pas " + - "toutes les fonctionnalités requises par MathJax, certaines " + - "expressions pourront donc ne pas s'afficher correctement.", + FirefoxNativeMMLWarning: + "Le support MathML natif de votre navigateur ne comporte pas " + + "toutes les fonctionnalités requises par MathJax, certaines " + + "expressions pourront donc ne pas s'afficher correctement.", - SwitchAnyway: - "Êtes vous certain de vouloir changer le mode de rendu ?\n\n" + - "Appuyez sur OK pour valider ou Annuler pour continuer avec le " + - "mode de rendu actuellement sélectionné.", + SwitchAnyway: + "Êtes vous certain de vouloir changer le mode de rendu ?\n\n" + + "Appuyez sur OK pour valider ou Annuler pour continuer avec le " + + "mode de rendu actuellement sélectionné.", - ScaleMath: - "Mise à l'échelle des expressions mathématiques (par rapport au " + - "text environnant) de", + ScaleMath: + "Mise à l'échelle des expressions mathématiques (par rapport au " + + "text environnant) de", - NonZeroScale: - "L'échelle ne peut être nulle", + NonZeroScale: + "L'échelle ne peut être nulle", - PercentScale: - "L'échelle doit être un pourcentage (e.g. 120%%)", + PercentScale: + "L'échelle doit être un pourcentage (e.g. 120%%)", - IE8warning: - "Ceci désactivera le menu de MathJax et les fonctionalités de " + - "zoom mais vous pourrez toujours obtenir le menu de MathJax " + - "en utilisant la commande Alt+Clic sur une expression.\n\n" + - "Êtes vous certain de vouloir choisir les options de MathPlayer?", + IE8warning: + "Ceci désactivera le menu de MathJax et les fonctionalités de " + + "zoom mais vous pourrez toujours obtenir le menu de MathJax " + + "en utilisant la commande Alt+Clic sur une expression.\n\n" + + "Êtes vous certain de vouloir choisir les options de MathPlayer?", - IE9warning: - "Le menu contextuel de MathJax sera désactivé, " + - "mais vous pourrez toujours obtenir le menu de MathJax " + - "en utilisant la commande Alt-Clic sur une expression.", + IE9warning: + "Le menu contextuel de MathJax sera désactivé, " + + "mais vous pourrez toujours obtenir le menu de MathJax " + + "en utilisant la commande Alt-Clic sur une expression.", - NoOriginalForm: - "Aucune forme d'origine disponible.", + NoOriginalForm: + "Aucune forme d'origine disponible.", - Close: - "Fermer", + Close: + "Fermer", + + EqSource: + "Source de l'équation MathJax" - EqSource: - "Source de l'équation MathJax" - } } }); diff --git a/unpacked/localization/fr/TeX.js b/unpacked/localization/fr/TeX.js index 6943e9637..8ef858c52 100644 --- a/unpacked/localization/fr/TeX.js +++ b/unpacked/localization/fr/TeX.js @@ -1,253 +1,250 @@ -MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ - TeX: { - isLoaded: true, - strings: { - ExtraOpenMissingClose: - "Accolade ouvrant manquante ou accolade fermante non attendue", +MathJax.Localization.addTranslation("fr","TeX",{ + isLoaded: true, + strings: { - ExtraCloseMissingOpen: - "Accolade fermante non attendue ou accolade ouvrante manquante", + ExtraOpenMissingClose: + "Accolade ouvrant manquante ou accolade fermante non attendue", - MissingLeftExtraRight: - "Commande \\left manquante or ou commande \\right non attendue", + ExtraCloseMissingOpen: + "Accolade fermante non attendue ou accolade ouvrante manquante", - MissingScript: - "Argument en exposant ou en indice manquant", + MissingLeftExtraRight: + "Commande \\left manquante or ou commande \\right non attendue", - ExtraLeftMissingRight: - "Commande \\left inattendue or ou commande \\right manquante", + MissingScript: + "Argument en exposant ou en indice manquant", - Misplaced: - "Mauvaise position pour la commande %1", + ExtraLeftMissingRight: + "Commande \\left inattendue or ou commande \\right manquante", - MissingOpenForScript: - "Accolade ouvrante manquante pour le script %1", + Misplaced: + "Mauvaise position pour la commande %1", - AmbiguousUseOf: - "Usage ambigu de la commande %1", + MissingOpenForScript: + "Accolade ouvrante manquante pour le script %1", - EnvBadEnd: - "\\begin{%1} s'est terminé par un \\end{%2}", + AmbiguousUseOf: + "Usage ambigu de la commande %1", - EnvMissingEnd: - "\\end{%1} manquant", + EnvBadEnd: + "\\begin{%1} s'est terminé par un \\end{%2}", - MissingBoxFor: - "Boite manquante pour la commande %1", + EnvMissingEnd: + "\\end{%1} manquant", - MissingCloseBrace: - "Accolade fermante manquante", + MissingBoxFor: + "Boite manquante pour la commande %1", - UndefinedControlSequence: - "Commande %1 non définie", + MissingCloseBrace: + "Accolade fermante manquante", - IllegalControlSequenceName: - "Nom de contrôle de séquence non autorisé pour la commande %1", + UndefinedControlSequence: + "Commande %1 non définie", - IllegalParamNumber: - "Nombre de paramètres incorrect pour la commande %1", + IllegalControlSequenceName: + "Nom de contrôle de séquence non autorisé pour la commande %1", - DoubleExponent: - "Double exposant: utilisez des accolades pour clarifier", + IllegalParamNumber: + "Nombre de paramètres incorrect pour la commande %1", - DoubleSubscripts: - "Double indice: utilisez des accolades pour clarifier", + DoubleExponent: + "Double exposant: utilisez des accolades pour clarifier", - DoubleExponentPrime: - "Un prime entraine un double exposant: utilisez "+ - "des accolades pour clarifier", + DoubleSubscripts: + "Double indice: utilisez des accolades pour clarifier", - CantUseHash1: - "Vous ne pouvez pas utilisez le caractère #, indiquant un "+ - "paramètre de macro, dans le mode mathématique", + DoubleExponentPrime: + "Un prime entraine un double exposant: utilisez "+ + "des accolades pour clarifier", - CantUseHash2: - "Usage du caractère # non autorisé dans le modèle pour la séquence "+ - "de contrôle %1", + CantUseHash1: + "Vous ne pouvez pas utilisez le caractère #, indiquant un "+ + "paramètre de macro, dans le mode mathématique", - MisplacedMiddle: - "La commande %1 doit être placée à l'intérieur d'une section "+ - "\\left ... \right", + CantUseHash2: + "Usage du caractère # non autorisé dans le modèle pour la séquence "+ + "de contrôle %1", - MisplacedLimits: - "La commande %1 n'est autorisée que sur les opérateurs", + MisplacedMiddle: + "La commande %1 doit être placée à l'intérieur d'une section "+ + "\\left ... \right", - MisplacedMoveRoot: - "La commande %1 n'est autorisée qu'à l'intérieur d'une racine", + MisplacedLimits: + "La commande %1 n'est autorisée que sur les opérateurs", - MultipleMoveRoot: - "Commande %1 redondante", + MisplacedMoveRoot: + "La commande %1 n'est autorisée qu'à l'intérieur d'une racine", - IntegerArg: - "L'argument de la commande %1 doit être un entier", + MultipleMoveRoot: + "Commande %1 redondante", - PositiveIntegerArg: - "L'argument de la commande %1 doit être un entier strictement "+ - "positif", + IntegerArg: + "L'argument de la commande %1 doit être un entier", - NotMathMLToken: - "L'élément %1 n'est pas un élément MathML élémentaire", + PositiveIntegerArg: + "L'argument de la commande %1 doit être un entier strictement "+ + "positif", - InvalidMathMLAttr: - "Attribut MathML non valide: %1", + NotMathMLToken: + "L'élément %1 n'est pas un élément MathML élémentaire", - UnknownAttrForElement: - "Attribut %1 inconnu pour l'élément %2", + InvalidMathMLAttr: + "Attribut MathML non valide: %1", - 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?", + UnknownAttrForElement: + "Attribut %1 inconnu pour l'élément %2", - 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?", + 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?", - MissingArgFor: - "Argument manquant pour la commande %1", + 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?", - ExtraAlignTab: - "Tabulation d'alignement non attendu pour le texte de la commande "+ - "\\cases", + MissingArgFor: + "Argument manquant pour la commande %1", - BracketMustBeDimension: - "L'argument entre crochets de la commande %1 doit être une "+ - "dimension", + ExtraAlignTab: + "Tabulation d'alignement non attendu pour le texte de la commande \\cases", - InvalidEnv: - "Nom d'environnement '%1' non valide", + BracketMustBeDimension: + "L'argument entre crochets de la commande %1 doit être une dimension", - UnknownEnv: - "Environnement '%1' inconnu", + InvalidEnv: + "Nom d'environnement '%1' non valide", - ExtraClose: - "Accolade fermante non attendue", + UnknownEnv: + "Environnement '%1' inconnu", - ExtraCloseInBrackets: - "Accolade fermante non attendue avant le crochet fermant.", + ExtraClose: + "Accolade fermante non attendue", - MissingCloseBracket: - "Impossible de trouver le crochet fermant pour l'argument de la "+ - "commande %1", + ExtraCloseInBrackets: + "Accolade fermante non attendue avant le crochet fermant.", - MissingOrUnrecognizedDelim: - "Délimiteur manquant ou non reconnu pour la commande %1", + MissingCloseBracket: + "Impossible de trouver le crochet fermant pour l'argument de la commande %1", - MissingDimOrUnits: - "Dimension ou unité manquante pour la commande %1", + MissingOrUnrecognizedDelim: + "Délimiteur manquant ou non reconnu pour la commande %1", - ExtraCloseBraceInUpTo: - "Accolade fermante non attendue avant la commande %1", + MissingDimOrUnits: + "Dimension ou unité manquante pour la commande %1", - TokenNotFoundForCommand: - "Impossible de trouver la commande %1 pour la commande %2", + ExtraCloseBraceInUpTo: + "Accolade fermante non attendue avant la commande %1", - MathNotTerminated: - "Expression mathématique non terminée à l'intérieur de cette boite "+ - "de texte", + TokenNotFoundForCommand: + "Impossible de trouver la commande %1 pour la commande %2", - IllegalMacroParam: - "Paramètre de référence de macro non autorisé", + MathNotTerminated: + "Expression mathématique non terminée à l'intérieur de cette boite "+ + "de texte", - MaxBufferSize: - "Taille maximale du tampon interne de MathJax dépassée. " + - "Il y a t'il un appel de macro récursif?", + IllegalMacroParam: + "Paramètre de référence de macro non autorisé", - CommandNotAllowedInEnv: - "La commande %1 n'est pas autorisé à l'intérieur de "+ - "l'environnement %2", + MaxBufferSize: + "Taille maximale du tampon interne de MathJax dépassée. " + + "Il y a t'il un appel de macro récursif?", - MultipleCommand: - "Usage multiple de la commande %1", + CommandNotAllowedInEnv: + "La commande %1 n'est pas autorisé à l'intérieur de "+ + "l'environnement %2", - MultipleLabel: - "Étiquette '%1' déjà définie", + MultipleCommand: + "Usage multiple de la commande %1", - CommandAtTheBeginingOfLine: - "La commande %1 doit être placée en début de ligne", + MultipleLabel: + "Étiquette '%1' déjà définie", - IllegalAlign: - "Alignement non autorisé pour la commande %1", + CommandAtTheBeginingOfLine: + "La commande %1 doit être placée en début de ligne", - BadMathStyleFor: - "Style mathématique non valide pour la commande %1", + IllegalAlign: + "Alignement non autorisé pour la commande %1", - ErroneousNestingEq: - "Emboitement incorrect des structures d'équation", + BadMathStyleFor: + "Style mathématique non valide pour la commande %1", - MultipleRowsOneCol: - "Les lignes multiples doivent avoir exactement une colonne", + ErroneousNestingEq: + "Emboitement incorrect des structures d'équation", - NoClosingDelim: - "Impossible de trouver le délimiteur fermant pour la commande %1", + MultipleRowsOneCol: + "Les lignes multiples doivent avoir exactement une colonne", - NoClosingChar: - "Impossible de trouver le délimiteur '%1' fermant", + NoClosingDelim: + "Impossible de trouver le délimiteur fermant pour la commande %1", - MultipleBBoxProperty: - "La propriété %1 de la commande %2 spécifiée deux fois", + NoClosingChar: + "Impossible de trouver le délimiteur '%1' fermant", - InvalidBBoxProperty: - "La valeur '%1' ne semble pas être une couleur, une dimension ou "+ - "de marge intérieur ou un style.", + MultipleBBoxProperty: + "La propriété %1 de la commande %2 spécifiée deux fois", - ExtraEndMissingBegin: - "Commande %1 non attendue ou commande \\begingroup manquante", + InvalidBBoxProperty: + "La valeur '%1' ne semble pas être une couleur, une dimension ou "+ + "de marge intérieur ou un style.", - GlobalNotFollowedBy: - "Command %1 non suivie d'une commande \\let, \\def ou \newcommand", + ExtraEndMissingBegin: + "Commande %1 non attendue ou commande \\begingroup manquante", - NewextarrowArg1: - "Le premier argument de la commande %1 doit être le nom d'une "+ - "séquence de contrôle", + GlobalNotFollowedBy: + "Command %1 non suivie d'une commande \\let, \\def ou \newcommand", - NewextarrowArg2: - "Le second argument de la commande %1 doit être deux entiers "+ - "séparés par une virgule", + NewextarrowArg1: + "Le premier argument de la commande %1 doit être le nom d'une "+ + "séquence de contrôle", - NewextarrowArg3: - "Le troisième argument de la commande %1 doit être la valeur d'un "+ - "caractère unicode", + NewextarrowArg2: + "Le second argument de la commande %1 doit être deux entiers "+ + "séparés par une virgule", - UndefinedColorModel: - "Le modèle de couleur '%1' n'est pas défini", + NewextarrowArg3: + "Le troisième argument de la commande %1 doit être la valeur d'un "+ + "caractère unicode", - rgbArg1: - "Les couleurs rgb nécéssitent 3 nombres décimaux", + UndefinedColorModel: + "Le modèle de couleur '%1' n'est pas défini", - InvalidDecimalNumber: - "Nombre décimal non valide", + rgbArg1: + "Les couleurs rgb nécéssitent 3 nombres décimaux", - rgbArg2: - "Les valeurs rgb doivent être comprises entre 0 et 1", + InvalidDecimalNumber: + "Nombre décimal non valide", - RGBArg1: - "Les couleurs RGB nécéssitent 3 nombres", + rgbArg2: + "Les valeurs rgb doivent être comprises entre 0 et 1", - InvalidNumber: - "Nombre non valide", + RGBArg1: + "Les couleurs RGB nécéssitent 3 nombres", - RGBArg2: - "Les valeurs RGB doivent être comprises entre 0 et 255", + InvalidNumber: + "Nombre non valide", - GrayScalerArg: - "Les valeurs de dégradé de gris doivent être comprises entre 0 et 1", + RGBArg2: + "Les valeurs RGB doivent être comprises entre 0 et 255", - DoubleBackSlash: - "\\ doit être suivi d'une séquence de contrôle", + GrayScalerArg: + "Les valeurs de dégradé de gris doivent être comprises entre 0 et 1", - SequentialParam: - "Les paramètres de la séquence de contrôle %1 doivent être "+ - "énumérés de façon séquentielle", + DoubleBackSlash: + "\\ doit être suivi d'une séquence de contrôle", - MissingReplacementString: - "Chaine de caractère de remplacement manquante pour la définition %1", + SequentialParam: + "Les paramètres de la séquence de contrôle %1 doivent être "+ + "énumérés de façon séquentielle", - MismatchUseDef: - "L'utilisation de la commande %1 ne correspond pas à sa définition", + MissingReplacementString: + "Chaine de caractère de remplacement manquante pour la définition %1", - RunawayArgument: - "Argument manquant pour la commande %1?" - } + MismatchUseDef: + "L'utilisation de la commande %1 ne correspond pas à sa définition", + + RunawayArgument: + "Argument manquant pour la commande %1?" + } }); diff --git a/unpacked/localization/fr/fr.js b/unpacked/localization/fr/fr.js index ee95a6941..ba7f3ea5e 100644 --- a/unpacked/localization/fr/fr.js +++ b/unpacked/localization/fr/fr.js @@ -1,4 +1,4 @@ -MathJax.Hub.Insert(MathJax.Localization.strings.fr,{ +MathJax.Localization.addTranslation("fr",null,{ isLoaded: true, domains: { "_": { diff --git a/unpacked/localization/fr/v1.0-warning.js b/unpacked/localization/fr/v1.0-warning.js index c2c6568da..d9a1149e1 100644 --- a/unpacked/localization/fr/v1.0-warning.js +++ b/unpacked/localization/fr/v1.0-warning.js @@ -1,14 +1,14 @@ -MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{ - "v1.0-warning": { - isLoaded: true, - strings: { - MissingConfig: - "MathJax ne charge plus de fichier de configuration par défaut; "+ - "vous devez spécifier ces fichiers de façons explicites. Cette "+ - "page semble utiliser l'ancien fichier de configuration par "+ - "défaut %1 and doit donc être mise à jour. Ceci est expliqué "+ - "en détails à l'addresse suivante: %2" - } +MathJax.Localization.addTranslation("fr","v1.0-warning",{ + isLoaded: true, + strings: { + + MissingConfig: + "MathJax ne charge plus de fichier de configuration par défaut; "+ + "vous devez spécifier ces fichiers de façons explicites. Cette "+ + "page semble utiliser l'ancien fichier de configuration par "+ + "défaut %1 and doit donc être mise à jour. Ceci est expliqué "+ + "en détails à l'addresse suivante: %2" + } }); From d6fe660948595024de28791aee35b2200ae7babc Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 7 Apr 2013 11:58:37 -0400 Subject: [PATCH 14/41] Rerender the page after selecting a locale (so error messages will be replaces). Probably should jsut rerender those equations with error messages to avoid delays. --- unpacked/extensions/MathMenu.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index f6ffeaa30..24f3a91b0 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -883,12 +883,11 @@ }; /* - * Handle selection of locale + * Handle selection of locale and rerender the page */ MENU.Locale = function () { MathJax.Localization.setLocale(CONFIG.settings.locale); - // FIXME: Rerender the page? (To force error messages to change?) - // Just rerender error messages? + MathJax.Hub.Queue(["Reprocess",MathJax.Hub]); // FIXME: Just reprocess error messages? }; MENU.LoadLocale = function () { var url = prompt(_("LoadURL","Load translation data from this URL:")); From 8a9187c3a8bc72cb7dd66b0a48a2267f5a843406 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 7 Apr 2013 12:07:43 -0400 Subject: [PATCH 15/41] Add localization for Locale selection menu --- unpacked/localization/fr/MathMenu.js | 36 +++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/unpacked/localization/fr/MathMenu.js b/unpacked/localization/fr/MathMenu.js index 03f2efde4..7bdcab044 100644 --- a/unpacked/localization/fr/MathMenu.js +++ b/unpacked/localization/fr/MathMenu.js @@ -23,22 +23,26 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ Control: "Control", Shift: "Shift", ZoomFactor: "Facteur de Zoom", - Renderer: "Mode de Rendu", - MPHandles: "Laissez MathPlayer Gérer les", - MenuEvents: "Êvénements du menu", - MouseEvents: "Êvénements de la Souris", - MenuAndMouse: "Êvénements de Menu et de la Souris", - FontPrefs: "Préférences des Polices", - ForHTMLCSS: "Pour le HTML-CSS:", - Auto: "Auto", - TeXLocal: "TeX (locales)", - TeXWeb: "TeX (web)", - TeXImage: "TeX (image)", - STIXLocal: "STIX (locales)", - ContextMenu: "Menu Contextuel", - Browser: "Navigateur", - Scale: "Mise à l'échelle des formules ...", - Discoverable: "Mettez en Surbrillance lors du Survol", + Renderer: "Mode de Rendu", + MPHandles: "Laissez MathPlayer Gérer les", + MenuEvents: "Êvénements du menu", + MouseEvents: "Êvénements de la Souris", + MenuAndMouse: "Êvénements de Menu et de la Souris", + FontPrefs: "Préférences des Polices", + ForHTMLCSS: "Pour le HTML-CSS:", + Auto: "Auto", + TeXLocal: "TeX (locales)", + TeXWeb: "TeX (web)", + TeXImage: "TeX (image)", + STIXLocal: "STIX (locales)", + ContextMenu: "Menu Contextuel", + Browser: "Navigateur", + Scale: "Mise à l'échelle des formules ...", + Discoverable: "Mettez en Surbrillance lors du Survol", + Locale: "Locales", + en: "Anglais (en)", + fr: "Français (fr)", + LoadLocale: "Charger à partir d'URL ...", About: "À Propos de MathJax", Help: "Aide MathJax", From 1e0611e88f8b40fd60a96d5ecfaa5a96a66de234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Mon, 8 Apr 2013 12:02:10 +0200 Subject: [PATCH 16/41] Some changes to the French localization data. --- unpacked/localization/fr/FontWarnings.js | 6 +-- unpacked/localization/fr/HTML-CSS.js | 4 +- unpacked/localization/fr/MathML.js | 4 +- unpacked/localization/fr/MathMenu.js | 60 ++++++++++++------------ unpacked/localization/fr/TeX.js | 14 +++--- unpacked/localization/fr/fr.js | 6 +-- unpacked/localization/fr/v1.0-warning.js | 2 +- 7 files changed, 48 insertions(+), 48 deletions(-) diff --git a/unpacked/localization/fr/FontWarnings.js b/unpacked/localization/fr/FontWarnings.js index 2320234d4..ead16dffa 100644 --- a/unpacked/localization/fr/FontWarnings.js +++ b/unpacked/localization/fr/FontWarnings.js @@ -20,13 +20,13 @@ MathJax.Localization.addTranslation("fr","FontWarnings",{ "les expressions mathématiques et les images de caractères ne "+ "sont pas disponibles. Comme solution de dernier recours, il "+ "utilise des caractères Unicode génériques en espérant que votre "+ - "navigateur sera capable de les afficher. Certains pourront ne "+ + "navigateur sera capable de les afficher. Certains pourront "+ "être rendus de façon incorrect voire pas du tout.", webFonts: "La plupart des navigateurs modernes permettent de télécharger "+ - "des polices à partir du Web. En mettant à jour pour une version "+ - "plus récente de votre navigateur (ou en changeant de navigateur) "+ + "des polices à partir du Web. En mettant à jour votre navigateur "+ + "vers une version plus récente (ou en changeant de navigateur) "+ "la qualité des expressions mathématiques sur cette page pourrait "+ "être améliorée.", diff --git a/unpacked/localization/fr/HTML-CSS.js b/unpacked/localization/fr/HTML-CSS.js index 7beb0eae6..32c7b8cb3 100644 --- a/unpacked/localization/fr/HTML-CSS.js +++ b/unpacked/localization/fr/HTML-CSS.js @@ -3,10 +3,10 @@ MathJax.Localization.addTranslation("fr","HTML-CSS",{ strings: { LoadWebFont: - "Téléchargement la police Web %1", + "Téléchargement de la police Web %1", CantLoadWebFont: - "Impossible de télécharcharger la police Web %1", + "Impossible de télécharger la police Web %1", FirefoxCantLoadWebFont: "Firefox ne peut télécharger les polices Web à partir d'un hôte "+ diff --git a/unpacked/localization/fr/MathML.js b/unpacked/localization/fr/MathML.js index 8caf8fab9..ec5340dfd 100644 --- a/unpacked/localization/fr/MathML.js +++ b/unpacked/localization/fr/MathML.js @@ -17,7 +17,7 @@ MathJax.Localization.addTranslation("fr","MathML",{ "le menu Niveau Personalisé. Assurez vous que les paramètres\n"+ "Exécution des contrôles ActiveX et Comportements des exécutables\n"+ "et des scripts sont activés.\n\n"+ - "Actuellement, vous verez des messages d'erreur à la place des\n"+ + "Actuellement, vous verrez des messages d'erreur à la place des\n"+ "expressions mathématiques.", CantCreateXMLParser: @@ -39,7 +39,7 @@ MathJax.Localization.addTranslation("fr","MathML",{ "Le code MathML doit être formé d'un unique élément", MathMLRootElement: - "Le code MathML doit être formé d'un élément et non un élément %1" + "Le code MathML doit être formé d'un élément et non d'un élément %1" } }); diff --git a/unpacked/localization/fr/MathMenu.js b/unpacked/localization/fr/MathMenu.js index 7bdcab044..6823a72b5 100644 --- a/unpacked/localization/fr/MathMenu.js +++ b/unpacked/localization/fr/MathMenu.js @@ -2,55 +2,55 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ isLoaded: true, strings: { - Show: "Afficher la Formule sous Forme", - MathMLcode: "de Code MathML", - OriginalMathML: "de Code MathML d'Origine", - TeXCommands: "de Commandes TeX", - AsciiMathInput: "de code AsciiMathml", - Original: "d'Origine", - ErrorMessage: "de Message d'Erreur", + Show: "Afficher la formule sous forme", + MathMLcode: "de code MathML", + OriginalMathML: "de code MathML originel", + TeXCommands: "de commandes TeX", + AsciiMathInput: "de code AsciiMathML", + Original: "originelle", + ErrorMessage: "de message d'erreur", texHints: "Afficher les indications TeX dans le code MathML", Settings: "Paramètres des formules", - ZoomTrigger: "Déclenchement du Zoom par", - Hover: "Survol de la Souris", - Click: "Clic de Souris", - DoubleClick: "Double-Clic", - NoZoom: "Pas de Zoom", + ZoomTrigger: "Déclenchement du zoom par", + Hover: "Survol de la souris", + Click: "Clic de souris", + DoubleClick: "Double-clic", + NoZoom: "Pas de zoom", TriggerRequires: "Le déclenchement nécessite l'appui sur la touche", Option: "Option", Alt: "Alt", Command: "Command", Control: "Control", Shift: "Shift", - ZoomFactor: "Facteur de Zoom", - Renderer: "Mode de Rendu", - MPHandles: "Laissez MathPlayer Gérer les", - MenuEvents: "Êvénements du menu", - MouseEvents: "Êvénements de la Souris", - MenuAndMouse: "Êvénements de Menu et de la Souris", - FontPrefs: "Préférences des Polices", + ZoomFactor: "Facteur de zoom", + Renderer: "Mode de rendu", + MPHandles: "Laissez MathPlayer gérer les", + MenuEvents: "Évènements du menu", + MouseEvents: "Évènements de la souris", + MenuAndMouse: "Évènements de menu et de la souris", + FontPrefs: "Préférences des polices", ForHTMLCSS: "Pour le HTML-CSS:", Auto: "Auto", TeXLocal: "TeX (locales)", TeXWeb: "TeX (web)", TeXImage: "TeX (image)", STIXLocal: "STIX (locales)", - ContextMenu: "Menu Contextuel", + ContextMenu: "Menu contextuel", Browser: "Navigateur", Scale: "Mise à l'échelle des formules ...", - Discoverable: "Mettez en Surbrillance lors du Survol", - Locale: "Locales", + Discoverable: "Mettez en surbrillance lors du survol", + Locale: "Langue", en: "Anglais (en)", fr: "Français (fr)", - LoadLocale: "Charger à partir d'URL ...", - About: "À Propos de MathJax", + LoadLocale: "Charger à partir d'une adresse URL...", + About: "À propos de MathJax", Help: "Aide MathJax", - localTeXfonts: "utilisant les polices locales TeX", - webTeXfonts: "utilisant les polices internet TeX", - imagefonts: "utilisant les polices d'image", - localSTIXfonts: "utilisant les polices locales STIX", - webSVGfonts: "utilisant les polices internet SVG", + localTeXfonts: "utilisant les polices TeX locales", + webTeXfonts: "utilisant les polices TeX Web", + imagefonts: "utilisant les images de caractères", + localSTIXfonts: "utilisant les polices STIX locales", + webSVGfonts: "utilisant les polices SVG Web", genericfonts: "utilisant les polices locales génériques", wofforotffonts: "les polices woff ou otf", @@ -107,7 +107,7 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ "en utilisant la commande Alt-Clic sur une expression.", NoOriginalForm: - "Aucune forme d'origine disponible.", + "Aucune forme originelle disponible.", Close: "Fermer", diff --git a/unpacked/localization/fr/TeX.js b/unpacked/localization/fr/TeX.js index 8ef858c52..f23de25c3 100644 --- a/unpacked/localization/fr/TeX.js +++ b/unpacked/localization/fr/TeX.js @@ -9,13 +9,13 @@ MathJax.Localization.addTranslation("fr","TeX",{ "Accolade fermante non attendue ou accolade ouvrante manquante", MissingLeftExtraRight: - "Commande \\left manquante or ou commande \\right non attendue", + "Commande \\left manquante ou commande \\right non attendue", MissingScript: "Argument en exposant ou en indice manquant", ExtraLeftMissingRight: - "Commande \\left inattendue or ou commande \\right manquante", + "Commande \\left inattendue ou commande \\right manquante", Misplaced: "Mauvaise position pour la commande %1", @@ -106,7 +106,7 @@ MathJax.Localization.addTranslation("fr","TeX",{ "Argument manquant pour la commande %1", ExtraAlignTab: - "Tabulation d'alignement non attendu pour le texte de la commande \\cases", + "Tabulation d'alignement non attendue pour le texte de la commande \\cases", BracketMustBeDimension: "L'argument entre crochets de la commande %1 doit être une dimension", @@ -181,17 +181,17 @@ MathJax.Localization.addTranslation("fr","TeX",{ "Impossible de trouver le délimiteur '%1' fermant", MultipleBBoxProperty: - "La propriété %1 de la commande %2 spécifiée deux fois", + "La propriété %1 de la commande %2 est spécifiée deux fois", InvalidBBoxProperty: - "La valeur '%1' ne semble pas être une couleur, une dimension ou "+ - "de marge intérieur ou un style.", + "La valeur '%1' ne semble pas être une couleur, une dimension 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", + "Commande %1 non suivie d'une commande \\let, \\def ou \newcommand", NewextarrowArg1: "Le premier argument de la commande %1 doit être le nom d'une "+ diff --git a/unpacked/localization/fr/fr.js b/unpacked/localization/fr/fr.js index ba7f3ea5e..8c0fd07d1 100644 --- a/unpacked/localization/fr/fr.js +++ b/unpacked/localization/fr/fr.js @@ -7,8 +7,8 @@ MathJax.Localization.addTranslation("fr",null,{ CookieConfig: "MathJax a trouvé un cookie de configuration utilisateur qui inclut "+ - "du code à exécuter. Souhaitez vous l'exécuter?\n\n"+ - "(Choisissez Annuler sauf si vous avez créé ce cookie vous-même", + "du code exécutable. Souhaitez vous l'exécuter?\n\n"+ + "(Choisissez Annuler sauf si vous avez créé ce cookie vous-même)", MathProcessingError: "Erreur de traitement de la formule mathématique", @@ -16,7 +16,7 @@ MathJax.Localization.addTranslation("fr",null,{ MathError: "Erreur dans la formule mathématique", - LoadFile: "Téléchargement %1", + LoadFile: "Téléchargement de %1", Loading: "Téléchargement", diff --git a/unpacked/localization/fr/v1.0-warning.js b/unpacked/localization/fr/v1.0-warning.js index d9a1149e1..8a929a8dc 100644 --- a/unpacked/localization/fr/v1.0-warning.js +++ b/unpacked/localization/fr/v1.0-warning.js @@ -6,7 +6,7 @@ MathJax.Localization.addTranslation("fr","v1.0-warning",{ "MathJax ne charge plus de fichier de configuration par défaut; "+ "vous devez spécifier ces fichiers de façons explicites. Cette "+ "page semble utiliser l'ancien fichier de configuration par "+ - "défaut %1 and doit donc être mise à jour. Ceci est expliqué "+ + "défaut %1 et doit donc être mise à jour. Ceci est expliqué "+ "en détails à l'addresse suivante: %2" } From eeea99922bee658a09b643d3276bf3099d1d9dee Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 8 Apr 2013 10:02:26 -0400 Subject: [PATCH 17/41] Fix a problem with localiztion when substituted value is 0. Make language menu choices be in the given language. Allow better localization of Jax/Extensions in About box. Only update langauge menu when a new language is actually loaded. Shorten a number of French menu items to improve menu appearance. Correct some problems with FontWarnings and v1.0-warning messages. Move language menu to initial MathJax menu rather than a submenu. Fix a problem with canceling selection of renderer not reseting the menu selection. --- unpacked/MathJax.js | 15 +++++------ unpacked/extensions/FontWarnings.js | 36 +++++++++++++++------------ unpacked/extensions/MathMenu.js | 37 +++++++++++++++------------- unpacked/extensions/v1.0-warning.js | 3 ++- unpacked/localization/fr/MathMenu.js | 18 ++++++-------- 5 files changed, 58 insertions(+), 51 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index d7a70fa8d..0daa0474e 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1059,7 +1059,7 @@ MathJax.Localization = { directory: "[MathJax]/localization", strings: { en: {isLoaded: true, menuTitle: "English"}, // nothing needs to be loaded for this - fr: {menuTitle: "French"} + fr: {menuTitle: "Fran\u00E7ais"} }, // @@ -1089,12 +1089,12 @@ MathJax.Localization = { for (var i = 1, m = parts.length; i < m; i += 2) { var c = parts[i].charAt(0); // first char will be { or \d or a char to be kept literally if (c >= "0" && c <= "9") { // %n - parts[i] = args[parts[i]-1] || "???"; + parts[i] = args[parts[i]-1]; if (typeof parts[i] === "number") parts[i] = this.number(parts[i]); } else if (c === "{") { // %{n} or %{plural:%n|...} c = parts[i].substr(1); if (c >= "0" && c <= "9") { // %{n} - parts[i] = args[parts[i].substr(1,parts[i].length-2)-1] || "???"; + parts[i] = args[parts[i].substr(1,parts[i].length-2)-1]; if (typeof parts[i] === "number") parts[i] = this.number(parts[i]); } else { // %{plural:%n|...} var match = parts[i].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/); @@ -1112,10 +1112,11 @@ MathJax.Localization = { parts[i] = "???"; // no string for this index } } - } else {parts[i] = "%"+parts[i]} // not "plural:put back the % and leave unchanged + } else {parts[i] = "%"+parts[i]} // not "plural", put back the % and leave unchanged } } } + if (parts[i] == null) {parts[i] = "???"} } // // If we are not forming a snippet, return the completed string @@ -1294,15 +1295,15 @@ MathJax.Localization = { // Add or update a language or domain // addTranslation: function (locale,domain,definition) { - var data = this.strings[locale]; - if (!data) {data = this.strings[locale] = {}} + var data = this.strings[locale], isNew = false; + if (!data) {data = this.strings[locale] = {}; isNew = true} if (!data.domains) {data.domains = {}} if (domain) { if (!data.domains[domain]) {data.domains[domain] = {}} data = data.domains[domain]; } MathJax.Hub.Insert(data,definition); - if (!domain && MathJax.Menu) {MathJax.Menu.CreateLocaleMenu()} + if (isNew && MathJax.Menu) {MathJax.Menu.CreateLocaleMenu()} }, // diff --git a/unpacked/extensions/FontWarnings.js b/unpacked/extensions/FontWarnings.js index d633684f1..7b5a7653c 100644 --- a/unpacked/extensions/FontWarnings.js +++ b/unpacked/extensions/FontWarnings.js @@ -178,23 +178,24 @@ [["span",{style:{position:"relative", bottom:".2em"}},["x"]]] ]], - webfonts: [ - ["p"], - ["webfonts", - "Most modern browsers allow for fonts to be downloaded over the web. "+ - "Updating to a more recent version of your browser (or changing "+ - "browsers) could improve the quality of the mathematics on this page." - ] - ], + webfonts: [ + ["p"], + ["webfonts", + "Most modern browsers allow for fonts to be downloaded over the web. "+ + "Updating to a more recent version of your browser (or changing "+ + "browsers) could improve the quality of the mathematics on this page." + ] + ], - fonts: [ - ["p"], - ["fonts", - "MathJax can use either the %1 or the %2", - [["a",{href:STIXURL,target:"_blank"},[["STIXfonts","STIX fonts"]]]], - [["a",{href:MATHJAXURL,target:"_blank"},[["TeXfonts","MathJax TeX fonts"]]]] - ] - ], + fonts: [ + ["p"], + ["fonts", + "MathJax can use either the %1 or the %2. " + + "Download and install one of those fonts to improve your MathJax experience.", + [["a",{href:STIXURL,target:"_blank"},[["STIXfonts","STIX fonts"]]]], + [["a",{href:MATHJAXURL,target:"_blank"},[["TeXfonts","MathJax TeX fonts"]]]] + ] + ], // fonts: [ // ["p"], @@ -258,6 +259,8 @@ if (data[i].length === 1 && CONFIG.HTML[data[i][0]]) { data.splice.apply(data,[i,1].concat(CONFIG.HTML[data[i][0]])); } else if (typeof data[i][1] === "string") { + var message = MathJax.Localization.lookupPhrase(["FontWarnings",data[i][0]],data[i][1]); + message = MathJax.Localization.processString(message,data[i].slice(2),"FontWarnings"); data.splice.apply(data,[i,1].concat(message)); i += message.length; } else {i++} @@ -265,6 +268,7 @@ } DATA.div = HTMLCSS.addElement(frame,"div", {id:"MathJax_FontWarning",style:CONFIG.messageStyle},data); + MathJax.Localization.setCSS(DATA.div); if (CONFIG.removeAfter) { HUB.Register.StartupHook("End",function () {DATA.timer = setTimeout(FADEOUT,CONFIG.removeAfter)}); diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index 24f3a91b0..7de5c8c09 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -629,11 +629,11 @@ HTMLCSS.allowWebFonts.replace(/otf/,"woff or otf") + " fonts"); var jax = ["MathJax.js v"+MathJax.fileversion,["br"]]; jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}]); - MENU.About.GetJax(jax,MathJax.InputJax,_("InputJax","Input Jax")); - MENU.About.GetJax(jax,MathJax.OutputJax,_("OutputJax","Output Jax")); - MENU.About.GetJax(jax,MathJax.ElementJax,_("ElementJax","Element Jax")); + MENU.About.GetJax(jax,MathJax.InputJax,["InputJax","%1 Input Jax v%2"]); + MENU.About.GetJax(jax,MathJax.OutputJax,["OutputJax","%1 Output Jax v%2"]); + MENU.About.GetJax(jax,MathJax.ElementJax,["ElementJax","%1 Element Jax v%2"]); jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}]); - MENU.About.GetJax(jax,MathJax.Extension,_("Extension","Extension"),true); + MENU.About.GetJax(jax,MathJax.Extension,["Extension","%1 Extension v%2"],true); jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}],["center",{},[ HUB.Browser + " v"+HUB.Browser.version + (format ? " \u2014 " + _(format.replace(/ /g,""),format) : "") @@ -675,7 +675,7 @@ var info = []; for (var id in JAX) {if (JAX.hasOwnProperty(id) && JAX[id]) { if ((noTypeCheck && JAX[id].version) || (JAX[id].isa && JAX[id].isa(JAX))) - {info.push((JAX[id].id||id)+" "+type+" v"+JAX[id].version)} + {info.push(_(type[0],type[1],(JAX[id].id||id),JAX[id].version))} }} info.sort(); for (var i = 0, m = info.length; i < m; i++) {jax.push(info[i],["br"])} @@ -831,8 +831,13 @@ message += _("SwitchAnyway", "Switch the renderer anyway?\n\n" + "(Press OK to switch, CANCEL to continue with the current renderer)"); - MENU.cookie.renderer = jax[0].id; MENU.saveCookie(); if (!confirm(message)) {return} - if (warned) {MENU.cookie[warned] = CONFIG.settings[warned] = true} + MENU.cookie.renderer = jax[0].id; MENU.saveCookie(); + if (!confirm(message)) { + MENU.cookie.renderer = CONFIG.settings.renderer = HTML.Cookie.Get("menu").renderer; + MENU.saveCookie(); + return; + } + if (warned) {MENU.cookie.warned = CONFIG.settings.warned = true} MENU.cookie.renderer = CONFIG.settings.renderer; MENU.saveCookie(); } HUB.Queue( @@ -1042,13 +1047,12 @@ ), ITEM.COMMAND(["Scale","Scale All Math ..."],MENU.Scale), ITEM.RULE().With({hidden:!CONFIG.showDiscoverable, name:["","discover_rule"]}), - ITEM.CHECKBOX(["Discoverable","Highlight on Hover"], "discoverable", {hidden:!CONFIG.showDiscoverable}), - ITEM.RULE().With({hidden:!CONFIG.showLocale, name:["","locale_rule"]}), - ITEM.SUBMENU(["Locale","Locale"], {hidden:!CONFIG.showLocale}, - ITEM.RADIO("en", "locale", {action: MENU.Locale}), - ITEM.RULE(), - ITEM.COMMAND(["LoadLocale","Load from URL ..."], MENU.LoadLocale) - ) + ITEM.CHECKBOX(["Discoverable","Highlight on Hover"], "discoverable", {hidden:!CONFIG.showDiscoverable}) + ), + ITEM.SUBMENU(["Locale","Language"], {hidden:!CONFIG.showLocale}, + ITEM.RADIO("en", "locale", {action: MENU.Locale}), + ITEM.RULE(), + ITEM.COMMAND(["LoadLocale","Load from URL ..."], MENU.LoadLocale) ), ITEM.RULE(), ITEM.COMMAND(["About","About MathJax"],MENU.About), @@ -1075,7 +1079,7 @@ // Creates the locale menu from the list of locales in MathJax.Localization.strings // MENU.CreateLocaleMenu = function () { - var menu = MENU.menu.Find("Math Settings","Locale").menu, items = menu.items; + var menu = MENU.menu.Find("Language").menu, items = menu.items; // // Get the names of the languages and sort them // @@ -1120,8 +1124,7 @@ }; MENU.showLocale = function (show) { MENU.cookie.showLocale = CONFIG.showLocale = show; MENU.saveCookie(); - MENU.menu.Find("Math Settings","Locale").hidden = !show; - MENU.menu.Find("Math Settings","locale_rule").hidden = !show; + MENU.menu.Find("Language").hidden = !show; }; MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { diff --git a/unpacked/extensions/v1.0-warning.js b/unpacked/extensions/v1.0-warning.js index b269f24bf..750c26507 100644 --- a/unpacked/extensions/v1.0-warning.js +++ b/unpacked/extensions/v1.0-warning.js @@ -84,7 +84,7 @@ "MathJax no longer loads a default configuration file; " + "you must specify such files explicitly. " + "This page seems to use the older default %1 " + - "file, and so needs to be updated. This is explained further at %1", + "file, and so needs to be updated. This is explained further at %2", [["code",{},["config/MathJax.js"]]], [["p",{style:{"text-align":"center"}},[ ["a", @@ -95,6 +95,7 @@ ] ]) ); + MathJax.Localization.setCSS(DIV); }); }); diff --git a/unpacked/localization/fr/MathMenu.js b/unpacked/localization/fr/MathMenu.js index 6823a72b5..3c7e3484d 100644 --- a/unpacked/localization/fr/MathMenu.js +++ b/unpacked/localization/fr/MathMenu.js @@ -2,21 +2,21 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ isLoaded: true, strings: { - Show: "Afficher la formule sous forme", + Show: "Afficher sous forme", MathMLcode: "de code MathML", OriginalMathML: "de code MathML originel", TeXCommands: "de commandes TeX", AsciiMathInput: "de code AsciiMathML", Original: "originelle", ErrorMessage: "de message d'erreur", - texHints: "Afficher les indications TeX dans le code MathML", - Settings: "Paramètres des formules", - ZoomTrigger: "Déclenchement du zoom par", + texHints: "Inclure les données TeX dans le MathML", + Settings: "Paramètres", + ZoomTrigger: "Déclenchement du zoom", Hover: "Survol de la souris", Click: "Clic de souris", DoubleClick: "Double-clic", NoZoom: "Pas de zoom", - TriggerRequires: "Le déclenchement nécessite l'appui sur la touche", + TriggerRequires: "Le déclenchement nécessite la touche", Option: "Option", Alt: "Alt", Command: "Command", @@ -37,12 +37,10 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ STIXLocal: "STIX (locales)", ContextMenu: "Menu contextuel", Browser: "Navigateur", - Scale: "Mise à l'échelle des formules ...", + Scale: "Mise à l'échelle ...", Discoverable: "Mettez en surbrillance lors du survol", - Locale: "Langue", - en: "Anglais (en)", - fr: "Français (fr)", - LoadLocale: "Charger à partir d'une adresse URL...", + Locale: "Langue", + LoadLocale: "Charger à partir de l'URL...", About: "À propos de MathJax", Help: "Aide MathJax", From 7cd9180b0b1b315af98a9fbd4c576f0d54655658 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 9 Apr 2013 13:13:25 -0400 Subject: [PATCH 18/41] Fix a number of message ID's and message texts. Add menuTitle to fr.js file. --- unpacked/extensions/MathMenu.js | 4 ++-- unpacked/extensions/TeX/AMSmath.js | 2 +- unpacked/jax/input/MathML/jax.js | 2 +- unpacked/jax/input/TeX/jax.js | 22 +++++++++++----------- unpacked/jax/output/NativeMML/jax.js | 4 ---- unpacked/localization/fr/MathMenu.js | 10 ++++++++++ unpacked/localization/fr/TeX.js | 13 +++++-------- unpacked/localization/fr/fr.js | 1 + 8 files changed, 31 insertions(+), 27 deletions(-) diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index 7de5c8c09..293559d11 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -773,7 +773,7 @@ MENU.Scale = function () { var HTMLCSS = OUTPUT["HTML-CSS"], nMML = OUTPUT.NativeMML, SVG = OUTPUT.SVG; var SCALE = (HTMLCSS||nMML||SVG||{config:{scale:100}}).config.scale; - var scale = prompt(_("ScaleMath", "Scale all mathematics (compared to surrounding text) by"),SCALE+"%"); + var scale = prompt(_("ScaleMath","Scale all mathematics (compared to surrounding text) by"),SCALE+"%"); if (scale) { if (scale.match(/^\s*\d+(\.\d*)?\s*%?\s*$/)) { scale = parseFloat(scale); @@ -873,7 +873,7 @@ SVG: { MSIE: ["MSIESVGWarning", "SVG is not implemented in Internet Explorer prior to " + - "IE9, or when the browser is emulating IE8 or below. " + + "IE9 or when it is emulating IE8 or below. " + "Switching to SVG output will cause the mathemtics to " + "not display properly."] } diff --git a/unpacked/extensions/TeX/AMSmath.js b/unpacked/extensions/TeX/AMSmath.js index c5bc4ce86..819716d50 100644 --- a/unpacked/extensions/TeX/AMSmath.js +++ b/unpacked/extensions/TeX/AMSmath.js @@ -460,7 +460,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { }, EndRow: function () { if (this.row.length != 1) { - TEX.Error(["MultipleRowsOneCol", + TEX.Error(["MultlineRowsOneCol", "multline rows must have exactly one column"]); } this.table.push(this.row); this.row = []; diff --git a/unpacked/jax/input/MathML/jax.js b/unpacked/jax/input/MathML/jax.js index dcb3ef2d2..892d514d0 100644 --- a/unpacked/jax/input/MathML/jax.js +++ b/unpacked/jax/input/MathML/jax.js @@ -287,7 +287,7 @@ return(this.parseDIV); }, parserCreationError: function () { - alert(_("MathPlayer", + alert(_("CantCreateXMLParser", "MathJax can't create an XML parser for MathML. Check that\n"+ "the 'Script ActiveX controls marked safe for scripting' security\n"+ "setting is enabled (use the Internet Options item in the Tools\n"+ diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index 642a643cd..b942c5336 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -80,8 +80,8 @@ var STACKITEM = STACK.Item = MathJax.Object.Subclass({ type: "base", - closeError: ["ExtraCloseMissingOpen","Extra close brace or missing open brace"], - rightError: ["MissingLeftExtraRight","Missing \\left or extra \\right"], + closeError: /*_()*/ ["ExtraCloseMissingOpen","Extra close brace or missing open brace"], + rightError: /*_()*/ ["MissingLeftExtraRight","Missing \\left or extra \\right"], Init: function () { if (this.isOpen) {this.env = {}} this.data = []; @@ -98,7 +98,7 @@ if (item.type === "over" && this.isOpen) {item.num = this.mmlData(false); this.data = []} if (item.type === "cell" && this.isOpen) { if (item.linebreak) {return false} - TEX.Error(["Misplaced %1","Misplaced ",item.name]); + TEX.Error(["Misplaced","Misplaced %1",item.name]); } if (item.isClose && this[item.type+"Error"]) {TEX.Error(this[item.type+"Error"])} if (!item.isNotStack) {return true} @@ -129,7 +129,7 @@ STACKITEM.open = STACKITEM.Subclass({ type: "open", isOpen: true, - stopError: ["ExtraOpenMissingClose","Extra open brace or missing close brace"], + stopError: /*_()*/ ["ExtraOpenMissingClose","Extra open brace or missing close brace"], checkItem: function (item) { if (item.type === "close") { var mml = this.mmlData(); @@ -155,7 +155,7 @@ STACKITEM.subsup = STACKITEM.Subclass({ type: "subsup", - stopError: ["MissingScript","Missing superscript or subscript argument"], + stopError: /*_()*/ ["MissingScript","Missing superscript or subscript argument"], checkItem: function (item) { var script = ["","subscript","superscript"][this.position]; if (item.type === "open" || item.type === "left") {return true} @@ -195,7 +195,7 @@ STACKITEM.left = STACKITEM.Subclass({ type: "left", isOpen: true, delim: '(', - stopError: ["ExtraLeftMissingRight", "Extra \\left or missing \\right"], + stopError: /*_()*/ ["ExtraLeftMissingRight", "Extra \\left or missing \\right"], checkItem: function (item) { if (item.type === "right") { var mml = MML.mfenced(this.data.length === 1 ? this.data[0] : MML.mrow.apply(MML,this.data)); @@ -1371,7 +1371,7 @@ }, MoveRoot: function (name,id) { if (!this.stack.env.inRoot) - {TEX.Error(["BadMoveRoot","%1 can appear only within a root"])} + {TEX.Error(["MisplacedMoveRoot","%1 can appear only within a root",name])} if (this.stack.global[id]) {TEX.Error(["MultipleMoveRoot","Multiple use of %1",name])} var n = this.GetArgument(name); @@ -1432,7 +1432,7 @@ data = this.GetArgument(name), def = {attrNames:[]}, match; if (!MML[type] || !MML[type].prototype.isToken) - {TEX.Error(["NotMathMLToken", "%1 is not a token element",type])} + {TEX.Error(["NotMathMLToken","%1 is not a token element",type])} while (attr !== "") { match = attr.match(/^([a-z]+)\s*=\s*('[^']*'|\"[^"]*"|[^ ]*)\s*/i); if (!match) @@ -1589,7 +1589,7 @@ this.string = this.AddArgs(macro,this.string.slice(this.i)); this.i = 0; if (++this.macroCount > TEX.config.MAXMACROS) { - TEX.Error(["MaxMacroSub", + TEX.Error(["MaxMacroSub1", "MathJax maximum macro substitution count exceeded; " + "is there a recursive macro call?"]); } @@ -1866,7 +1866,7 @@ case '\\': this.i++; break; case '}': if (parens-- <= 0) { - TEX.Error(["ExtraCloseBrace", + TEX.Error(["ExtraCloseLooking", "Extra close brace while looking for %1","']'"]); } break; @@ -1928,7 +1928,7 @@ case '{': parens++; break; case '}': if (parens == 0) { - TEX.Error(["ExtraCloseBrace", + TEX.Error(["ExtraCloseLooking", "Extra close brace while looking for %1",token]) } parens--; diff --git a/unpacked/jax/output/NativeMML/jax.js b/unpacked/jax/output/NativeMML/jax.js index e982b3f13..914ec349d 100644 --- a/unpacked/jax/output/NativeMML/jax.js +++ b/unpacked/jax/output/NativeMML/jax.js @@ -141,10 +141,6 @@ // // If that fails, give an alert about security settings // - // Localization: this seems to use "\n" to force new lines in the - // dialog: is it really necessary? If so, we need a localization note - // to explain that to localizers. Handling of concatenation might - // be an additional difficulty for the string extractor. alert(MathJax.Localization._(["MathML", "MathPlayer"], "MathJax was not able to set up MathPlayer.\n\n"+ "If MathPlayer is not installed, you need to install it first.\n"+ diff --git a/unpacked/localization/fr/MathMenu.js b/unpacked/localization/fr/MathMenu.js index 3c7e3484d..f4cf4d3b8 100644 --- a/unpacked/localization/fr/MathMenu.js +++ b/unpacked/localization/fr/MathMenu.js @@ -78,6 +78,16 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ "toutes les fonctionnalités requises par MathJax, certaines " + "expressions pourront donc ne pas s'afficher correctement.", + LoadURL: + "Load translation data from this URL:", + + BadURL: + "The URL should be for a javascript file that defines MathJax translation data. " + + "Javascript file names should end with '.js'", + + BadData: + "Failed to load translation data from %1", + SwitchAnyway: "Êtes vous certain de vouloir changer le mode de rendu ?\n\n" + "Appuyez sur OK pour valider ou Annuler pour continuer avec le " + diff --git a/unpacked/localization/fr/TeX.js b/unpacked/localization/fr/TeX.js index f23de25c3..a7358e1e6 100644 --- a/unpacked/localization/fr/TeX.js +++ b/unpacked/localization/fr/TeX.js @@ -75,8 +75,8 @@ MathJax.Localization.addTranslation("fr","TeX",{ MisplacedMoveRoot: "La commande %1 n'est autorisée qu'à l'intérieur d'une racine", - MultipleMoveRoot: - "Commande %1 redondante", + MultipleCommand: + "Usage multiple de la commande %1", IntegerArg: "L'argument de la commande %1 doit être un entier", @@ -120,8 +120,8 @@ MathJax.Localization.addTranslation("fr","TeX",{ ExtraClose: "Accolade fermante non attendue", - ExtraCloseInBrackets: - "Accolade fermante non attendue avant le crochet fermant.", + ExtraCloseLooking: + "Extra close brace while looking for %1" MissingCloseBracket: "Impossible de trouver le crochet fermant pour l'argument de la commande %1", @@ -132,9 +132,6 @@ MathJax.Localization.addTranslation("fr","TeX",{ MissingDimOrUnits: "Dimension ou unité manquante pour la commande %1", - ExtraCloseBraceInUpTo: - "Accolade fermante non attendue avant la commande %1", - TokenNotFoundForCommand: "Impossible de trouver la commande %1 pour la commande %2", @@ -171,7 +168,7 @@ MathJax.Localization.addTranslation("fr","TeX",{ ErroneousNestingEq: "Emboitement incorrect des structures d'équation", - MultipleRowsOneCol: + MultlineRowsOneCol: "Les lignes multiples doivent avoir exactement une colonne", NoClosingDelim: diff --git a/unpacked/localization/fr/fr.js b/unpacked/localization/fr/fr.js index 8c0fd07d1..f8c21e277 100644 --- a/unpacked/localization/fr/fr.js +++ b/unpacked/localization/fr/fr.js @@ -1,4 +1,5 @@ MathJax.Localization.addTranslation("fr",null,{ + menuTitle: "Fran\u00E7ais", isLoaded: true, domains: { "_": { From 2b92cd50fef7dc4a92fef29451e51c19e75ebda0 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 9 Apr 2013 13:17:36 -0400 Subject: [PATCH 19/41] Add localization/en directory (never actually used, but can serve as template for other translations until we have a program that manages the data files). --- unpacked/localization/en/FontWarnings.js | 44 ++++ unpacked/localization/en/HTML-CSS.js | 23 +++ unpacked/localization/en/MathML.js | 52 +++++ unpacked/localization/en/MathMenu.js | 129 ++++++++++++ unpacked/localization/en/TeX.js | 248 +++++++++++++++++++++++ unpacked/localization/en/en.js | 58 ++++++ unpacked/localization/en/v1.0-warning.js | 14 ++ 7 files changed, 568 insertions(+) create mode 100644 unpacked/localization/en/FontWarnings.js create mode 100644 unpacked/localization/en/HTML-CSS.js create mode 100644 unpacked/localization/en/MathML.js create mode 100644 unpacked/localization/en/MathMenu.js create mode 100644 unpacked/localization/en/TeX.js create mode 100644 unpacked/localization/en/en.js create mode 100644 unpacked/localization/en/v1.0-warning.js diff --git a/unpacked/localization/en/FontWarnings.js b/unpacked/localization/en/FontWarnings.js new file mode 100644 index 000000000..97787deb2 --- /dev/null +++ b/unpacked/localization/en/FontWarnings.js @@ -0,0 +1,44 @@ +MathJax.Localization.addTranslation("en","FontWarnings",{ + isLoaded: true, + strings: { + + webFont: + "MathJax is using web-based fonts to display the mathematics "+ + "on this page. These take time to download, so the page would "+ + "render faster if you installed math fonts directly in your "+ + "system's font folder.", + + imageFonts: + "MathJax is using its image fonts rather than local or web-based fonts. "+ + "This will render slower than usual, and the mathematics may not print "+ + "at the full resolution of your printer.", + + noFonts: + "MathJax is unable to locate a font to use to display "+ + "its mathematics, and image fonts are not available, so it "+ + "is falling back on generic unicode characters in hopes that "+ + "your browser will be able to display them. Some characters "+ + "may not show up properly, or possibly not at all.", + + webFonts: + "Most modern browsers allow for fonts to be downloaded over the web. "+ + "Updating to a more recent version of your browser (or changing "+ + "browsers) could improve the quality of the mathematics on this page.", + + fonts: + "MathJax can use either the %1 or the %2. " + + "Download and install one of those fonts to improve your MathJax experience.", + + PageDesigned: + "This page is designed to use the %1. " + + "Download and install those fonts to improve your MathJax experience.", + + STIXfonts: + "STIX fonts", + + TeXfonts: + "MathJax TeX fonts" + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/en/FontWarnings.js"); diff --git a/unpacked/localization/en/HTML-CSS.js b/unpacked/localization/en/HTML-CSS.js new file mode 100644 index 000000000..a1725c42d --- /dev/null +++ b/unpacked/localization/en/HTML-CSS.js @@ -0,0 +1,23 @@ +MathJax.Localization.addTranslation("en","HTML-CSS",{ + isLoaded: true, + strings: { + + LoadWebFont: + "Loading web-font %1", + + CantLoadWebFont: + "Can't load web font %1", + + FirefoxCantLoadWebFont: + "Firefox can't load web fonts from a remote host", + + CantFindFontUsing: + "Can't find a valid font using %1", + + WebFontsNotAvailable: + "Web-Fonts not available -- using image fonts instead" + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/en/HTML-CSS.js"); diff --git a/unpacked/localization/en/MathML.js b/unpacked/localization/en/MathML.js new file mode 100644 index 000000000..eebd1e388 --- /dev/null +++ b/unpacked/localization/en/MathML.js @@ -0,0 +1,52 @@ +MathJax.Localization.addTranslation("en","MathML",{ + isLoaded: true, + strings: { + + BadMglyph: + "Bad mglyph: %1", + + BadMglyphFont: + "Bad font: %1", + + MathPlayer: + "MathJax was not able to set up MathPlayer.\n\n"+ + "If MathPlayer is not installed, you need to install it first.\n"+ + "Otherwise, your security settings may be preventing ActiveX \n"+ + "controls from running. Use the Internet Options item under\n"+ + "the Tools menu and select the Security tab, then press the\n"+ + "Custom Level button. Check that the settings for\n"+ + "'Run ActiveX Controls', and 'Binary and script behaviors'\n"+ + "are enabled.\n\n"+ + "Currently you will see error messages rather than\n"+ + "typeset mathematics.", + + CantCreateXMLParser: + "MathJax can't create an XML parser for MathML. Check that\n"+ + "the 'Script ActiveX controls marked safe for scripting' security\n"+ + "setting is enabled (use the Internet Options item in the Tools\n"+ + "menu, and select the Security panel, then press the Custom Level\n"+ + "button to check this).\n\n"+ + "MathML equations will not be able to be processed by MathJax.", + + UnknownNodeType: + "Unknown node type: %1", + + UnexpectedTextNode: + "Unexpected text node: %1", + + ErrorParsingMathML: + "Error parsing MathML", + + ParsingError: + "Error parsing MathML: %1", + + MathMLSingleElement: + "MathML must be formed by a single element", + + MathMLRootElement: + "MathML must be formed by a element, not %1" + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/en/MathML.js"); diff --git a/unpacked/localization/en/MathMenu.js b/unpacked/localization/en/MathMenu.js new file mode 100644 index 000000000..0dffc6cfe --- /dev/null +++ b/unpacked/localization/en/MathMenu.js @@ -0,0 +1,129 @@ +MathJax.Localization.addTranslation("en","MathMenu",{ + isLoaded: true, + strings: { + + Show: "Show Math As", + MathMLcode: "MathML Code", + OriginalMathML: "Original MathML", + TeXCommands: "TeX Commands", + AsciiMathInput: "AsciiMathML input", + Original: "Original Form", + ErrorMessage: "Error Message", + texHints: "Show TeX hints in MathML", + Settings: "Math Settings", + ZoomTrigger: "Zoom Trigger", + Hover: "Hover", + Click: "Click", + DoubleClick: "Double-Click", + NoZoom: "No Zoom", + TriggerRequires: "Trigger Requires:", + Option: "Option", + Alt: "Alt", + Command: "Command", + Control: "Control", + Shift: "Shift", + ZoomFactor: "Zoom Factor", + Renderer: "Math Renderer", + MPHandles: "Let MathPlayer Handle:", + MenuEvents: "Menu Events", + MouseEvents: "Mouse Events", + MenuAndMouse: "Mouse and Menu Events", + FontPrefs: "Font Preferences", + ForHTMLCSS: "For HTML-CSS:", + Auto: "Auto", + TeXLocal: "TeX (local)", + TeXWeb: "TeX (web)", + TeXImage: "TeX (image)", + STIXLocal: "STIX (local)", + ContextMenu: "Contextual Menu", + Browser: "Browser", + Scale: "Scale All Math ...", + Discoverable: "Highlight on Hover", + Locale: "Language", + LoadLocale: "Load from URL ...", + About: "About MathJax", + Help: "MathJax Help", + + localTeXfonts: "using local TeX fonts", + webTeXfonts: "using web TeX font", + imagefonts: "using Image fonts", + localSTIXfonts: "using local STIX fonts", + webSVGfonts: "using web SVG fonts", + genericfonts: "using generic unicode fonts", + + wofforotffonts: "woff or otf fonts", + eotffonts: "eot fonts", + svgfonts: "svg fonts", + + WebkitNativeMMLWarning: + "Your browser doesn't seem to support MathML natively, " + + "so switching to MathML output may cause the mathematics " + + "on the page to become unreadable.", + + MSIENativeMMLWarning: + "Internet Explorer requires the MathPlayer plugin " + + "in order to process MathML output.", + + OperaNativeMMLWarning: + "Opera's support for MathML is limited, so switching to " + + "MathML output may cause some expressions to render poorly.", + + SafariNativeMMLWarning: + "Your browser's native MathML does not implement all the features " + + "used by MathJax, so some expressions may not render properly.", + + FirefoxNativeMMLWarning: + "Your browser's native MathML does not implement all the features " + + "used by MathJax, so some expressions may not render properly.", + + MSIESVGWarning: + "SVG is not implemented in Internet Explorer prior to " + + "IE9 or when it is emulating IE8 or below. " + + "Switching to SVG output will cause the mathemtics to " + + "not display properly.", + + LoadURL: + "Load translation data from this URL:", + + BadURL: + "The URL should be for a javascript file that defines MathJax translation data. " + + "Javascript file names should end with '.js'", + + BadData: + "Failed to load translation data from %1", + + SwitchAnyway: + "Switch the renderer anyway?\n\n" + + "(Press OK to switch, CANCEL to continue with the current renderer)", + + ScaleMath: + "Scale all mathematics (compared to surrounding text) by", + + NonZeroScale: + "The scale should not be zero", + + PercentScale: + "The scale should be a percentage (e.g., 120%%)", + + IE8warning: + "This will disable the MathJax menu and zoom features, " + + "but you can Alt-Click on an expression to obtain the MathJax " + + "menu instead.\n\nReally change the MathPlayer settings?", + + IE9warning: + "The MathJax contextual menu will be disabled, but you can " + + "Alt-Click on an expression to obtain the MathJax menu instead.", + + NoOriginalForm: + "No original form available", + + Close: + "Close", + + EqSource: + "MathJax Equation Source" + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/en/MathMenu.js"); diff --git a/unpacked/localization/en/TeX.js b/unpacked/localization/en/TeX.js new file mode 100644 index 000000000..785fadcc8 --- /dev/null +++ b/unpacked/localization/en/TeX.js @@ -0,0 +1,248 @@ +MathJax.Localization.addTranslation("en","TeX",{ + isLoaded: true, + strings: { + + ExtraOpenMissingClose: + "Extra open brace or missing close brace", + + ExtraCloseMissingOpen: + "Extra close brace or missing open brace", + + MissingLeftExtraRight: + "Missing \\left or extra \\right", + + MissingScript: + "Missing superscript or subscript argument", + + ExtraLeftMissingRight: + "Extra \\left or missing \\right", + + Misplaced: + "Misplaced %1", + + MissingOpenForScript: + "Missing open brace for %1", + + AmbiguousUseOf: + "Ambiguous use of %1", + + EnvBadEnd: + "\\begin{%1} ended with \\end{%2}", + + EnvMissingEnd: + "Missing \\end{%1}", + + MissingBoxFor: + "Missing box for %1", + + MissingCloseBrace: + "Missing close brace", + + UndefinedControlSequence: + "Undefined control sequence %1", + + DoubleExponent: + "Double exponent: use braces to clarify", + + DoubleSubscripts: + "Double subscripts: use braces to clarify", + + DoubleExponentPrime: + "Prime causes double exponent: use braces to clarify", + + CantUseHash1: + "You can't use 'macro parameter character #' in math mode", + + MisplacedMiddle: + "%1 must be within \\left and \\right", + + MisplacedLimits: + "%1 is allowed only on operators", + + MisplacedMoveRoot: + "%1 can appear only within a root", + + MultipleCommand: + "Multiple %1", + + IntegerArg: + "The argument to %1 must be an integer", + + NotMathMLToken: + "%1 is not a token element", + + InvalidMathMLAttr: + "Invalid MathML attribute: %1", + + UnknownAttrForElement: + "%1 is not a recognized attribute for %2", + + MaxMacroSub1: + "MathJax maximum macro substitution count exceeded; " + + "is there a recursive macro call?", + + MaxMacroSub2: + "MathJax maximum substitution count exceeded; " + + "is there a recursive latex environment?", + + MissingArgFor: + "Missing argument for %1", + + ExtraAlignTab: + "Extra alignment tab in \\cases text", + + BracketMustBeDimension: + "Bracket argument to %1 must be a dimension", + + InvalidEnv: + "Invalid environment name '%1'", + + UnknownEnv: + "Unknown environment '%1'", + + ExtraClose: + "Extra close brace", + + ExtraCloseLooking: + "Extra close brace while looking for %1", + + MissingCloseBracket: + "Couldn't find closing ']' for argument to %1", + + MissingOrUnrecognizedDelim: + "Missing or unrecognized delimiter for %1", + + MissingDimOrUnits: + "Missing dimension or its units for %1", + + TokenNotFoundForCommand: + "Couldn't find %1 for %2", + + MathNotTerminated: + "Math not terminated in text box", + + IllegalMacroParam: + "Illegal macro parameter reference", + + MaxBufferSize: + "MathJax internal buffer size exceeded; is there a recursive macro call?", + + /* AMSmath */ + + CommandNotAllowedInEnv: + "%1 not allowed in %2 environment", + + MultipleLabel: + "Label '%1' mutiply defined", + + CommandAtTheBeginingOfLine: + "%1 must come at the beginning of the line", + + IllegalAlign: + "Illegal alignment specified in %1", + + BadMathStyleFor: + "Bad math style for %1", + + PositiveIntegerArg: + "Argument to %1 must me a positive integer", + + ErroneousNestingEq: + "Erroneous nesting of equation structures", + + MultlineRowsOneCol: + "multline rows must have exactly one column", + +/* bbox */ + + MultipleBBoxProperty: + "%1 specified twice in %2", + + InvalidBBoxProperty: + "'%1' doesn't look like a color, a padding dimension, or a style", + +/* begingroup */ + + ExtraEndMissingBegin: + "Extra %1 or missing \\begingroup", + + GlobalNotFollowedBy: + "%1 not followed by \\let, \\def, or \\newcommand", + +/* color */ + + UndefinedColorModel: + "Color model '%1' not defined", + + rgbArg1: + "rgb colors require 3 decimal numbers", + + InvalidDecimalNumber: + "Invalid decimal number", + + rgbArg2: + "rgb values must be between 0 and 1", + + RGBArg1: + "RGB colors require 3 numbers", + + InvalidNumber: + "Invalid number", + + RGBArg2: + "RGB values must be between 0 and 255", + + GrayScalerArg: + "Grey-scale values must be between 0 and 1", + +/* extpfeil */ + + NewextarrowArg1: + "First argument to %1 must be a control sequence name", + + NewextarrowArg2: + "Second argument to %1 must be two integers separated by a comma", + + NewextarrowArg3: + "Third argument to %1 must be a unicode character number", + +/* mhchem */ + + NoClosingChar: + "Can't find closing %1", + +/* newcommand */ + + IllegalControlSequenceName: + "Illegal control sequence name for %1", + + IllegalParamNumber: + "Illegal number of parameters specified in %1", + + DoubleBackSlash: + "\\ must be followed by a control sequence", + + CantUseHash2: + "Illegal use of # in template for %1", + + SequentialParam: + "Parameters for %1 must be numbered sequentially", + + MissingReplacementString: + "Missing replacement string for definition of %1", + + MismatchUseDef: + "Use of %1 doesn't match its definition", + + RunawayArgument: + "Argument manquant pour la commande %1?" + +/* verb */ + + NoClosingDelim: + "Can't find closing delimiter for %1", + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/en/TeX.js"); diff --git a/unpacked/localization/en/en.js b/unpacked/localization/en/en.js new file mode 100644 index 000000000..4bc1e9cdd --- /dev/null +++ b/unpacked/localization/en/en.js @@ -0,0 +1,58 @@ +MathJax.Localization.addTranslation("en",null,{ + menuTitle: "English", + isLoaded: true, + domains: { + "_": { + isLoaded: true, + strings: { + + CookieConfig: + "MathJax has found a user-configuration cookie that includes code to "+ + "be run. Do you want to run it?\n\n"+ + "(You should press Cancel unless you set up the cookie yourself.)", + + MathProcessingError: + "Math Processing Error", + + MathError: + "Math Error", + + LoadFile: "Loading %1", + + Loading: "Loading", + + LoadFailed: "File failed to load: %1", + + ProcessMath: "Processing Math: %1%%", + + Processing: "Processing", + + TypesetMath: "Typesetting Math: %1%%", + + Typesetting: "Typesetting", + + MathJaxNotSupported: + "Your browser does not support MathJax" + + } + }, + MathMenu: {}, + FontWarnings: {}, + "v1.0-warning": {}, + TeX: {}, + MathML: {}, + "HTML-CSS": {} + }, + + plural: function(n) { + if (n === 1) {return 1} // one + return 2; // other + }, + + number: function(n) { + return String(n).replace(".", ","); // replace dot by comma + } + +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/en/en.js"); diff --git a/unpacked/localization/en/v1.0-warning.js b/unpacked/localization/en/v1.0-warning.js new file mode 100644 index 000000000..e4bbed506 --- /dev/null +++ b/unpacked/localization/en/v1.0-warning.js @@ -0,0 +1,14 @@ +MathJax.Localization.addTranslation("en","v1.0-warning",{ + isLoaded: true, + strings: { + + MissingConfig: + "MathJax no longer loads a default configuration file; " + + "you must specify such files explicitly. " + + "This page seems to use the older default %1 " + + "file, and so needs to be updated. This is explained further at %2" + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/en/v1.0-warning.js"); From e6d8089a8bda5aa6400187304c76ad445c3a9773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Wed, 10 Apr 2013 11:32:01 +0200 Subject: [PATCH 20/41] Translate the strings added by Davide ; Reword some TeX translations. --- unpacked/localization/fr/MathMenu.js | 8 ++++---- unpacked/localization/fr/TeX.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/unpacked/localization/fr/MathMenu.js b/unpacked/localization/fr/MathMenu.js index f4cf4d3b8..78ce0e892 100644 --- a/unpacked/localization/fr/MathMenu.js +++ b/unpacked/localization/fr/MathMenu.js @@ -79,14 +79,14 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ "expressions pourront donc ne pas s'afficher correctement.", LoadURL: - "Load translation data from this URL:", + "Charger les données de traduction à partir de cette addresse URL:", BadURL: - "The URL should be for a javascript file that defines MathJax translation data. " + - "Javascript file names should end with '.js'", + "L'adresse URL doit être un fichier Javascript contenant des données de traduction MathJax." + + "Les noms de fichier Javascript doivent se terminer par '.js'", BadData: - "Failed to load translation data from %1", + "Échec du chargement des données de traduction à partir de %1", SwitchAnyway: "Êtes vous certain de vouloir changer le mode de rendu ?\n\n" + diff --git a/unpacked/localization/fr/TeX.js b/unpacked/localization/fr/TeX.js index a7358e1e6..03ebb656b 100644 --- a/unpacked/localization/fr/TeX.js +++ b/unpacked/localization/fr/TeX.js @@ -106,7 +106,7 @@ MathJax.Localization.addTranslation("fr","TeX",{ "Argument manquant pour la commande %1", ExtraAlignTab: - "Tabulation d'alignement non attendue pour le texte de la commande \\cases", + "Caractère d'alignement '&' non attendue pour le texte de la commande \\cases", BracketMustBeDimension: "L'argument entre crochets de la commande %1 doit être une dimension", @@ -121,7 +121,7 @@ MathJax.Localization.addTranslation("fr","TeX",{ "Accolade fermante non attendue", ExtraCloseLooking: - "Extra close brace while looking for %1" + "Accolade fermante non attendue lors de la recherche de %1", MissingCloseBracket: "Impossible de trouver le crochet fermant pour l'argument de la commande %1", @@ -169,7 +169,7 @@ MathJax.Localization.addTranslation("fr","TeX",{ "Emboitement incorrect des structures d'équation", MultlineRowsOneCol: - "Les lignes multiples doivent avoir exactement une colonne", + "L'environnement multline doit avoir exactement une colonne", NoClosingDelim: "Impossible de trouver le délimiteur fermant pour la commande %1", From 173c501eaee7d989168808662288349c7382f3a5 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 10 Apr 2013 10:16:14 -0400 Subject: [PATCH 21/41] Fixed localization issues pointed out by fred (this creates some new messages that need to be translated). --- unpacked/extensions/TeX/AMSmath.js | 5 +++-- unpacked/extensions/TeX/color.js | 25 +++++++++++++++-------- unpacked/jax/input/TeX/jax.js | 7 ++++--- unpacked/localization/en/TeX.js | 32 ++++++++++++------------------ unpacked/localization/fr/TeX.js | 24 +++++++++------------- 5 files changed, 46 insertions(+), 47 deletions(-) diff --git a/unpacked/extensions/TeX/AMSmath.js b/unpacked/extensions/TeX/AMSmath.js index 819716d50..ae737657b 100644 --- a/unpacked/extensions/TeX/AMSmath.js +++ b/unpacked/extensions/TeX/AMSmath.js @@ -186,7 +186,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { if (global.label) {TEX.Error(["MultipleCommand","Multiple %1",name])} global.label = label; if (AMS.labels[label] || AMS.eqlabels[label]) - {TEX.Error(["MultipleLabel","Label '%1' mutiply defined",label])} + {TEX.Error(["MultipleLabel","Label '%1' multiply defined",label])} AMS.eqlabels[label] = "???"; // will be replaced by tag value later } }, @@ -461,7 +461,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { EndRow: function () { if (this.row.length != 1) { TEX.Error(["MultlineRowsOneCol", - "multline rows must have exactly one column"]); + "The rows within the %1 environment must have exactly one column", + "multline"]); } this.table.push(this.row); this.row = []; }, diff --git a/unpacked/extensions/TeX/color.js b/unpacked/extensions/TeX/color.js index 7b5bab00c..bab21f2b2 100644 --- a/unpacked/extensions/TeX/color.js +++ b/unpacked/extensions/TeX/color.js @@ -125,13 +125,16 @@ MathJax.Extension["TeX/color"] = { get_rgb: function (rgb) { rgb = rgb.split(/,/); var RGB = "#"; if (rgb.length !== 3) - {this.TEX.Error(["rgbArg1","rgb colors require 3 decimal numbers"])} + {this.TEX.Error(["ModelArg1","Color values for the %1 model require 3 numbers","rgb"])} for (var i = 0; i < 3; i++) { if (!rgb[i].match(/^(\d+(\.\d*)?|\.\d+)$/)) {this.TEX.Error(["InvalidDecimalNumber","Invalid decimal number"])} var n = parseFloat(rgb[i]); - if (n < 0 || n > 1) - {this.TEX.Error(["rgbArg2","rgb values must be between 0 and 1"])} + if (n < 0 || n > 1) { + this.TEX.Error(["ModelArg2", + "Color values for the %1 model must be between %2 and %3", + "rgb",0,1]); + } n = Math.floor(n*255).toString(16); if (n.length < 2) {n = "0"+n} RGB += n; } @@ -144,13 +147,16 @@ MathJax.Extension["TeX/color"] = { get_RGB: function (rgb) { rgb = rgb.split(/,/); var RGB = "#"; if (rgb.length !== 3) - {this.TEX.Error(["RGBArg1","RGB colors require 3 numbers"])} + {this.TEX.Error(["ModelArg1","Color values for the %1 model require 3 numbers","RGB"])} for (var i = 0; i < 3; i++) { if (!rgb[i].match(/^\d+$/)) {this.TEX.Error(["InvalidNumber","Invalid number"])} var n = parseInt(rgb[i]); - if (n > 255) - {this.TEX.Error(["RGBArg2","RGB values must be between 0 and 255"])} + if (n > 255) { + this.TEX.Error(["ModelArg2", + "Color values for the %1 model must be between %2 and %3", + "RGB",0,255]); + } n = n.toString(16); if (n.length < 2) {n = "0"+n} RGB += n; } @@ -164,8 +170,11 @@ MathJax.Extension["TeX/color"] = { if (!gray.match(/^(\d+(\.\d*)?|\.\d+)$/)) {this.TEX.Error(["InvalidDecimalNumber","Invalid decimal number"])} var n = parseFloat(gray); - if (n < 0 || n > 1) - {this.TEX.Error(["GrayScalerArg","Grey-scale values must be between 0 and 1"])} + if (n < 0 || n > 1) { + this.TEX.Error(["ModelArg2", + "Color values for the %1 model must be between %2 and %3", + "gray",0,1]); + } n = Math.floor(n*255).toString(16); if (n.length < 2) {n = "0"+n} return "#"+n+n+n; }, diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index b942c5336..af8aa55f5 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -156,8 +156,9 @@ STACKITEM.subsup = STACKITEM.Subclass({ type: "subsup", stopError: /*_()*/ ["MissingScript","Missing superscript or subscript argument"], + supError: /*_()*/ ["MissingOpenForSup","Missing open brace for superscript"], + subError: /*_()*/ ["MissingOpenForSup","Missing open brace for subscript"], checkItem: function (item) { - var script = ["","subscript","superscript"][this.position]; if (item.type === "open" || item.type === "left") {return true} if (item.type === "mml") { if (this.primes) { @@ -168,7 +169,7 @@ return STACKITEM.mml(this.data[0]); } if (this.SUPER(arguments).checkItem.call(this,item)) - {TEX.Error(["MissingOpenForScript","Missing open brace for %1",script])} + {TEX.Error(this[["","subError","supError"][this.position]])} }, Pop: function () {} }); @@ -240,7 +241,7 @@ STACKITEM.position = STACKITEM.Subclass({ type: "position", checkItem: function (item) { - if (item.isClose) {TEX.Error(["MissingBoxFor","Missing box for %1"])} + if (item.isClose) {TEX.Error(["MissingBoxFor","Missing box for %1",name])} if (item.isNotStack) { var mml = item.mmlData(); switch (this.move) { diff --git a/unpacked/localization/en/TeX.js b/unpacked/localization/en/TeX.js index 785fadcc8..1aaf53b77 100644 --- a/unpacked/localization/en/TeX.js +++ b/unpacked/localization/en/TeX.js @@ -20,8 +20,11 @@ MathJax.Localization.addTranslation("en","TeX",{ Misplaced: "Misplaced %1", - MissingOpenForScript: - "Missing open brace for %1", + MissingOpenForSub: + "Missing open brace for subscript", + + MissingOpenForSup: + "Missing open brace for superscript", AmbiguousUseOf: "Ambiguous use of %1", @@ -133,7 +136,7 @@ MathJax.Localization.addTranslation("en","TeX",{ "%1 not allowed in %2 environment", MultipleLabel: - "Label '%1' mutiply defined", + "Label '%1' multiply defined", CommandAtTheBeginingOfLine: "%1 must come at the beginning of the line", @@ -151,7 +154,7 @@ MathJax.Localization.addTranslation("en","TeX",{ "Erroneous nesting of equation structures", MultlineRowsOneCol: - "multline rows must have exactly one column", + "The rows within the %1 environment must have exactly one column", /* bbox */ @@ -171,30 +174,21 @@ MathJax.Localization.addTranslation("en","TeX",{ /* color */ - UndefinedColorModel: + UndefinedColorModel: "Color model '%1' not defined", - rgbArg1: - "rgb colors require 3 decimal numbers", + ModelArg1: + "Color values for the %1 model require 3 numbers", InvalidDecimalNumber: "Invalid decimal number", - rgbArg2: - "rgb values must be between 0 and 1", - - RGBArg1: - "RGB colors require 3 numbers", + ModelArg2: + "Color values for the %1 model must be between %2 and %3", InvalidNumber: "Invalid number", - RGBArg2: - "RGB values must be between 0 and 255", - - GrayScalerArg: - "Grey-scale values must be between 0 and 1", - /* extpfeil */ NewextarrowArg1: @@ -235,7 +229,7 @@ MathJax.Localization.addTranslation("en","TeX",{ "Use of %1 doesn't match its definition", RunawayArgument: - "Argument manquant pour la commande %1?" + "Runaway argument for %1?" /* verb */ diff --git a/unpacked/localization/fr/TeX.js b/unpacked/localization/fr/TeX.js index 03ebb656b..fbfacab7a 100644 --- a/unpacked/localization/fr/TeX.js +++ b/unpacked/localization/fr/TeX.js @@ -20,8 +20,11 @@ MathJax.Localization.addTranslation("fr","TeX",{ Misplaced: "Mauvaise position pour la commande %1", - MissingOpenForScript: - "Accolade ouvrante manquante pour le script %1", + MissingOpenForSub: + "Missing open brace for subscript", // *NEW* + + MissingOpenForSup: + "Missing open brace for superscript", // *NEW* AmbiguousUseOf: "Usage ambigu de la commande %1", @@ -205,27 +208,18 @@ MathJax.Localization.addTranslation("fr","TeX",{ UndefinedColorModel: "Le modèle de couleur '%1' n'est pas défini", - rgbArg1: - "Les couleurs rgb nécéssitent 3 nombres décimaux", + ModelArg1: + "Color values for the %1 model require 3 numbers", // *NEW* 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", + ModelArg2: + "Color values for the %1 model must be between %2 and %3", // *NEW* 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", From 00e7d2a7255fd59578ccc8663530be10e2cd13cb Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 10 Apr 2013 10:41:29 -0400 Subject: [PATCH 22/41] Add preliminary German translation (still a few things to go). --- unpacked/localization/de/FontWarnings.js | 65 +++++ unpacked/localization/de/HTML-CSS.js | 28 ++ unpacked/localization/de/MathML.js | 60 +++++ unpacked/localization/de/MathMenu.js | 160 ++++++++++++ unpacked/localization/de/TeX.js | 312 +++++++++++++++++++++++ unpacked/localization/de/de.js | 79 ++++++ unpacked/localization/de/v1.0-warning.js | 18 ++ 7 files changed, 722 insertions(+) create mode 100644 unpacked/localization/de/FontWarnings.js create mode 100644 unpacked/localization/de/HTML-CSS.js create mode 100644 unpacked/localization/de/MathML.js create mode 100644 unpacked/localization/de/MathMenu.js create mode 100644 unpacked/localization/de/TeX.js create mode 100644 unpacked/localization/de/de.js create mode 100644 unpacked/localization/de/v1.0-warning.js diff --git a/unpacked/localization/de/FontWarnings.js b/unpacked/localization/de/FontWarnings.js new file mode 100644 index 000000000..c5c5dae55 --- /dev/null +++ b/unpacked/localization/de/FontWarnings.js @@ -0,0 +1,65 @@ +MathJax.Localization.addTranslation("de","FontWarnings",{ + isLoaded: true, + strings: { + + webFont: + "MathJax nutz web-basierte Fonts zur Darstellung der Mathematik " + + "auf dieser Seite. Da diese muessen heruntergeladen werden " + + "laedt die Seite schneller, wenn Mathe-Fonts auf dem System installiert sind." +// "MathJax is using web-based fonts to display the mathematics "+ +// "on this page. These take time to download, so the page would "+ +// "render faster if you installed math fonts directly in your "+ +// "system's font folder.", + + imageFonts: + "MathJax nutzt Bild-Fonts stall lokaler Fonts oder Webfonts. " + + "Das Laden dauert laenger als ueblich und Drucken wird " + + "evtl. nicht auf hoechster Qualitaet moeglich sein." +// "MathJax is using its image fonts rather than local or web-based fonts. "+ +// "This will render slower than usual, and the mathematics may not print "+ +// "at the full resolution of your printer.", + + noFonts: + "MathJax kann keinen Font zur Darstellung der Mathematik finden "+ + "und Bild-Fonts sind nicht verfuegbar. MathJax weicht auf generische "+ + "Unicode-Zeichen aus in der Hoffnung, Ihr Browser kann diese darstellen. "+ + "Einige oder alle Zeichen koennten nicht korrekt dargestellt werden." +// "MathJax is unable to locate a font to use to display "+ +// "its mathematics, and image fonts are not available, so it "+ +// "is falling back on generic unicode characters in hopes that "+ +// "your browser will be able to display them. Some characters "+ +// "may not show up properly, or possibly not at all.", + + webFonts: + "Die meisten modernen Browser koennen fonts aus dem Web laden. "+ + "Um die Qualitaet der Mathematik auf dieser Seite zu verbessern, "+ + "sollten Sie ein Update auf eine aktuelle Version des Browsers vornehmen "+ + "(oder einen aktuellen Browser installieren)." +// "Most modern browsers allow for fonts to be downloaded over the web. "+ +// "Updating to a more recent version of your browser (or changing "+ +// "browsers) could improve the quality of the mathematics on this page.", + + fonts: + "MathJax kann %1 oder %2 verwenden. "+ + "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern." //TODO ???? +// "MathJax can use either the %1 or the %2. " + +// "Download and install one of those fonts to improve your MathJax experience.", + + PageDesigned: + "Diese Seite ist optimiert fuer %1. " + + "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern." //TODO ???? +// "This page is designed to use the %1. " + +// "Download and install those fonts to improve your MathJax experience.", + + STIXfonts: + "STIX Fonts", +// "STIX fonts", + + TeXfonts: + "MathJax TeX Fonts" +// "MathJax TeX fonts" + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/de/FontWarnings.js"); diff --git a/unpacked/localization/de/HTML-CSS.js b/unpacked/localization/de/HTML-CSS.js new file mode 100644 index 000000000..348874528 --- /dev/null +++ b/unpacked/localization/de/HTML-CSS.js @@ -0,0 +1,28 @@ +MathJax.Localization.addTranslation("de","HTML-CSS",{ + isLoaded: true, + strings: { + + LoadWebFont: + "Lade Webfont %1", +// "Loading web-font %1", + + CantLoadWebFont: + "Kann Webfont %1 nicht laden", +// "Can't load web font %1", + + FirefoxCantLoadWebFont: + "Firefox kann Webfonts nicht von entferntem Computer laden", +// "Firefox can't load web fonts from a remote host", + + CantFindFontUsing: + "Kein gueltiger font fuer %1 verfuegbar", +// "Can't find a valid font using %1", + + WebFontsNotAvailable: + "Webfonts nicht verfuegbar -- benutze Bilderfont" +// "Web-Fonts not available -- using image fonts instead" + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/de/HTML-CSS.js"); diff --git a/unpacked/localization/de/MathML.js b/unpacked/localization/de/MathML.js new file mode 100644 index 000000000..0f2fbcee3 --- /dev/null +++ b/unpacked/localization/de/MathML.js @@ -0,0 +1,60 @@ +MathJax.Localization.addTranslation("de","MathML",{ + isLoaded: true, + strings: { + + BadMglyph: + "Schlechter mglpyh: %1", +// "Bad mglyph: %1", + + BadMglyphFont: + "Schlechter Font: %1", +// "Bad font: %1", + + MathPlayer: //TODO CHECK WINDOWS IN GERMAN :( + "MathJax konnnte MathPlayer nicht einrichten.\n\n"+ + "Falls MathPlayer nicht installiert ist, muss es erst installiert werden.\n"+ + "Eventuell blockieren die Sicherheitsoptionen ActiveX; ueberpruefen Sie\n"+ + "unter 'Interneteinstellungen' -> 'Werkzeuge' -> 'Sicherheit' -> 'Anpassen' ob\n"+ + "ob 'ActiveX aktivieren' und 'Binaer und Skriptverhalten' aktiviert sind.\n\n"+ + "Bei der jetzigen Konfiguration wird MathJax nur Fehlermeldungen anzeigen.\n"+ +// "MathJax was not able to set up MathPlayer.\n\n"+ +// "If MathPlayer is not installed, you need to install it first.\n"+ +// "Otherwise, your security settings may be preventing ActiveX \n"+ +// "controls from running. Use the Internet Options item under\n"+ +// "the Tools menu and select the Security tab, then press the\n"+ +// "Custom Level button. Check that the settings for\n"+ +// "'Run ActiveX Controls', and 'Binary and script behaviors'\n"+ +// "are enabled.\n\n"+ +// "Currently you will see error messages rather than\n"+ +// "typeset mathematics.", + + CantCreateXMLParser: + "MathJax can't create an XML parser for MathML. Check that\n"+ + "the 'Script ActiveX controls marked safe for scripting' security\n"+ + "setting is enabled (use the Internet Options item in the Tools\n"+ + "menu, and select the Security panel, then press the Custom Level\n"+ + "button to check this).\n\n"+ + "MathML equations will not be able to be processed by MathJax.", + + UnknownNodeType: + "Unknown node type: %1", + + UnexpectedTextNode: + "Unexpected text node: %1", + + ErrorParsingMathML: + "Error parsing MathML", + + ParsingError: + "Error parsing MathML: %1", + + MathMLSingleElement: + "MathML must be formed by a single element", + + MathMLRootElement: + "MathML must be formed by a element, not %1" + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/de/MathML.js"); diff --git a/unpacked/localization/de/MathMenu.js b/unpacked/localization/de/MathMenu.js new file mode 100644 index 000000000..65988a5cc --- /dev/null +++ b/unpacked/localization/de/MathMenu.js @@ -0,0 +1,160 @@ +MathJax.Localization.addTranslation("de","MathMenu",{ + isLoaded: true, + strings: { + + Show: "Zeige Mathe als", // "Show Math As", TODO THAT's WEIRD + MathMLcode: "MathML Code", + OriginalMathML: "Original MathML", + TeXCommands: "Original TeX", // "TeX Commands", TODO ENGLISH? + AsciiMathInput: "Original AsciiMathML", // "AsciiMathML input", TODO ENGLISH? + Original: "Originalform", // "Original Form", + ErrorMessage: "Fehlermeldung", // "Error Message", + texHints: "Bette TeX Tipps in MathML ein", // "Show TeX hints in MathML", + Settings: "Einstellungen", // "Math Settings", + ZoomTrigger: "Zoom ausloesen", // "Zoom Trigger", + Hover: "Hover", + Click: "Klick", // "Click", + DoubleClick: "Doppelklick", // "Double-Click", + NoZoom: "Kein Zoom", // "No Zoom", + TriggerRequires: "Ausloeser benoetigt:", // "Trigger Requires:", + Option: "Option", + Alt: "Alt", + Command: "Command", + Control: "Steuerung", // "Control", + Shift: "Shift", + ZoomFactor: "Zoomfaktor", // "Zoom Factor", + Renderer: "Mathe Renderer", // "Math Renderer", + MPHandles: "An MathPlayer uebergeben:", // "Let MathPlayer Handle:", + MenuEvents: "Menue Events", // "Menu Events", + MouseEvents: "Maus Events", // "Mouse Events", + MenuAndMouse: "Maus und Menue Events", // "Mouse and Menu Events", + FontPrefs: "Font Einstellungen", // "Font Preferences", + ForHTMLCSS: "Fuer HTML-CSS", // "For HTML-CSS:", + Auto: "Auto", + TeXLocal: "TeX (lokal)", // "TeX (local)", + TeXWeb: "TeX (Web)", // "TeX (web)", + TeXImage: "TeX (Bild)", // "TeX (image)", + STIXLocal: "STIX (lokal)", // "STIX (local)", + ContextMenu: "Kontextmenue", // "Contextual Menu", + Browser: "Browser", + Scale: "Alle Mathe skalieren", // "Scale All Math ...", + Discoverable: "Highlight durch Hovern", // "Highlight on Hover", + Locale: "Sprache", // "Language", + LoadLocale: "Von URL laden", // "Load from URL ...", + About: "Ueber MathJax", // "About MathJax", + Help: "MathJax Hilfe", // "MathJax Help", + + localTeXfonts: "Lokale TeX-Fonts werden verwendet", // "using local TeX fonts", + webTeXfonts: "Web TeX-Fonts werden verwendet", // "using web TeX font", + imagefonts: "Bild-Fonts werden verwendet", // "using Image fonts", + localSTIXfonts: "Lokale STIX-Fonts werden verwendet", // "using local STIX fonts", + webSVGfonts: "Web SVG-fonts werden verwendet", // "using web SVG fonts", + genericfonts: "Generische Unicode-Fonts werden verwendet", // "using generic unicode fonts", + + wofforotffonts: "WOFF- oder OTF-Fonts", // "woff or otf fonts", + eotffonts: "EOT-Fonts", // "eot fonts", + svgfonts: "SVG-Fonts", // "svg fonts", + + WebkitNativeMMLWarning: + "Ihr Browser scheint MathML nicht zu unterstuetzen, " + + "so dass ein Wechsel zur MathML-Ausgabe die Mathematik " + + "auf der Seite unlesbar machen koennte." +// "Your browser doesn't seem to support MathML natively, " + +// "so switching to MathML output may cause the mathematics " + +// "on the page to become unreadable.", + + MSIENativeMMLWarning: + "Internet Explorer benoetigt das MathPlayer Plugin " + + "um MathML-Ausgabe verarbeiten zu koennen." +// "Internet Explorer requires the MathPlayer plugin " + +// "in order to process MathML output.", + + OperaNativeMMLWarning: + "Opera's MathML unterstuetzung ist beschraenkt, so dass beim Wechsel " + + "zur MathML-Ausgabe einige Ausdruecke schlecht gerendert werden." +// "Opera's support for MathML is limited, so switching to " + +// "MathML output may cause some expressions to render poorly.", + + SafariNativeMMLWarning: + "Die MathML-Unterstuetzung Ihres Browsers beherrscht nicht alle " + + "MathJax-Features, so dass einige Ausdruecke schlecht gerendert werden." +// "Your browser's native MathML does not implement all the features " + +// "used by MathJax, so some expressions may not render properly.", + + FirefoxNativeMMLWarning: + "Die MathML-Unterstuetzung Ihres Browsers beherrscht nicht alle " + + "MathJax-Features, so dass einige Ausdruecke schlecht gerendert werden." +// "Your browser's native MathML does not implement all the features " + +// "used by MathJax, so some expressions may not render properly.", + + MSIESVGWarning: + "Internet Explorer unterstuetzt SVG erst ab IE9 und " + + "nicht im IE8-Emulationsmodus. Beim Wechsel zur " + + "SVG-Ausgabe wird die Mathematik nicht richtig dargestellt.", +// "SVG is not implemented in Internet Explorer prior to " + +// "IE9 or when it is emulating IE8 or below. " + +// "Switching to SVG output will cause the mathemtics to " + TODO TYPO IN ENGLISH +// "not display properly.", + + LoadURL: + "Sprachschema-Daten von URL laden:", +// "Load translation data from this URL:", + + BadURL: + "URL muss zu einer JavaScript-Datei fuer MathJax Sprachschema fuehren. " + + "JavaScript Dateinamen sollten auf '.js' enden.", +// "The URL should be for a javascript file that defines MathJax translation data. " + +// "Javascript file names should end with '.js'", + + BadData: + "Fehler beim Laden des Sprachschema von %1", +// "Failed to load translation data from %1", + + SwitchAnyway: + "Renderer trotzdem aendern?\n\n" + + "(Mit OK wechseln, mit ABBRECHEN den aktuellen Renderer verwenden)", +// "Switch the renderer anyway?\n\n" + +// "(Press OK to switch, CANCEL to continue with the current renderer)", + + ScaleMath: + "Alle Mathematik skalieren (relativ zum Umgebenden Text)", +// "Scale all mathematics (compared to surrounding text) by", + + NonZeroScale: + "Skalierung darf nicht Null sein", +// "The scale should not be zero", + + PercentScale: + "Skalierung muss in Prozent sein", +// "The scale should be a percentage (e.g., 120%%)", + + IE8warning: + "Dies Deaktiviert das MathJax Menue und den MathJax Zoom " + + "Alt+Klick auf eine Formel zeigt weiter das MathJax-Menue.\n\n" + + "Wirklich MathPlayer Einstellungen aendern?" +// "This will disable the MathJax menu and zoom features, " + +// "but you can Alt-Click on an expression to obtain the MathJax " + +// "menu instead.\n\nReally change the MathPlayer settings?", + + IE9warning: + "Das MathJax Menue wird deaktiviert und kann nur durch " + + "Alt+Klick auf eine Formel angezeigt werden." +// "The MathJax contextual menu will be disabled, but you can " + +// "Alt-Click on an expression to obtain the MathJax menu instead.", + + NoOriginalForm: + "Keine Originalform verfuegbar", +// "No original form available", TODO??? + + Close: + "Schliessen", +// "Close", + + EqSource: + "Original MathJax Formel" +// "MathJax Equation Source" + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/de/MathMenu.js"); diff --git a/unpacked/localization/de/TeX.js b/unpacked/localization/de/TeX.js new file mode 100644 index 000000000..ad9bd512d --- /dev/null +++ b/unpacked/localization/de/TeX.js @@ -0,0 +1,312 @@ +MathJax.Localization.addTranslation("de","TeX",{ + isLoaded: true, + strings: { + + ExtraOpenMissingClose: + "Zusaetzliche offene oder fehlende schliessende Klammer", +// "Extra open brace or missing close brace", + + ExtraCloseMissingOpen: + "Zusaetzliche schliessende oder fehlende offene Klammer", +// "Extra close brace or missing open brace", + + MissingLeftExtraRight: + "Fehlendes \\left oder zusaetzliches \\right", +// "Missing \\left or extra \\right", + + MissingScript: + "Fehlendes Argument im Sub- oder Superskript", +// "Missing superscript or subscript argument", + + ExtraLeftMissingRight: + "Zusaetzliches \\left oder fehlendes \\right", +// "Extra \\left or missing \\right", + + Misplaced: + "%1 falsch plaziert", +// "Misplaced %1", + + MissingOpenForSub: + "Missing open brace for subscript", // *NEW* + + MissingOpenForSup: + "Missing open brace for superscript", // *NEW* + + AmbiguousUseOf: + "Mehrdeutige Verwendung von %1", +// "Ambiguous use of %1", + + EnvBadEnd: + "\\begin{%1} endet mit \\end{%2}", +// "\\begin{%1} ended with \\end{%2}", + + EnvMissingEnd: + "\\end{%1} fehlt", +// "Missing \\end{%1}", + + MissingBoxFor: + "Fehlende Box: %1", +// "Missing box for %1",TODO ??? + + MissingCloseBrace: + "Fehlende geschlossene Klammer Missing close brace", +// "Missing close brace", + + UndefinedControlSequence: + "Nicht definierter Befehl: %1", +// "Undefined control sequence %1", + + DoubleExponent: + "Doppeltes Superskript: verwende Klammern zum Gruppieren", +// "Double exponent: use braces to clarify", + + DoubleSubscripts: + "Doppeltes Subskript: verwende Klammern zum Gruppieren", +// "Double subscripts: use braces to clarify", + + DoubleExponentPrime: + "Prime fuehrt zu doppeltem Superskript: verwende Klammern zum Gruppieren ", +// "Prime causes double exponent: use braces to clarify", + + CantUseHash1: + "'macro parameter character #' kann nicht im Mathematikmodus verwendet werden", +// "You can't use 'macro parameter character #' in math mode", TODO ??? + + MisplacedMiddle: + "%1 muss zwischen \\left und \\right stehen", +// "%1 must be within \\left and \\right", + + MisplacedLimits: + "%1 ist nur bei Operatoren erlaubt", +// "%1 is allowed only on operators", + + MisplacedMoveRoot: + "%1 muss innerhalb einer Wurzel stehen", +// "%1 can appear only within a root", + + MultipleCommand: + "Vielfache %1", +// "Multiple %1", TODO ??? + + IntegerArg: + "Das Argument in %1 muss ganzzahlig sein", +// "The argument to %1 must be an integer", + + NotMathMLToken: + "%1 ist kein Token-Element", +// "%1 is not a token element", + + InvalidMathMLAttr: + "Unzulaessiges MathML-Attribut: %1", +// "Invalid MathML attribute: %1", + + UnknownAttrForElement: + "%1 ist kein zulaessiged Attribut fuer %2", +// "%1 is not a recognized attribute for %2", + + MaxMacroSub1: + "Maximale Anzahl an Makros ist erreicht; " + + "wird ein rekursiver Aufruf verwendet?", +// "MathJax maximum macro substitution count exceeded; " + +// "is there a recursive macro call?", TODO ??? + + MaxMacroSub2: + "Maximale Anzahl an Substitutionen ist erreicht; " + + "wird eine rekursive LaTeX-Umgebung verwendet?", +// "MathJax maximum substitution count exceeded; " + +// "is there a recursive latex environment?", + + MissingArgFor: + "Fehlendes Argument in %1", +// "Missing argument for %1", TODO??? + + ExtraAlignTab: + "Zusaetzliches & im \\cases Text", +// "Extra alignment tab in \\cases text", TODO??? + + BracketMustBeDimension: + "Das geklammerte Argument fuer %1 muss eine Dimension sein", +// "Bracket argument to %1 must be a dimension", + + InvalidEnv: + "Ungueltiger Umgebungsname %1", +// "Invalid environment name '%1'", + + UnknownEnv: + "Ungueltige Umgebung %1", +// "Unknown environment '%1'", + + ExtraClose: + "Zusaetzliche geschlossene Klammer", +// "Extra close brace", + + ExtraCloseLooking: + "Zusaetzliche geschlossene Klammer waehrend der Suche nach %1", +// "Extra close brace while looking for %1", + + MissingCloseBracket: + "Argument zu %1 wurde nicht mit ']' geschlossen", +// "Couldn't find closing ']' for argument to %1", + + MissingOrUnrecognizedDelim: + "Fehlender oder nichterkannter Delimiter bei %1", +// "Missing or unrecognized delimiter for %1", + + MissingDimOrUnits: + "Fehlende Dimension oder Einheiten bei %1", +// "Missing dimension or its units for %1", + + TokenNotFoundForCommand: + "Konnte %1 nicht vor %2 finden", +// "Couldn't find %1 for %2", + + MathNotTerminated: + "Formel in Textbox nicht abgschlossen", +// "Math not terminated in text box", + + IllegalMacroParam: + "Ungueltiger Makroparameter", +// "Illegal macro parameter reference", + + MaxBufferSize: + "Interner Puffergroesse ueberschritten; wird ein rekursiver Makroaufruf verwendet?", +// "MathJax internal buffer size exceeded; is there a recursive macro call?", TODO??? + + /* AMSmath */ + + CommandNotAllowedInEnv: + "%1 ist nicht in Umgebung %2 erlaubt", +// "%1 not allowed in %2 environment", + + MultipleLabel: + "Label '%1' ueberdefiniert", +// "Label '%1' multiply defined", + + CommandAtTheBeginingOfLine: + "%1 muss am Zeilenanfang stehen", +// "%1 must come at the beginning of the line", + + IllegalAlign: + "Ungueltige Ausrichtung in %1", +// "Illegal alignment specified in %1", TODO ??? + + BadMathStyleFor: + "Schlechter math style: %1", +// "Bad math style for %1", TODO??? + + PositiveIntegerArg: + "Argument bei %1 muss positiv und ganzzahlig sein", +// "Argument to %1 must me a positive integer", + + ErroneousNestingEq: + "Fehlerhafte Verschachtelung von Gleichungen", +// "Erroneous nesting of equation structures", TODO??? + + MultlineRowsOneCol: + "Zeilen in multiline Umgebung muessen genau eine Spalte haben", +// "The rows within the %1 environment must have exactly one column" + +/* bbox */ + + MultipleBBoxProperty: + "%1 wurde zweimal in %2 angegeben", +// "%1 specified twice in %2", + + InvalidBBoxProperty: + "'%1' scheint keine Farbe, padding Dimension oder style zu sein", +// "'%1' doesn't look like a color, a padding dimension, or a style", TODO??? + +/* begingroup */ + + ExtraEndMissingBegin: + "Zusaetzliches oder Fehlendes \\begingroup", +// "Extra %1 or missing \\begingroup", + + GlobalNotFollowedBy: + "%1 nicht von \\let, \\def oder \\newcommand gefolgt", +// "%1 not followed by \\let, \\def, or \\newcommand", + +/* color */ + + UndefinedColorModel: + "Farbmuster '%1' nicht definiert", +// "Color model '%1' not defined", TODO??? + + ModelArg1: + "Color values for the %1 model require 3 numbers", // *NEW* + + InvalidDecimalNumber: + "Ungueltige Dezimalzahl", +// "Invalid decimal number", + + ModelArg2: + "Color values for the %1 model must be between %2 and %3", // *NEW* + + InvalidNumber: + "Ungueltige Zahl", +// "Invalid number", + +/* extpfeil */ + + NewextarrowArg1: + "Das erste Argument von %1 muss Name einer Befehlsfolge sein", +// "First argument to %1 must be a control sequence name", + + NewextarrowArg2: + "Zweites Argument von %1 muessen zwei ganze Zahlen, durch Komma getrennt, sein", +// "Second argument to %1 must be two integers separated by a comma", + + NewextarrowArg3: + "Drittes argument von %1 muessen Unicode-Nummern sein", +// "Third argument to %1 must be a unicode character number", + +/* mhchem */ + + NoClosingChar: + "Kann geschlossenes %1 nicht finden", +// "Can't find closing %1", + +/* newcommand */ + + IllegalControlSequenceName: + "Ungueltige Befehlsfolge", +// "Illegal control sequence name for %1", + + IllegalParamNumber: + "Ungueltige Anzahl von Parametern in %1", +// "Illegal number of parameters specified in %1", + + DoubleBackSlash: + "\\ muss von Befehlsfolge gefolgt werden", +// "\\ must be followed by a control sequence", + + CantUseHash2: + "Ungueltige Verwendung von # in Template von %1", +// "Illegal use of # in template for %1", TODO??>? + + SequentialParam: + "Parameter von %1 muessen durch nummeriert sein", +// "Parameters for %1 must be numbered sequentially", + + MissingReplacementString: + "Ersetzende Zeichenkette fuer Definition von %1 fehlt", +// "Missing replacement string for definition of %1", TODO??? + + MismatchUseDef: + "Verwendung von %1 passt nicht zur Definition", +// "Use of %1 doesn't match its definition", + + RunawayArgument: + "Fehlendes Argument fuer %1?", +// "Runaway argument for %1?" + +/* verb */ + + NoClosingDelim: + "Kein schliessender Delimiter fuer %1" +// "Can't find closing delimiter for %1" TODO??? + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/de/TeX.js"); \ No newline at end of file diff --git a/unpacked/localization/de/de.js b/unpacked/localization/de/de.js new file mode 100644 index 000000000..e3b706530 --- /dev/null +++ b/unpacked/localization/de/de.js @@ -0,0 +1,79 @@ +MathJax.Localization.addTranslation("de",null,{ + menuTitle: "Deutch", + isLoaded: true, + domains: { + "_": { + isLoaded: true, + strings: { + + CookieConfig: + "MathJax hat eine Cookie mit ausfuehrbaren Code gefunden. " + + "Soll dieser Code ausgefuehrt werden?\n\n" + + "(Klicken Sie 'Abbrechen' falls Sie nicht selber das Cookie akzeptiert haben.)", +// "MathJax has found a user-configuration cookie that includes code to " + +// "be run. Do you want to run it?\n\n" + +// "(You should press Cancel unless you set up the cookie yourself.)", + + MathProcessingError: + "Mathe Verarbeitungsfehler ", +// "Math Processing Error", + + MathError: + "Mathe Fehler", +// "Math Error", + + LoadFile: + "Lade %1", +// "Loading %1", + + Loading: + "Laden", +// "Loading", TODO??? + + LoadFailed: + "Datei konnte nicht geladen werden: %1", +// "File failed to load: %1", + + ProcessMath: + "Mathe Verarbeitung: %1%%", +// "Processing Math: %1%%", + + Processing: + "Verarbeiten", +// "Processing", TODO??? + + TypesetMath: + "Mathe Textsatz: %1%%", +// "Typesetting Math: %1%%", + + Typesetting: + "Setzen", +// "Typesetting", TODO??? + + MathJaxNotSupported: + "Ihr Webbrowser unterstuetzt MathJax nicht" +// "Your browser does not support MathJax" + + } + }, + + MathMenu: {}, + FontWarnings: {}, + "v1.0-warning": {}, + TeX: {}, + MathML: {}, + "HTML-CSS": {} + }, + + plural: function(n) { + if (n === 1) {return 1} // one + return 2; // other + }, + + number: function(n) { + return String(n).replace(".", ","); // replace dot by comma + } + +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/de/de.js"); diff --git a/unpacked/localization/de/v1.0-warning.js b/unpacked/localization/de/v1.0-warning.js new file mode 100644 index 000000000..cf2526de8 --- /dev/null +++ b/unpacked/localization/de/v1.0-warning.js @@ -0,0 +1,18 @@ +MathJax.Localization.addTranslation("de","v1.0-warning",{ + isLoaded: true, + strings: { + + MissingConfig: + "MathJax laedt keine Standardkonfiguration mehr; " + + "der Author der Seite muss eine Konfigurationsdatei angeben. " + //TODO CHANGE ENGLISH version, too? Simplify in general??? + "Diese Seite nutze die alte Standardkonfiguration %1 " + + "und benoetigt ein Update. Siehe auch: %2" +// "MathJax no longer loads a default configuration file; " + +// "you must specify such files explicitly. " + +// "This page seems to use the older default %1 " + +// "file, and so needs to be updated. This is explained further at %2" + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/de/v1.0-warning.js"); From f5cde28c7127900d99fb52bacd40ec23c044cbc1 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 10 Apr 2013 10:41:47 -0400 Subject: [PATCH 23/41] Fix indentation --- unpacked/localization/en/MathMenu.js | 64 ++++++++++++++-------------- unpacked/localization/fr/MathMenu.js | 64 ++++++++++++++-------------- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/unpacked/localization/en/MathMenu.js b/unpacked/localization/en/MathMenu.js index 0dffc6cfe..2ec01dfa8 100644 --- a/unpacked/localization/en/MathMenu.js +++ b/unpacked/localization/en/MathMenu.js @@ -11,38 +11,38 @@ MathJax.Localization.addTranslation("en","MathMenu",{ ErrorMessage: "Error Message", texHints: "Show TeX hints in MathML", Settings: "Math Settings", - ZoomTrigger: "Zoom Trigger", - Hover: "Hover", - Click: "Click", - DoubleClick: "Double-Click", - NoZoom: "No Zoom", - TriggerRequires: "Trigger Requires:", - Option: "Option", - Alt: "Alt", - Command: "Command", - Control: "Control", - Shift: "Shift", - ZoomFactor: "Zoom Factor", - Renderer: "Math Renderer", - MPHandles: "Let MathPlayer Handle:", - MenuEvents: "Menu Events", - MouseEvents: "Mouse Events", - MenuAndMouse: "Mouse and Menu Events", - FontPrefs: "Font Preferences", - ForHTMLCSS: "For HTML-CSS:", - Auto: "Auto", - TeXLocal: "TeX (local)", - TeXWeb: "TeX (web)", - TeXImage: "TeX (image)", - STIXLocal: "STIX (local)", - ContextMenu: "Contextual Menu", - Browser: "Browser", - Scale: "Scale All Math ...", - Discoverable: "Highlight on Hover", - Locale: "Language", - LoadLocale: "Load from URL ...", - About: "About MathJax", - Help: "MathJax Help", + ZoomTrigger: "Zoom Trigger", + Hover: "Hover", + Click: "Click", + DoubleClick: "Double-Click", + NoZoom: "No Zoom", + TriggerRequires: "Trigger Requires:", + Option: "Option", + Alt: "Alt", + Command: "Command", + Control: "Control", + Shift: "Shift", + ZoomFactor: "Zoom Factor", + Renderer: "Math Renderer", + MPHandles: "Let MathPlayer Handle:", + MenuEvents: "Menu Events", + MouseEvents: "Mouse Events", + MenuAndMouse: "Mouse and Menu Events", + FontPrefs: "Font Preferences", + ForHTMLCSS: "For HTML-CSS:", + Auto: "Auto", + TeXLocal: "TeX (local)", + TeXWeb: "TeX (web)", + TeXImage: "TeX (image)", + STIXLocal: "STIX (local)", + ContextMenu: "Contextual Menu", + Browser: "Browser", + Scale: "Scale All Math ...", + Discoverable: "Highlight on Hover", + Locale: "Language", + LoadLocale: "Load from URL ...", + About: "About MathJax", + Help: "MathJax Help", localTeXfonts: "using local TeX fonts", webTeXfonts: "using web TeX font", diff --git a/unpacked/localization/fr/MathMenu.js b/unpacked/localization/fr/MathMenu.js index 78ce0e892..3987359f2 100644 --- a/unpacked/localization/fr/MathMenu.js +++ b/unpacked/localization/fr/MathMenu.js @@ -11,38 +11,38 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ ErrorMessage: "de message d'erreur", texHints: "Inclure les données TeX dans le MathML", Settings: "Paramètres", - ZoomTrigger: "Déclenchement du zoom", - Hover: "Survol de la souris", - Click: "Clic de souris", - DoubleClick: "Double-clic", - NoZoom: "Pas de zoom", - TriggerRequires: "Le déclenchement nécessite la touche", - Option: "Option", - Alt: "Alt", - Command: "Command", - Control: "Control", - Shift: "Shift", - ZoomFactor: "Facteur de zoom", - Renderer: "Mode de rendu", - MPHandles: "Laissez MathPlayer gérer les", - MenuEvents: "Évènements du menu", - MouseEvents: "Évènements de la souris", - MenuAndMouse: "Évènements de menu et de la souris", - FontPrefs: "Préférences des polices", - ForHTMLCSS: "Pour le HTML-CSS:", - Auto: "Auto", - TeXLocal: "TeX (locales)", - TeXWeb: "TeX (web)", - TeXImage: "TeX (image)", - STIXLocal: "STIX (locales)", - ContextMenu: "Menu contextuel", - Browser: "Navigateur", - Scale: "Mise à l'échelle ...", - Discoverable: "Mettez en surbrillance lors du survol", - Locale: "Langue", - LoadLocale: "Charger à partir de l'URL...", - About: "À propos de MathJax", - Help: "Aide MathJax", + ZoomTrigger: "Déclenchement du zoom", + Hover: "Survol de la souris", + Click: "Clic de souris", + DoubleClick: "Double-clic", + NoZoom: "Pas de zoom", + TriggerRequires: "Le déclenchement nécessite la touche", + Option: "Option", + Alt: "Alt", + Command: "Command", + Control: "Control", + Shift: "Shift", + ZoomFactor: "Facteur de zoom", + Renderer: "Mode de rendu", + MPHandles: "Laissez MathPlayer gérer les", + MenuEvents: "Évènements du menu", + MouseEvents: "Évènements de la souris", + MenuAndMouse: "Évènements de menu et de la souris", + FontPrefs: "Préférences des polices", + ForHTMLCSS: "Pour le HTML-CSS:", + Auto: "Auto", + TeXLocal: "TeX (locales)", + TeXWeb: "TeX (web)", + TeXImage: "TeX (image)", + STIXLocal: "STIX (locales)", + ContextMenu: "Menu contextuel", + Browser: "Navigateur", + Scale: "Mise à l'échelle ...", + Discoverable: "Mettez en surbrillance lors du survol", + Locale: "Langue", + LoadLocale: "Charger à partir de l'URL...", + About: "À propos de MathJax", + Help: "Aide MathJax", localTeXfonts: "utilisant les polices TeX locales", webTeXfonts: "utilisant les polices TeX Web", From 35bb35bf443ead53cf8e33808ba45f92815086c4 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 10 Apr 2013 10:53:55 -0400 Subject: [PATCH 24/41] Add Germanto the language list, and fix some comma issues in the data files. --- unpacked/MathJax.js | 1 + unpacked/localization/de/FontWarnings.js | 12 ++++++------ unpacked/localization/de/MathML.js | 2 +- unpacked/localization/de/MathMenu.js | 18 +++++++++--------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 0daa0474e..0fdb47a14 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1059,6 +1059,7 @@ MathJax.Localization = { directory: "[MathJax]/localization", strings: { en: {isLoaded: true, menuTitle: "English"}, // nothing needs to be loaded for this + de: {menuTitle: "Deutch"}, fr: {menuTitle: "Fran\u00E7ais"} }, diff --git a/unpacked/localization/de/FontWarnings.js b/unpacked/localization/de/FontWarnings.js index c5c5dae55..567d91983 100644 --- a/unpacked/localization/de/FontWarnings.js +++ b/unpacked/localization/de/FontWarnings.js @@ -5,7 +5,7 @@ MathJax.Localization.addTranslation("de","FontWarnings",{ webFont: "MathJax nutz web-basierte Fonts zur Darstellung der Mathematik " + "auf dieser Seite. Da diese muessen heruntergeladen werden " + - "laedt die Seite schneller, wenn Mathe-Fonts auf dem System installiert sind." + "laedt die Seite schneller, wenn Mathe-Fonts auf dem System installiert sind.", // "MathJax is using web-based fonts to display the mathematics "+ // "on this page. These take time to download, so the page would "+ // "render faster if you installed math fonts directly in your "+ @@ -14,7 +14,7 @@ MathJax.Localization.addTranslation("de","FontWarnings",{ imageFonts: "MathJax nutzt Bild-Fonts stall lokaler Fonts oder Webfonts. " + "Das Laden dauert laenger als ueblich und Drucken wird " + - "evtl. nicht auf hoechster Qualitaet moeglich sein." + "evtl. nicht auf hoechster Qualitaet moeglich sein.", // "MathJax is using its image fonts rather than local or web-based fonts. "+ // "This will render slower than usual, and the mathematics may not print "+ // "at the full resolution of your printer.", @@ -23,7 +23,7 @@ MathJax.Localization.addTranslation("de","FontWarnings",{ "MathJax kann keinen Font zur Darstellung der Mathematik finden "+ "und Bild-Fonts sind nicht verfuegbar. MathJax weicht auf generische "+ "Unicode-Zeichen aus in der Hoffnung, Ihr Browser kann diese darstellen. "+ - "Einige oder alle Zeichen koennten nicht korrekt dargestellt werden." + "Einige oder alle Zeichen koennten nicht korrekt dargestellt werden.", // "MathJax is unable to locate a font to use to display "+ // "its mathematics, and image fonts are not available, so it "+ // "is falling back on generic unicode characters in hopes that "+ @@ -34,20 +34,20 @@ MathJax.Localization.addTranslation("de","FontWarnings",{ "Die meisten modernen Browser koennen fonts aus dem Web laden. "+ "Um die Qualitaet der Mathematik auf dieser Seite zu verbessern, "+ "sollten Sie ein Update auf eine aktuelle Version des Browsers vornehmen "+ - "(oder einen aktuellen Browser installieren)." + "(oder einen aktuellen Browser installieren).", // "Most modern browsers allow for fonts to be downloaded over the web. "+ // "Updating to a more recent version of your browser (or changing "+ // "browsers) could improve the quality of the mathematics on this page.", fonts: "MathJax kann %1 oder %2 verwenden. "+ - "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern." //TODO ???? + "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern.", //TODO ???? // "MathJax can use either the %1 or the %2. " + // "Download and install one of those fonts to improve your MathJax experience.", PageDesigned: "Diese Seite ist optimiert fuer %1. " + - "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern." //TODO ???? + "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern.", //TODO ???? // "This page is designed to use the %1. " + // "Download and install those fonts to improve your MathJax experience.", diff --git a/unpacked/localization/de/MathML.js b/unpacked/localization/de/MathML.js index 0f2fbcee3..202cec830 100644 --- a/unpacked/localization/de/MathML.js +++ b/unpacked/localization/de/MathML.js @@ -16,7 +16,7 @@ MathJax.Localization.addTranslation("de","MathML",{ "Eventuell blockieren die Sicherheitsoptionen ActiveX; ueberpruefen Sie\n"+ "unter 'Interneteinstellungen' -> 'Werkzeuge' -> 'Sicherheit' -> 'Anpassen' ob\n"+ "ob 'ActiveX aktivieren' und 'Binaer und Skriptverhalten' aktiviert sind.\n\n"+ - "Bei der jetzigen Konfiguration wird MathJax nur Fehlermeldungen anzeigen.\n"+ + "Bei der jetzigen Konfiguration wird MathJax nur Fehlermeldungen anzeigen.", // "MathJax was not able to set up MathPlayer.\n\n"+ // "If MathPlayer is not installed, you need to install it first.\n"+ // "Otherwise, your security settings may be preventing ActiveX \n"+ diff --git a/unpacked/localization/de/MathMenu.js b/unpacked/localization/de/MathMenu.js index 65988a5cc..79040bb10 100644 --- a/unpacked/localization/de/MathMenu.js +++ b/unpacked/localization/de/MathMenu.js @@ -37,10 +37,10 @@ MathJax.Localization.addTranslation("de","MathMenu",{ STIXLocal: "STIX (lokal)", // "STIX (local)", ContextMenu: "Kontextmenue", // "Contextual Menu", Browser: "Browser", - Scale: "Alle Mathe skalieren", // "Scale All Math ...", + Scale: "Alle Mathe skalieren ...", // "Scale All Math ...", Discoverable: "Highlight durch Hovern", // "Highlight on Hover", Locale: "Sprache", // "Language", - LoadLocale: "Von URL laden", // "Load from URL ...", + LoadLocale: "Von URL laden ...", // "Load from URL ...", About: "Ueber MathJax", // "About MathJax", Help: "MathJax Hilfe", // "MathJax Help", @@ -58,32 +58,32 @@ MathJax.Localization.addTranslation("de","MathMenu",{ WebkitNativeMMLWarning: "Ihr Browser scheint MathML nicht zu unterstuetzen, " + "so dass ein Wechsel zur MathML-Ausgabe die Mathematik " + - "auf der Seite unlesbar machen koennte." + "auf der Seite unlesbar machen koennte.", // "Your browser doesn't seem to support MathML natively, " + // "so switching to MathML output may cause the mathematics " + // "on the page to become unreadable.", MSIENativeMMLWarning: "Internet Explorer benoetigt das MathPlayer Plugin " + - "um MathML-Ausgabe verarbeiten zu koennen." + "um MathML-Ausgabe verarbeiten zu koennen.", // "Internet Explorer requires the MathPlayer plugin " + // "in order to process MathML output.", OperaNativeMMLWarning: "Opera's MathML unterstuetzung ist beschraenkt, so dass beim Wechsel " + - "zur MathML-Ausgabe einige Ausdruecke schlecht gerendert werden." + "zur MathML-Ausgabe einige Ausdruecke schlecht gerendert werden.", // "Opera's support for MathML is limited, so switching to " + // "MathML output may cause some expressions to render poorly.", SafariNativeMMLWarning: "Die MathML-Unterstuetzung Ihres Browsers beherrscht nicht alle " + - "MathJax-Features, so dass einige Ausdruecke schlecht gerendert werden." + "MathJax-Features, so dass einige Ausdruecke schlecht gerendert werden.", // "Your browser's native MathML does not implement all the features " + // "used by MathJax, so some expressions may not render properly.", FirefoxNativeMMLWarning: "Die MathML-Unterstuetzung Ihres Browsers beherrscht nicht alle " + - "MathJax-Features, so dass einige Ausdruecke schlecht gerendert werden." + "MathJax-Features, so dass einige Ausdruecke schlecht gerendert werden.", // "Your browser's native MathML does not implement all the features " + // "used by MathJax, so some expressions may not render properly.", @@ -131,14 +131,14 @@ MathJax.Localization.addTranslation("de","MathMenu",{ IE8warning: "Dies Deaktiviert das MathJax Menue und den MathJax Zoom " + "Alt+Klick auf eine Formel zeigt weiter das MathJax-Menue.\n\n" + - "Wirklich MathPlayer Einstellungen aendern?" + "Wirklich MathPlayer Einstellungen aendern?", // "This will disable the MathJax menu and zoom features, " + // "but you can Alt-Click on an expression to obtain the MathJax " + // "menu instead.\n\nReally change the MathPlayer settings?", IE9warning: "Das MathJax Menue wird deaktiviert und kann nur durch " + - "Alt+Klick auf eine Formel angezeigt werden." + "Alt+Klick auf eine Formel angezeigt werden.", // "The MathJax contextual menu will be disabled, but you can " + // "Alt-Click on an expression to obtain the MathJax menu instead.", From fe0abf54400b1fa1692453065709112ea711be56 Mon Sep 17 00:00:00 2001 From: pkra Date: Wed, 10 Apr 2013 09:20:38 -0700 Subject: [PATCH 25/41] updated de.js --- unpacked/localization/de/de.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/unpacked/localization/de/de.js b/unpacked/localization/de/de.js index e3b706530..446eda8cc 100644 --- a/unpacked/localization/de/de.js +++ b/unpacked/localization/de/de.js @@ -7,15 +7,15 @@ MathJax.Localization.addTranslation("de",null,{ strings: { CookieConfig: - "MathJax hat eine Cookie mit ausfuehrbaren Code gefunden. " + - "Soll dieser Code ausgefuehrt werden?\n\n" + - "(Klicken Sie 'Abbrechen' falls Sie nicht selber das Cookie akzeptiert haben.)", + "MathJax hat eine Cookie mit ausf\u00FChrbaren Code gefunden. " + + "Soll dieser Code ausgef\u00FChrt werden?\n\n" + + "(Klicken Sie 'Abbrechen' falls Sie das Cookie nicht selber akzeptiert haben.)", // "MathJax has found a user-configuration cookie that includes code to " + // "be run. Do you want to run it?\n\n" + // "(You should press Cancel unless you set up the cookie yourself.)", MathProcessingError: - "Mathe Verarbeitungsfehler ", + "Mathe Verarbeitungsfehler", // "Math Processing Error", MathError: @@ -28,7 +28,7 @@ MathJax.Localization.addTranslation("de",null,{ Loading: "Laden", -// "Loading", TODO??? +// "Loading", LoadFailed: "Datei konnte nicht geladen werden: %1", @@ -40,18 +40,18 @@ MathJax.Localization.addTranslation("de",null,{ Processing: "Verarbeiten", -// "Processing", TODO??? +// "Processing", TypesetMath: - "Mathe Textsatz: %1%%", + "Mathe wird gesetzt: %1%%", // "Typesetting Math: %1%%", Typesetting: "Setzen", -// "Typesetting", TODO??? +// "Typesetting", MathJaxNotSupported: - "Ihr Webbrowser unterstuetzt MathJax nicht" + "Ihr Webbrowser unterst\u00FCtzt MathJax nicht" // "Your browser does not support MathJax" } From 03f6e8537aa3ade1e0983b3ca4f33b5784ebaca5 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 10 Apr 2013 16:28:18 -0400 Subject: [PATCH 26/41] Add Markdown processing to HTML snippet text, and convert FontWarnings to use it. --- unpacked/MathJax.js | 81 +++++++++++++++++++++++- unpacked/extensions/FontWarnings.js | 24 +++---- unpacked/extensions/v1.0-warning.js | 2 +- unpacked/localization/de/FontWarnings.js | 20 +++--- unpacked/localization/en/FontWarnings.js | 13 ++-- unpacked/localization/fr/FontWarnings.js | 23 +++---- 6 files changed, 116 insertions(+), 47 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 0fdb47a14..5f86c88cf 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1161,7 +1161,7 @@ MathJax.Localization = { if (typeof data[1] === "string") { // [id,string,args] var id = data[0]; if (!(id instanceof Array)) {id = [domain,id]} var phrase = this.lookupPhrase(id,data[1]); - result = result.concat(this.processString(phrase,data.slice(2),domain)); + result = result.concat(this.processMarkdown(phrase,data.slice(2),domain)); } else if (data[1] instanceof Array) { // [domain,snippet] result = result.concat(this.processSnippet.apply(this,data)); } else if (data.length >= 3) { // ["tag",{properties},snippet] @@ -1175,6 +1175,85 @@ MathJax.Localization = { } return result; }, + + markdownPattern: /(%.)|(\*{1,3})((?:%.|.)+?)\2|(`+)((?:%.|.)+?)\4|\[((?:%.|.)+?)\]\(([^\s\)]+)\)/, + // %c or *bold*, **italics**, ***bold-italics***, or `code`, or [link](url) + + processMarkdown: function (phrase,args,domain) { + var result = [], data; + // + // Split the string by the Markdown pattern + // (the text blocks are separated by + // c,stars,star-text,backtics,code-text,link-text,URL). + // Start with teh first text string from the split. + // + var parts = phrase.split(this.markdownPattern); + var string = parts[0]; + // + // Loop through the matches and process them + // + for (var i = 1, m = parts.length; i < m; i += 8) { + if (parts[i+1]) { // stars (for bold/italic) + // + // Select the tag to use by number of stars (three stars requires two tags) + // + data = this.processString(parts[i+2],args,domain); + if (!(data instanceof Array)) {data = [data]} + data = [["b","i","i"][parts[i+1].length-1],{},data]; // number of stars determines type + if (parts[i+1].length === 3) {data = ["b",{},data]} // bold-italic + } else if (parts[i+3]) { // backtics (for code) + // + // Remove one leading or trailing space, and process substitutions + // Make a tag + // + data = this.processString(parts[i+4].replace(/^\s/,"").replace(/\s$/,""),args,domain); + if (!(data instanceof Array)) {data = [data]} + data = ["code",{},data]; + } else if (parts[i+5]) { // hyperlink + // + // Process the link text, and make an tag with the URL + // + data = this.processString(parts[i+5],args,domain); + if (!(data instanceof Array)) {data = [data]} + data = ["a",{href:parts[i+6],target:"_blank"},data]; + } else { + // + // Escaped character (%c) gets added into the string. + // + string += parts[i]; data = null; + } + // + // If there is a tag to insert, + // Add any pending string, then push the tag + // + if (data) { + result = this.concatString(result,string,args,domain); + result.push(data); string = ""; + } + // + // Process the string that follows matches pattern + // + if (parts[i+7] !== "") {string += parts[i+7]} + }; + // + // Add any pending string and return the resulting snippet + // + result = this.concatString(result,string,args,domain); + return result; + }, + concatString: function (result,string,args,domain) { + if (string != "") { + // + // Process the substutions. + // If the result is not a snippet, turn it into one. + // Then concatenate the snippet to the current one + // + string = this.processString(string,args,domain); + if (!(string instanceof Array)) {string = [string]} + result = result.concat(string); + } + return result; + }, lookupPhrase: function (id,phrase,domain) { // diff --git a/unpacked/extensions/FontWarnings.js b/unpacked/extensions/FontWarnings.js index 7b5a7653c..628684193 100644 --- a/unpacked/extensions/FontWarnings.js +++ b/unpacked/extensions/FontWarnings.js @@ -190,35 +190,27 @@ fonts: [ ["p"], ["fonts", - "MathJax can use either the %1 or the %2. " + + "MathJax can use either the [STIX fonts](%1) or the [MathJax TeX fonts](%2). " + "Download and install one of those fonts to improve your MathJax experience.", - [["a",{href:STIXURL,target:"_blank"},[["STIXfonts","STIX fonts"]]]], - [["a",{href:MATHJAXURL,target:"_blank"},[["TeXfonts","MathJax TeX fonts"]]]] + STIXURL,MATHJAXURL ] ], -// fonts: [ -// ["p"], -// ["fonts", -// "MathJax can use either the [STIX fonts](%1) or the [MathJax TeX fonts](%2)", -// "http://www.stixfonts.org/","http://www.mathjax.org/help-v2/fonts/"] -// ], - STIXfonts: [ ["p"], - ["PageDesigned", - "This page is designed to use the %1. " + + ["STIXPage", + "This page is designed to use the [STIX fonts](%1). " + "Download and install those fonts to improve your MathJax experience.", - [["a",{href:STIXURL,target:"_blank"},[["STIXfonts","STIX fonts"]]]] + STIXURL ] ], TeXfonts: [ ["p"], - ["PageDesigned", - "This page is designed to use the %1. " + + ["TeXPage", + "This page is designed to use the [MathJax TeX fonts](%1). " + "Download and install those fonts to improve your MathJax experience.", - [["a",{href:MATHJAXURL,target:"_blank"},[["TeXfonts","MathJax TeX fonts"]]]] + MATHJAXURL ] ] diff --git a/unpacked/extensions/v1.0-warning.js b/unpacked/extensions/v1.0-warning.js index 750c26507..d46839aba 100644 --- a/unpacked/extensions/v1.0-warning.js +++ b/unpacked/extensions/v1.0-warning.js @@ -85,7 +85,7 @@ "you must specify such files explicitly. " + "This page seems to use the older default %1 " + "file, and so needs to be updated. This is explained further at %2", - [["code",{},["config/MathJax.js"]]], + [["code",{},"config/MathJax.js"]], [["p",{style:{"text-align":"center"}},[ ["a", {href:"http://www.mathjax.org/help-v2/configuration"}, diff --git a/unpacked/localization/de/FontWarnings.js b/unpacked/localization/de/FontWarnings.js index 567d91983..9815be7a2 100644 --- a/unpacked/localization/de/FontWarnings.js +++ b/unpacked/localization/de/FontWarnings.js @@ -40,24 +40,22 @@ MathJax.Localization.addTranslation("de","FontWarnings",{ // "browsers) could improve the quality of the mathematics on this page.", fonts: - "MathJax kann %1 oder %2 verwenden. "+ + "MathJax kann [STIX Fonts](%1) oder [MathJax TeX Fonts](%2) verwenden. "+ "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern.", //TODO ???? -// "MathJax can use either the %1 or the %2. " + +// "MathJax can use either the [STIX Fonts](%1) or the [MathJax TeX fonts](%2). " + // "Download and install one of those fonts to improve your MathJax experience.", - PageDesigned: - "Diese Seite ist optimiert fuer %1. " + + STIXPage: + "Diese Seite ist optimiert fuer [STIX Fonts](%1). " + "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern.", //TODO ???? // "This page is designed to use the %1. " + // "Download and install those fonts to improve your MathJax experience.", - STIXfonts: - "STIX Fonts", -// "STIX fonts", - - TeXfonts: - "MathJax TeX Fonts" -// "MathJax TeX fonts" + TeXPage: + "Diese Seite ist optimiert fuer [MathJax TeX Fonts](%1). " + + "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern." //TODO ???? +// "This page is designed to use the %1. " + +// "Download and install those fonts to improve your MathJax experience." } }); diff --git a/unpacked/localization/en/FontWarnings.js b/unpacked/localization/en/FontWarnings.js index 97787deb2..ccf216e20 100644 --- a/unpacked/localization/en/FontWarnings.js +++ b/unpacked/localization/en/FontWarnings.js @@ -26,18 +26,17 @@ MathJax.Localization.addTranslation("en","FontWarnings",{ "browsers) could improve the quality of the mathematics on this page.", fonts: - "MathJax can use either the %1 or the %2. " + + "MathJax can use either the [STIX fonts](%1) or the [MathJax TeX fonts](%2). " + "Download and install one of those fonts to improve your MathJax experience.", - PageDesigned: - "This page is designed to use the %1. " + + STIXPage: + "This page is designed to use the [STIX fonts](%1). " + "Download and install those fonts to improve your MathJax experience.", - STIXfonts: - "STIX fonts", + TeXPage: + "This page is designed to use the [MathJax TeX fonts](%1). " + + "Download and install those fonts to improve your MathJax experience." - TeXfonts: - "MathJax TeX fonts" } }); diff --git a/unpacked/localization/fr/FontWarnings.js b/unpacked/localization/fr/FontWarnings.js index ead16dffa..250826b01 100644 --- a/unpacked/localization/fr/FontWarnings.js +++ b/unpacked/localization/fr/FontWarnings.js @@ -31,20 +31,21 @@ MathJax.Localization.addTranslation("fr","FontWarnings",{ "être améliorée.", fonts: - "MathJax peut utiliser les %1 ou bien les %2. Téléchargez et"+ - "installez l'une de ces familles de polices pour améliorer votre"+ + "MathJax peut utiliser les [Polices STIX](%1) ou bien les " + + "[Polices TeX de MathJax](%2). Téléchargez et installez " + + "l'une de ces familles de polices pour améliorer votre "+ "expérience avec MathJax.", - PageDesigned: - "Cette page est conçue pour utiliser les %1. Téléchargez "+ - " et installez ces polices pour améliorer votre expérience "+ - "avec MathJax", + TeXPage: + "Cette page est conçue pour utiliser les [Polices STIX](%1). " + + "Téléchargez et installez ces polices pour améliorer votre " + + "expérience avec MathJax", - STIXfonts: - "Polices STIX", - - TeXfonts: - "Polices TeX de MathJax" + TeXPage: + "Cette page est conçue pour utiliser les [Polices TeX de MathJax](%1). " + + "Téléchargez et installez ces polices pour améliorer votre " + + "expérience avec MathJax" + } }); From e292b1ade2c02b292f9830b9b835bca19e39006b Mon Sep 17 00:00:00 2001 From: pkra Date: Wed, 10 Apr 2013 14:19:47 -0700 Subject: [PATCH 27/41] Updated the German locale --- unpacked/localization/de/FontWarnings.js | 28 ++--- unpacked/localization/de/HTML-CSS.js | 4 +- unpacked/localization/de/MathML.js | 39 ++++--- unpacked/localization/de/MathMenu.js | 92 +++++++-------- unpacked/localization/de/TeX.js | 136 ++++++++++++----------- unpacked/localization/de/de.js | 8 +- unpacked/localization/de/v1.0-warning.js | 6 +- 7 files changed, 161 insertions(+), 152 deletions(-) diff --git a/unpacked/localization/de/FontWarnings.js b/unpacked/localization/de/FontWarnings.js index 567d91983..71f69173a 100644 --- a/unpacked/localization/de/FontWarnings.js +++ b/unpacked/localization/de/FontWarnings.js @@ -4,8 +4,8 @@ MathJax.Localization.addTranslation("de","FontWarnings",{ webFont: "MathJax nutz web-basierte Fonts zur Darstellung der Mathematik " + - "auf dieser Seite. Da diese muessen heruntergeladen werden " + - "laedt die Seite schneller, wenn Mathe-Fonts auf dem System installiert sind.", + "auf dieser Seite. Da diese heruntergeladen werden m\u00FCssen, " + + "l\u00E4dt die Seite schneller, wenn Mathe-Fonts auf dem System installiert sind.", // "MathJax is using web-based fonts to display the mathematics "+ // "on this page. These take time to download, so the page would "+ // "render faster if you installed math fonts directly in your "+ @@ -13,17 +13,17 @@ MathJax.Localization.addTranslation("de","FontWarnings",{ imageFonts: "MathJax nutzt Bild-Fonts stall lokaler Fonts oder Webfonts. " + - "Das Laden dauert laenger als ueblich und Drucken wird " + - "evtl. nicht auf hoechster Qualitaet moeglich sein.", + "Das Laden dauert l\u00E4nger als erwartet und Drucken wird " + // translated "expected" rather than "usual" + "evtl. nicht in bester Qualit\u00E4 t m\u00F6glich sein.", // translated 'best quality' rather than 'full resolution' // "MathJax is using its image fonts rather than local or web-based fonts. "+ // "This will render slower than usual, and the mathematics may not print "+ // "at the full resolution of your printer.", noFonts: "MathJax kann keinen Font zur Darstellung der Mathematik finden "+ - "und Bild-Fonts sind nicht verfuegbar. MathJax weicht auf generische "+ - "Unicode-Zeichen aus in der Hoffnung, Ihr Browser kann diese darstellen. "+ - "Einige oder alle Zeichen koennten nicht korrekt dargestellt werden.", + "und Bild-Fonts sind nicht verf\u00FCgbar. MathJax weicht auf generische "+ + "Unicode-Zeichen aus in der Hoffnung, der Browser kann diese darstellen. "+ + "Einige oder alle Zeichen k\u00F6nnten nicht korrekt dargestellt werden.", // "MathJax is unable to locate a font to use to display "+ // "its mathematics, and image fonts are not available, so it "+ // "is falling back on generic unicode characters in hopes that "+ @@ -31,23 +31,23 @@ MathJax.Localization.addTranslation("de","FontWarnings",{ // "may not show up properly, or possibly not at all.", webFonts: - "Die meisten modernen Browser koennen fonts aus dem Web laden. "+ - "Um die Qualitaet der Mathematik auf dieser Seite zu verbessern, "+ - "sollten Sie ein Update auf eine aktuelle Version des Browsers vornehmen "+ - "(oder einen aktuellen Browser installieren).", + "Die meisten modernen Browser k\u00F6 nnen Fonts aus dem Web laden. "+ + "Um die Qualit\u00E4 t der Mathematik auf dieser Seite zu verbessern, "+ + "sollten Sie ein Update auf eine akt\u00FC lle Version des Browsers vornehmen "+ + "(oder einen akt\u00FC llen Browser installieren).", // "Most modern browsers allow for fonts to be downloaded over the web. "+ // "Updating to a more recent version of your browser (or changing "+ // "browsers) could improve the quality of the mathematics on this page.", fonts: "MathJax kann %1 oder %2 verwenden. "+ - "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern.", //TODO ???? + "Installieren dieser Fonts wird die Geschwindigkeit verbessern.", // "Installing these fonts will improve speed" // "MathJax can use either the %1 or the %2. " + // "Download and install one of those fonts to improve your MathJax experience.", PageDesigned: - "Diese Seite ist optimiert fuer %1. " + - "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern.", //TODO ???? + "Diese Seite ist optimiert f\u00FC r %1. " + + "Installieren dieser Fonts wird die Geschwindigkeit verbessern.", //"Installing these fonts will improve speed" // "This page is designed to use the %1. " + // "Download and install those fonts to improve your MathJax experience.", diff --git a/unpacked/localization/de/HTML-CSS.js b/unpacked/localization/de/HTML-CSS.js index 348874528..c6a97bc8e 100644 --- a/unpacked/localization/de/HTML-CSS.js +++ b/unpacked/localization/de/HTML-CSS.js @@ -15,11 +15,11 @@ MathJax.Localization.addTranslation("de","HTML-CSS",{ // "Firefox can't load web fonts from a remote host", CantFindFontUsing: - "Kein gueltiger font fuer %1 verfuegbar", + "Kein g\u00FCltiger Font fuer %1 verf\u00FCgbar", // "Can't find a valid font using %1", WebFontsNotAvailable: - "Webfonts nicht verfuegbar -- benutze Bilderfont" + "Webfonts nicht verf\u00FCgbar -- benutze Bildfont" // "Web-Fonts not available -- using image fonts instead" } diff --git a/unpacked/localization/de/MathML.js b/unpacked/localization/de/MathML.js index 202cec830..61edab42a 100644 --- a/unpacked/localization/de/MathML.js +++ b/unpacked/localization/de/MathML.js @@ -10,12 +10,12 @@ MathJax.Localization.addTranslation("de","MathML",{ "Schlechter Font: %1", // "Bad font: %1", - MathPlayer: //TODO CHECK WINDOWS IN GERMAN :( + MathPlayer: //TODO check names of German Windows settings http://support.microsoft.com/ "MathJax konnnte MathPlayer nicht einrichten.\n\n"+ "Falls MathPlayer nicht installiert ist, muss es erst installiert werden.\n"+ - "Eventuell blockieren die Sicherheitsoptionen ActiveX; ueberpruefen Sie\n"+ - "unter 'Interneteinstellungen' -> 'Werkzeuge' -> 'Sicherheit' -> 'Anpassen' ob\n"+ - "ob 'ActiveX aktivieren' und 'Binaer und Skriptverhalten' aktiviert sind.\n\n"+ + "Eventuell blockieren die Sicherheitsoptionen ActiveX; \u00FCberpr\u00FCfen Sie\n"+ + "unter 'Internetoptionen' -> 'Sicherheit' -> 'Stufe Anpassen',\n"+ + "ob 'ActiveX aktivieren' und 'Bin\u00E4 r und Skriptverhalten' aktiviert sind.\n\n"+ "Bei der jetzigen Konfiguration wird MathJax nur Fehlermeldungen anzeigen.", // "MathJax was not able to set up MathPlayer.\n\n"+ // "If MathPlayer is not installed, you need to install it first.\n"+ @@ -28,31 +28,36 @@ MathJax.Localization.addTranslation("de","MathML",{ // "Currently you will see error messages rather than\n"+ // "typeset mathematics.", - CantCreateXMLParser: - "MathJax can't create an XML parser for MathML. Check that\n"+ - "the 'Script ActiveX controls marked safe for scripting' security\n"+ - "setting is enabled (use the Internet Options item in the Tools\n"+ - "menu, and select the Security panel, then press the Custom Level\n"+ - "button to check this).\n\n"+ - "MathML equations will not be able to be processed by MathJax.", + CantCreateXMLParser://TODO check name of German Windows settings + "MathJax kann keinen XML-Parser f\u00FC r MathML erzeugen."+ + "\u00DC berpr\u00FC fen Sie die Einstellungen unter "+ + "'Internetoptionen'-> 'Werkzeuge' -> 'Sicherheit' -> 'Anpassen'"+ + "und aktivieren sie 'ActiveX Skripte als sicher einstufen'.\n\n"+ + "MathJax kann sonst kein MathML verarbeiten." +// "MathJax can't create an XML parser for MathML. Check that\n"+ +// "the 'Script ActiveX controls marked safe for scripting' security\n"+ +// "setting is enabled (use the Internet Options item in the Tools\n"+ +// "menu, and select the Security panel, then press the Custom Level\n"+ +// "button to check this).\n\n"+ +// "MathML equations will not be able to be processed by MathJax.", TODO Cumbersome English UnknownNodeType: - "Unknown node type: %1", + "Unbekannter Knotentyp: %1", //"Unknown node type: %1", UnexpectedTextNode: - "Unexpected text node: %1", + "Unbekannter Textknoten: %1", //"Unexpected text node: %1", ErrorParsingMathML: - "Error parsing MathML", + "Fehler beim Parsen von MathML", //"Error parsing MathML", ParsingError: - "Error parsing MathML: %1", + "Fehler beim Parsen von MathML: %1", // "Error parsing MathML: %1", MathMLSingleElement: - "MathML must be formed by a single element", + "MathML muss ein einzelnes Element sein", //"MathML must be formed by a single element", MathMLRootElement: - "MathML must be formed by a element, not %1" + "MathML muss ein einzelnes Element sein, nicht %1", //"MathML must be formed by a element, not %1" } }); diff --git a/unpacked/localization/de/MathMenu.js b/unpacked/localization/de/MathMenu.js index 79040bb10..dc1b92e7d 100644 --- a/unpacked/localization/de/MathMenu.js +++ b/unpacked/localization/de/MathMenu.js @@ -2,21 +2,21 @@ MathJax.Localization.addTranslation("de","MathMenu",{ isLoaded: true, strings: { - Show: "Zeige Mathe als", // "Show Math As", TODO THAT's WEIRD + Show: "Zeige Mathe als", // "Show Math As", TODO It's weird to have "Math" instead of "equation" "formula" etc but I think we should follow this globally MathMLcode: "MathML Code", OriginalMathML: "Original MathML", - TeXCommands: "Original TeX", // "TeX Commands", TODO ENGLISH? - AsciiMathInput: "Original AsciiMathML", // "AsciiMathML input", TODO ENGLISH? - Original: "Originalform", // "Original Form", + TeXCommands: "Original TeX", // "TeX Commands", TODO maybe switch English, too? I find that order appealing + AsciiMathInput: "Original AsciiMathML", // "AsciiMathML input", TODO see above + Original: "Originalform", // "Original Form", TODO What is that referring to? ErrorMessage: "Fehlermeldung", // "Error Message", - texHints: "Bette TeX Tipps in MathML ein", // "Show TeX hints in MathML", - Settings: "Einstellungen", // "Math Settings", - ZoomTrigger: "Zoom ausloesen", // "Zoom Trigger", + texHints: "TeX Tipps in MathML", // "Show TeX hints in MathML", TODO I left out "show" -- seemed redundant & "embed" or "add" is more appropriate. + Settings: "Einstellungen", // "Math Settings", //TODO I dropped the "Math", is that ok? Should we do this in general? + ZoomTrigger: "Zoom ausl\u00F6sen", // "Zoom Trigger", Hover: "Hover", Click: "Klick", // "Click", DoubleClick: "Doppelklick", // "Double-Click", NoZoom: "Kein Zoom", // "No Zoom", - TriggerRequires: "Ausloeser benoetigt:", // "Trigger Requires:", + TriggerRequires: "Ausl\u00F6ser ben\u00F6tigt:", // "Trigger Requires:", Option: "Option", Alt: "Alt", Command: "Command", @@ -24,71 +24,71 @@ MathJax.Localization.addTranslation("de","MathMenu",{ Shift: "Shift", ZoomFactor: "Zoomfaktor", // "Zoom Factor", Renderer: "Mathe Renderer", // "Math Renderer", - MPHandles: "An MathPlayer uebergeben:", // "Let MathPlayer Handle:", - MenuEvents: "Menue Events", // "Menu Events", + MPHandles: "An MathPlayer \u00FCbergeben:", // "Let MathPlayer Handle:", + MenuEvents: "Men\u00FC Events", // "Menu Events", //TODO not sure about "Events" jargon. what are these? MouseEvents: "Maus Events", // "Mouse Events", - MenuAndMouse: "Maus und Menue Events", // "Mouse and Menu Events", - FontPrefs: "Font Einstellungen", // "Font Preferences", - ForHTMLCSS: "Fuer HTML-CSS", // "For HTML-CSS:", + MenuAndMouse: "Maus und Men\u00FC Events", // "Mouse and Menu Events", + FontPrefs: "Font Einstellungen", // "Font Preferences", //TODO What's this? + ForHTMLCSS: "F\u00FCr HTML-CSS", // "For HTML-CSS:", Auto: "Auto", TeXLocal: "TeX (lokal)", // "TeX (local)", TeXWeb: "TeX (Web)", // "TeX (web)", TeXImage: "TeX (Bild)", // "TeX (image)", STIXLocal: "STIX (lokal)", // "STIX (local)", - ContextMenu: "Kontextmenue", // "Contextual Menu", + ContextMenu: "Kontextmen\u00FC ", // "Contextual Menu", Browser: "Browser", Scale: "Alle Mathe skalieren ...", // "Scale All Math ...", Discoverable: "Highlight durch Hovern", // "Highlight on Hover", Locale: "Sprache", // "Language", LoadLocale: "Von URL laden ...", // "Load from URL ...", - About: "Ueber MathJax", // "About MathJax", + About: "\u00DCber MathJax", // "About MathJax", TODO should be a line lower before the rest of the about box? Help: "MathJax Hilfe", // "MathJax Help", - - localTeXfonts: "Lokale TeX-Fonts werden verwendet", // "using local TeX fonts", - webTeXfonts: "Web TeX-Fonts werden verwendet", // "using web TeX font", - imagefonts: "Bild-Fonts werden verwendet", // "using Image fonts", - localSTIXfonts: "Lokale STIX-Fonts werden verwendet", // "using local STIX fonts", - webSVGfonts: "Web SVG-fonts werden verwendet", // "using web SVG fonts", - genericfonts: "Generische Unicode-Fonts werden verwendet", // "using generic unicode fonts", +/* About MathJax dialogue ? */ + localTeXfonts: "Lokale TeX-Fonts verwendet", // "using local TeX fonts", + webTeXfonts: "Web TeX-Fonts verwendet", // "using web TeX font", + imagefonts: "Bild-Fonts verwendet", // "using Image fonts", + localSTIXfonts: "Lokale STIX-Fonts verwendet", // "using local STIX fonts", + webSVGfonts: "Web SVG-fonts verwendet", // "using web SVG fonts", + genericfonts: "Generische Unicode-Fonts verwendet", // "using generic unicode fonts", - wofforotffonts: "WOFF- oder OTF-Fonts", // "woff or otf fonts", + wofforotffonts: "WOFF- oder OTF-Fonts", // "woff or otf fonts", TODO capitalize English? eotffonts: "EOT-Fonts", // "eot fonts", svgfonts: "SVG-Fonts", // "svg fonts", WebkitNativeMMLWarning: - "Ihr Browser scheint MathML nicht zu unterstuetzen, " + + "Ihr Browser scheint MathML nicht zu unterst\u00FCtzen, " + "so dass ein Wechsel zur MathML-Ausgabe die Mathematik " + - "auf der Seite unlesbar machen koennte.", + "auf der Seite unlesbar machen k\u00F6nnte.", // "Your browser doesn't seem to support MathML natively, " + // "so switching to MathML output may cause the mathematics " + // "on the page to become unreadable.", MSIENativeMMLWarning: - "Internet Explorer benoetigt das MathPlayer Plugin " + - "um MathML-Ausgabe verarbeiten zu koennen.", + "Internet Explorer ben\u00F6tigt das MathPlayer Plugin, " + + "um MathML-Ausgabe darstellen zu k\u00F6nnen.", // "Internet Explorer requires the MathPlayer plugin " + // "in order to process MathML output.", OperaNativeMMLWarning: - "Opera's MathML unterstuetzung ist beschraenkt, so dass beim Wechsel " + - "zur MathML-Ausgabe einige Ausdruecke schlecht gerendert werden.", + "Opera's MathML unterst\u00FCtzung ist beschr\u00E4nkt, so dass beim Wechsel " + + "zur MathML-Ausgabe einige Ausdr\u00FCcke schlecht gerendert werden.", // "Opera's support for MathML is limited, so switching to " + // "MathML output may cause some expressions to render poorly.", SafariNativeMMLWarning: - "Die MathML-Unterstuetzung Ihres Browsers beherrscht nicht alle " + - "MathJax-Features, so dass einige Ausdruecke schlecht gerendert werden.", + "Die MathML-Unterst\u00FCtzung Ihres Browsers beherrscht nicht alle " + + "MathJax-Features, so dass einige Ausdr\u00FCcke schlecht gerendert werden.", // "Your browser's native MathML does not implement all the features " + // "used by MathJax, so some expressions may not render properly.", FirefoxNativeMMLWarning: - "Die MathML-Unterstuetzung Ihres Browsers beherrscht nicht alle " + - "MathJax-Features, so dass einige Ausdruecke schlecht gerendert werden.", + "Die MathML-Unterst\u00FCtzung Ihres Browsers beherrscht nicht alle " + + "MathJax-Features, so dass einige Ausdr\u00FCcke schlecht gerendert werden.", // "Your browser's native MathML does not implement all the features " + // "used by MathJax, so some expressions may not render properly.", MSIESVGWarning: - "Internet Explorer unterstuetzt SVG erst ab IE9 und " + + "Internet Explorer unterst\u00FCtzt SVG erst ab IE9 und " + "nicht im IE8-Emulationsmodus. Beim Wechsel zur " + "SVG-Ausgabe wird die Mathematik nicht richtig dargestellt.", // "SVG is not implemented in Internet Explorer prior to " + @@ -97,11 +97,11 @@ MathJax.Localization.addTranslation("de","MathMenu",{ // "not display properly.", LoadURL: - "Sprachschema-Daten von URL laden:", + "Sprachschema von URL laden:", // "Load translation data from this URL:", BadURL: - "URL muss zu einer JavaScript-Datei fuer MathJax Sprachschema fuehren. " + + "URL muss eine JavaScript-Datei f\u00FCr MathJax Sprachschema verlinken. " + "JavaScript Dateinamen sollten auf '.js' enden.", // "The URL should be for a javascript file that defines MathJax translation data. " + // "Javascript file names should end with '.js'", @@ -111,13 +111,13 @@ MathJax.Localization.addTranslation("de","MathMenu",{ // "Failed to load translation data from %1", SwitchAnyway: - "Renderer trotzdem aendern?\n\n" + - "(Mit OK wechseln, mit ABBRECHEN den aktuellen Renderer verwenden)", + "Renderer trotzdem \u00E4ndern?\n\n" + + "(Mit OK wechseln, mit ABBRECHEN den akt\u00FCllen Renderer verwenden)", //TODO check German browser lingo OK // Abbrechen // "Switch the renderer anyway?\n\n" + // "(Press OK to switch, CANCEL to continue with the current renderer)", ScaleMath: - "Alle Mathematik skalieren (relativ zum Umgebenden Text)", + "Alle Mathematik skalieren (relativ zum umgebenden Text)", // "Scale all mathematics (compared to surrounding text) by", NonZeroScale: @@ -125,26 +125,26 @@ MathJax.Localization.addTranslation("de","MathMenu",{ // "The scale should not be zero", PercentScale: - "Skalierung muss in Prozent sein", + "Skalierung muss in Prozent sein (z.B. 120%%)", // "The scale should be a percentage (e.g., 120%%)", IE8warning: - "Dies Deaktiviert das MathJax Menue und den MathJax Zoom " + - "Alt+Klick auf eine Formel zeigt weiter das MathJax-Menue.\n\n" + - "Wirklich MathPlayer Einstellungen aendern?", + "Dies Deaktiviert das MathJax Men\u00FC und den MathJax Zoom. " + + "Alt+Klick auf eine Formel zeigt weiter das MathJax-Men\u00FC.\n\n" + + "Wirklich MathPlayer Einstellungen \u00E4ndern?", // "This will disable the MathJax menu and zoom features, " + // "but you can Alt-Click on an expression to obtain the MathJax " + // "menu instead.\n\nReally change the MathPlayer settings?", IE9warning: - "Das MathJax Menue wird deaktiviert und kann nur durch " + + "Das MathJax Men\u00FC wird deaktiviert und kann nur durch " + "Alt+Klick auf eine Formel angezeigt werden.", // "The MathJax contextual menu will be disabled, but you can " + // "Alt-Click on an expression to obtain the MathJax menu instead.", NoOriginalForm: - "Keine Originalform verfuegbar", -// "No original form available", TODO??? + "Keine Originalform verf\u00FCgbar", +// "No original form available", Close: "Schliessen", diff --git a/unpacked/localization/de/TeX.js b/unpacked/localization/de/TeX.js index ad9bd512d..06eceb35a 100644 --- a/unpacked/localization/de/TeX.js +++ b/unpacked/localization/de/TeX.js @@ -3,15 +3,15 @@ MathJax.Localization.addTranslation("de","TeX",{ strings: { ExtraOpenMissingClose: - "Zusaetzliche offene oder fehlende schliessende Klammer", + "Zus\u00E4 tzliche offene oder fehlende schliessende Klammer",//TODO maybe 'ueberfluessig' = superfluous is better? or 'zu viele' = too many? // "Extra open brace or missing close brace", ExtraCloseMissingOpen: - "Zusaetzliche schliessende oder fehlende offene Klammer", + "Zus\u00E4 tzliche schliessende oder fehlende offene Klammer",//TODO ditto // "Extra close brace or missing open brace", MissingLeftExtraRight: - "Fehlendes \\left oder zusaetzliches \\right", + "Fehlendes \\left oder zus\u00E4 tzliches \\right", //TODO ditto // "Missing \\left or extra \\right", MissingScript: @@ -19,18 +19,20 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Missing superscript or subscript argument", ExtraLeftMissingRight: - "Zusaetzliches \\left oder fehlendes \\right", + "Zus\u00E4 tzliches \\left oder fehlendes \\right",//TODO ditto // "Extra \\left or missing \\right", Misplaced: - "%1 falsch plaziert", + "%1 falsch plaziert", //TODO not sure about context. // "Misplaced %1", MissingOpenForSub: - "Missing open brace for subscript", // *NEW* + "Fehlende offende Klammer im Subskript", +// "Missing open brace for subscript", // *NEW* MissingOpenForSup: - "Missing open brace for superscript", // *NEW* + "Fehlende offene Klammer im Superskript", +// "Missing open brace for superscript", // *NEW* AmbiguousUseOf: "Mehrdeutige Verwendung von %1", @@ -45,8 +47,8 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Missing \\end{%1}", MissingBoxFor: - "Fehlende Box: %1", -// "Missing box for %1",TODO ??? + "Fehlende Box: %1", //TODO What kind of TeX is this referring to? +// "Missing box for %1", MissingCloseBrace: "Fehlende geschlossene Klammer Missing close brace", @@ -65,19 +67,19 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Double subscripts: use braces to clarify", DoubleExponentPrime: - "Prime fuehrt zu doppeltem Superskript: verwende Klammern zum Gruppieren ", + "Prime f\u00FChrt zu doppeltem Superskript: verwende Klammern zum Gruppieren ", // "Prime causes double exponent: use braces to clarify", CantUseHash1: - "'macro parameter character #' kann nicht im Mathematikmodus verwendet werden", -// "You can't use 'macro parameter character #' in math mode", TODO ??? + "Das Zeichen '#' ist ein Makroparameter und kann nicht im Mathematikmodus verwendet werden.", //TODO Do we need to explain the why? Should we just say "can't be used, use '\#' instead" +// "You can't use 'macro parameter character #' in math mode", MisplacedMiddle: "%1 muss zwischen \\left und \\right stehen", // "%1 must be within \\left and \\right", MisplacedLimits: - "%1 ist nur bei Operatoren erlaubt", + "%1 ist nur bei Operatoren erlaubt", //TODO "bei" could be wrong, maybe 'in', 'an' // "%1 is allowed only on operators", MisplacedMoveRoot: @@ -85,8 +87,8 @@ MathJax.Localization.addTranslation("de","TeX",{ // "%1 can appear only within a root", MultipleCommand: - "Vielfache %1", -// "Multiple %1", TODO ??? + "Zu viele %1",//TODO need context. I translated as "too many" +// "Multiple %1", IntegerArg: "Das Argument in %1 muss ganzzahlig sein", @@ -97,51 +99,51 @@ MathJax.Localization.addTranslation("de","TeX",{ // "%1 is not a token element", InvalidMathMLAttr: - "Unzulaessiges MathML-Attribut: %1", + "Unzul\u00E4ssiges MathML-Attribut: %1", // "Invalid MathML attribute: %1", UnknownAttrForElement: - "%1 ist kein zulaessiged Attribut fuer %2", + "%1 ist kein zul\u00E4ssiges Attribut f\u00FCr %2", // "%1 is not a recognized attribute for %2", MaxMacroSub1: "Maximale Anzahl an Makros ist erreicht; " + - "wird ein rekursiver Aufruf verwendet?", + "wird ein rekursiver Makroaufruf verwendet?", // "MathJax maximum macro substitution count exceeded; " + -// "is there a recursive macro call?", TODO ??? +// "is there a recursive macro call?", MaxMacroSub2: "Maximale Anzahl an Substitutionen ist erreicht; " + "wird eine rekursive LaTeX-Umgebung verwendet?", // "MathJax maximum substitution count exceeded; " + -// "is there a recursive latex environment?", +// "is there a recursive latex environment?", //TODO use LaTeX ? MissingArgFor: - "Fehlendes Argument in %1", -// "Missing argument for %1", TODO??? + "Fehlendes Argument in %1", //TODO 'in' could be wrong preposition +// "Missing argument for %1", ExtraAlignTab: - "Zusaetzliches & im \\cases Text", -// "Extra alignment tab in \\cases text", TODO??? + "Zus\u00E4tzliches & im \\cases Text",//TODO not sure about German TeX jargon, but & might be clearer? Maybe switch to 'zu viele // too many' instead of extra. +// "Extra alignment tab in \\cases text", BracketMustBeDimension: - "Das geklammerte Argument fuer %1 muss eine Dimension sein", + "Das geklammerte Argument f\u00FCr %1 muss eine Dimension sein", //TODO wasn't sure about Dimension jargon // "Bracket argument to %1 must be a dimension", InvalidEnv: - "Ungueltiger Umgebungsname %1", + "Ung\u00FCltiger Umgebungsname %1", // "Invalid environment name '%1'", UnknownEnv: - "Ungueltige Umgebung %1", + "Ung\u00FCltige Umgebung %1", // "Unknown environment '%1'", ExtraClose: - "Zusaetzliche geschlossene Klammer", + "Zus\u00E4tzliche geschlossene Klammer", //TODO 'zu viele / too many' might be better // "Extra close brace", ExtraCloseLooking: - "Zusaetzliche geschlossene Klammer waehrend der Suche nach %1", + "Zus\u00E4tzliche geschlossene Klammer w\u00E4hrend der Suche nach %1", //TODO 'zu viele / too many' might be better, not sure about programming jargon for "while looking for" // "Extra close brace while looking for %1", MissingCloseBracket: @@ -149,28 +151,28 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Couldn't find closing ']' for argument to %1", MissingOrUnrecognizedDelim: - "Fehlender oder nichterkannter Delimiter bei %1", + "Fehlender oder nichterkannter Delimiter bei %1", //TODO not sure about Delimiter as TeX jargon // "Missing or unrecognized delimiter for %1", MissingDimOrUnits: - "Fehlende Dimension oder Einheiten bei %1", + "Fehlende Dimension oder Einheiten bei %1", //TODO not sure about TeX jargon // "Missing dimension or its units for %1", TokenNotFoundForCommand: - "Konnte %1 nicht vor %2 finden", + "Konnte %1 nicht f\u00FCr %2 finden", //TODO not sure about 'fuer' preposition. What's the context? // "Couldn't find %1 for %2", MathNotTerminated: - "Formel in Textbox nicht abgschlossen", + "Formel in Textbox nicht abgeschlossen", // "Math not terminated in text box", IllegalMacroParam: - "Ungueltiger Makroparameter", + "Ung\u00FC ltiger Makroparameter", // "Illegal macro parameter reference", MaxBufferSize: - "Interner Puffergroesse ueberschritten; wird ein rekursiver Makroaufruf verwendet?", -// "MathJax internal buffer size exceeded; is there a recursive macro call?", TODO??? + "Interner Puffergr\u00F6\u00DFe \u00FC berschritten; wird ein rekursiver Makroaufruf verwendet?", // TODO not sure about buffer/puffer, macro call/makroaufruf +// "MathJax internal buffer size exceeded; is there a recursive macro call?", /* AMSmath */ @@ -179,7 +181,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "%1 not allowed in %2 environment", MultipleLabel: - "Label '%1' ueberdefiniert", + "Label '%1' \u00FCberdefiniert", // "Label '%1' multiply defined", CommandAtTheBeginingOfLine: @@ -187,23 +189,23 @@ MathJax.Localization.addTranslation("de","TeX",{ // "%1 must come at the beginning of the line", IllegalAlign: - "Ungueltige Ausrichtung in %1", -// "Illegal alignment specified in %1", TODO ??? + "Ung\u00FCltige Ausrichtung in %1",//TODO not sure about Ausrichtung/alignment +// "Illegal alignment specified in %1", ? BadMathStyleFor: - "Schlechter math style: %1", -// "Bad math style for %1", TODO??? + "Schlechter math style: %1", //TODO not sure about math style. +// "Bad math style for %1", PositiveIntegerArg: "Argument bei %1 muss positiv und ganzzahlig sein", // "Argument to %1 must me a positive integer", ErroneousNestingEq: - "Fehlerhafte Verschachtelung von Gleichungen", -// "Erroneous nesting of equation structures", TODO??? + "Fehlerhafte Verschachtelung von Gleichungen", //TODO not sure about Verschachtelung/nesting jargon +// "Erroneous nesting of equation structures", MultlineRowsOneCol: - "Zeilen in multiline Umgebung muessen genau eine Spalte haben", + "Zeilen in multiline Umgebung m\u00FC ssen genau eine Spalte haben", // "The rows within the %1 environment must have exactly one column" /* bbox */ @@ -213,13 +215,13 @@ MathJax.Localization.addTranslation("de","TeX",{ // "%1 specified twice in %2", InvalidBBoxProperty: - "'%1' scheint keine Farbe, padding Dimension oder style zu sein", -// "'%1' doesn't look like a color, a padding dimension, or a style", TODO??? + "'%1' scheint keine Farbe, Padding-Dimension oder Stil zu sein",//TODO not sure about TeX jargon +// "'%1' doesn't look like a color, a padding dimension, or a style", /* begingroup */ ExtraEndMissingBegin: - "Zusaetzliches oder Fehlendes \\begingroup", + "Zus\u00E4tzliches oder Fehlendes \\begingroup" // "Extra %1 or missing \\begingroup", GlobalNotFollowedBy: @@ -229,21 +231,23 @@ MathJax.Localization.addTranslation("de","TeX",{ /* color */ UndefinedColorModel: - "Farbmuster '%1' nicht definiert", -// "Color model '%1' not defined", TODO??? + "Farbmodell '%1' nicht definiert", +// "Color model '%1' not defined", ModelArg1: - "Color values for the %1 model require 3 numbers", // *NEW* + "Farbwerte f\u00FCr Farbmodell %1 ben\u00F6tigen 3 Werte", +// "Color values for the %1 model require 3 numbers", // *NEW* InvalidDecimalNumber: - "Ungueltige Dezimalzahl", + "Ung\u00FCltige Dezimalzahl", // "Invalid decimal number", ModelArg2: - "Color values for the %1 model must be between %2 and %3", // *NEW* + "Farbwerte f\u00FCr Farbmodell %1 m\u00FCssen zwischen %2 und %3 liegen", +// Color values for the %1 model must be between %2 and %3", // *NEW* InvalidNumber: - "Ungueltige Zahl", + "Ung\u00FCltige Zahl", // "Invalid number", /* extpfeil */ @@ -253,27 +257,27 @@ MathJax.Localization.addTranslation("de","TeX",{ // "First argument to %1 must be a control sequence name", NewextarrowArg2: - "Zweites Argument von %1 muessen zwei ganze Zahlen, durch Komma getrennt, sein", + "Zweites Argument von %1 m\u00FCssen zwei ganze Zahlen, durch Komma getrennt, sein", // "Second argument to %1 must be two integers separated by a comma", NewextarrowArg3: - "Drittes argument von %1 muessen Unicode-Nummern sein", + "Drittes argument von %1 m\u00FCssen Unicode-Nummern sein", // "Third argument to %1 must be a unicode character number", /* mhchem */ NoClosingChar: - "Kann geschlossenes %1 nicht finden", + "Kann geschlossenes %1 nicht finden",//TODO geschlossenes is neutral Gender, hope this works, but probably not since chars have different genders // "Can't find closing %1", /* newcommand */ IllegalControlSequenceName: - "Ungueltige Befehlsfolge", + "Ung\u00FCltige Befehlsfolge", // "Illegal control sequence name for %1", IllegalParamNumber: - "Ungueltige Anzahl von Parametern in %1", + "Ung\u00FCltige Anzahl von Parametern in %1", // "Illegal number of parameters specified in %1", DoubleBackSlash: @@ -281,30 +285,30 @@ MathJax.Localization.addTranslation("de","TeX",{ // "\\ must be followed by a control sequence", CantUseHash2: - "Ungueltige Verwendung von # in Template von %1", -// "Illegal use of # in template for %1", TODO??>? + "Ung\u00FCltige Verwendung von # im Template von %1", //TODO not sure about 'im' and 'von'. +// "Illegal use of # in template for %1", SequentialParam: - "Parameter von %1 muessen durch nummeriert sein", + "Parameter von %1 m\u00FCssen durch nummeriert sein", // "Parameters for %1 must be numbered sequentially", MissingReplacementString: - "Ersetzende Zeichenkette fuer Definition von %1 fehlt", -// "Missing replacement string for definition of %1", TODO??? + "Ersetzende Zeichenkette f\u00FCr Definition von %1 fehlt", //TODO not sure about "ersetzen" +// "Missing replacement string for definition of %1", MismatchUseDef: "Verwendung von %1 passt nicht zur Definition", // "Use of %1 doesn't match its definition", RunawayArgument: - "Fehlendes Argument fuer %1?", + "Nichtgeschlossenes Argument f\u00FCr %1?", //TODO not sure about runaway argument, translated as 'not closed', not sure about 'fuer'. // "Runaway argument for %1?" /* verb */ NoClosingDelim: - "Kein schliessender Delimiter fuer %1" -// "Can't find closing delimiter for %1" TODO??? + "Kein schliessender Delimiter f\u00FCr %1" //TODO not sure about Delimiter jargon, not sure about 'fuer' +// "Can't find closing delimiter for %1" } }); diff --git a/unpacked/localization/de/de.js b/unpacked/localization/de/de.js index 446eda8cc..d4d6fec3b 100644 --- a/unpacked/localization/de/de.js +++ b/unpacked/localization/de/de.js @@ -7,8 +7,8 @@ MathJax.Localization.addTranslation("de",null,{ strings: { CookieConfig: - "MathJax hat eine Cookie mit ausf\u00FChrbaren Code gefunden. " + - "Soll dieser Code ausgef\u00FChrt werden?\n\n" + + "MathJax hat eine Cookie mit ausf\u00FC hrbaren Code gefunden. " + + "Soll dieser Code ausgef\u00FC hrt werden?\n\n" + "(Klicken Sie 'Abbrechen' falls Sie das Cookie nicht selber akzeptiert haben.)", // "MathJax has found a user-configuration cookie that includes code to " + // "be run. Do you want to run it?\n\n" + @@ -27,7 +27,7 @@ MathJax.Localization.addTranslation("de",null,{ // "Loading %1", Loading: - "Laden", + "Laden", //TODO could also be "Lade" // "Loading", LoadFailed: @@ -51,7 +51,7 @@ MathJax.Localization.addTranslation("de",null,{ // "Typesetting", MathJaxNotSupported: - "Ihr Webbrowser unterst\u00FCtzt MathJax nicht" + "Ihr Webbrowser unterst\u00FC tzt MathJax nicht" // "Your browser does not support MathJax" } diff --git a/unpacked/localization/de/v1.0-warning.js b/unpacked/localization/de/v1.0-warning.js index cf2526de8..c5f4d5d26 100644 --- a/unpacked/localization/de/v1.0-warning.js +++ b/unpacked/localization/de/v1.0-warning.js @@ -2,9 +2,9 @@ MathJax.Localization.addTranslation("de","v1.0-warning",{ isLoaded: true, strings: { - MissingConfig: - "MathJax laedt keine Standardkonfiguration mehr; " + - "der Author der Seite muss eine Konfigurationsdatei angeben. " + //TODO CHANGE ENGLISH version, too? Simplify in general??? + MissingConfig: //TODO discuss how to get rid of this + "MathJax l\u00E4dt keine Standardkonfiguration mehr; " + + "der Author der Seite muss eine Konfigurationsdatei angeben. " + "Diese Seite nutze die alte Standardkonfiguration %1 " + "und benoetigt ein Update. Siehe auch: %2" // "MathJax no longer loads a default configuration file; " + From cc0d1b7355b6d392b61490769efa3354c832ed4d Mon Sep 17 00:00:00 2001 From: pkra Date: Wed, 10 Apr 2013 15:41:51 -0700 Subject: [PATCH 28/41] more German locale updates --- unpacked/localization/de/FontWarnings.js | 12 +++++----- unpacked/localization/de/MathML.js | 10 ++++---- unpacked/localization/de/MathMenu.js | 8 +++---- unpacked/localization/de/TeX.js | 30 ++++++++++++------------ unpacked/localization/de/de.js | 6 ++--- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/unpacked/localization/de/FontWarnings.js b/unpacked/localization/de/FontWarnings.js index 71f69173a..d4d6bdac0 100644 --- a/unpacked/localization/de/FontWarnings.js +++ b/unpacked/localization/de/FontWarnings.js @@ -14,7 +14,7 @@ MathJax.Localization.addTranslation("de","FontWarnings",{ imageFonts: "MathJax nutzt Bild-Fonts stall lokaler Fonts oder Webfonts. " + "Das Laden dauert l\u00E4nger als erwartet und Drucken wird " + // translated "expected" rather than "usual" - "evtl. nicht in bester Qualit\u00E4 t m\u00F6glich sein.", // translated 'best quality' rather than 'full resolution' + "evtl. nicht in bester Qualit\u00E4t m\u00F6glich sein.", // translated 'best quality' rather than 'full resolution' // "MathJax is using its image fonts rather than local or web-based fonts. "+ // "This will render slower than usual, and the mathematics may not print "+ // "at the full resolution of your printer.", @@ -31,10 +31,10 @@ MathJax.Localization.addTranslation("de","FontWarnings",{ // "may not show up properly, or possibly not at all.", webFonts: - "Die meisten modernen Browser k\u00F6 nnen Fonts aus dem Web laden. "+ - "Um die Qualit\u00E4 t der Mathematik auf dieser Seite zu verbessern, "+ - "sollten Sie ein Update auf eine akt\u00FC lle Version des Browsers vornehmen "+ - "(oder einen akt\u00FC llen Browser installieren).", + "Die meisten modernen Browser k\u00F6nnen Fonts aus dem Web laden. "+ + "Um die Qualit\u00E4t der Mathematik auf dieser Seite zu verbessern, "+ + "sollten Sie ein Update auf eine aktuelle Version des Browsers vornehmen "+ + "(oder einen aktuellen Browser installieren).", // "Most modern browsers allow for fonts to be downloaded over the web. "+ // "Updating to a more recent version of your browser (or changing "+ // "browsers) could improve the quality of the mathematics on this page.", @@ -46,7 +46,7 @@ MathJax.Localization.addTranslation("de","FontWarnings",{ // "Download and install one of those fonts to improve your MathJax experience.", PageDesigned: - "Diese Seite ist optimiert f\u00FC r %1. " + + "Diese Seite ist optimiert f\u00FCr %1. " + "Installieren dieser Fonts wird die Geschwindigkeit verbessern.", //"Installing these fonts will improve speed" // "This page is designed to use the %1. " + // "Download and install those fonts to improve your MathJax experience.", diff --git a/unpacked/localization/de/MathML.js b/unpacked/localization/de/MathML.js index 61edab42a..22735240b 100644 --- a/unpacked/localization/de/MathML.js +++ b/unpacked/localization/de/MathML.js @@ -15,7 +15,7 @@ MathJax.Localization.addTranslation("de","MathML",{ "Falls MathPlayer nicht installiert ist, muss es erst installiert werden.\n"+ "Eventuell blockieren die Sicherheitsoptionen ActiveX; \u00FCberpr\u00FCfen Sie\n"+ "unter 'Internetoptionen' -> 'Sicherheit' -> 'Stufe Anpassen',\n"+ - "ob 'ActiveX aktivieren' und 'Bin\u00E4 r und Skriptverhalten' aktiviert sind.\n\n"+ + "ob ActiveX aktiviert ist.\n\n"+ "Bei der jetzigen Konfiguration wird MathJax nur Fehlermeldungen anzeigen.", // "MathJax was not able to set up MathPlayer.\n\n"+ // "If MathPlayer is not installed, you need to install it first.\n"+ @@ -29,10 +29,10 @@ MathJax.Localization.addTranslation("de","MathML",{ // "typeset mathematics.", CantCreateXMLParser://TODO check name of German Windows settings - "MathJax kann keinen XML-Parser f\u00FC r MathML erzeugen."+ - "\u00DC berpr\u00FC fen Sie die Einstellungen unter "+ - "'Internetoptionen'-> 'Werkzeuge' -> 'Sicherheit' -> 'Anpassen'"+ - "und aktivieren sie 'ActiveX Skripte als sicher einstufen'.\n\n"+ + "MathJax kann keinen XML-Parser f\u00FC r MathML erzeugen. "+ + "\u00DC berpr\u00FC fen Sie die Einstellungen unter\n"+ + "'Internetoptionen'-> 'Werkzeuge' -> 'Sicherheit' -> 'Stufe Anpassen'\n"+ + "und aktivieren sie ActiveX.\n\n"+ "MathJax kann sonst kein MathML verarbeiten." // "MathJax can't create an XML parser for MathML. Check that\n"+ // "the 'Script ActiveX controls marked safe for scripting' security\n"+ diff --git a/unpacked/localization/de/MathMenu.js b/unpacked/localization/de/MathMenu.js index dc1b92e7d..53d2284ae 100644 --- a/unpacked/localization/de/MathMenu.js +++ b/unpacked/localization/de/MathMenu.js @@ -2,14 +2,14 @@ MathJax.Localization.addTranslation("de","MathMenu",{ isLoaded: true, strings: { - Show: "Zeige Mathe als", // "Show Math As", TODO It's weird to have "Math" instead of "equation" "formula" etc but I think we should follow this globally + Show: "Zeige Mathe als", // "Show Math As", TODO It's a bit weird to have "Math" instead of "equation" "formula" etc but if we keep it we should follow this "globally" MathMLcode: "MathML Code", OriginalMathML: "Original MathML", - TeXCommands: "Original TeX", // "TeX Commands", TODO maybe switch English, too? I find that order appealing - AsciiMathInput: "Original AsciiMathML", // "AsciiMathML input", TODO see above + TeXCommands: "Original TeX", // "TeX Commands", + AsciiMathInput: "Original AsciiMathML", // "AsciiMathML input" Original: "Originalform", // "Original Form", TODO What is that referring to? ErrorMessage: "Fehlermeldung", // "Error Message", - texHints: "TeX Tipps in MathML", // "Show TeX hints in MathML", TODO I left out "show" -- seemed redundant & "embed" or "add" is more appropriate. + texHints: "TeX Tipps in MathML", // "Show TeX hints in MathML", TODO I left out "show" -- seemed redundant; "embed" or "add" is more appropriate. Settings: "Einstellungen", // "Math Settings", //TODO I dropped the "Math", is that ok? Should we do this in general? ZoomTrigger: "Zoom ausl\u00F6sen", // "Zoom Trigger", Hover: "Hover", diff --git a/unpacked/localization/de/TeX.js b/unpacked/localization/de/TeX.js index 06eceb35a..5838d6adf 100644 --- a/unpacked/localization/de/TeX.js +++ b/unpacked/localization/de/TeX.js @@ -3,15 +3,15 @@ MathJax.Localization.addTranslation("de","TeX",{ strings: { ExtraOpenMissingClose: - "Zus\u00E4 tzliche offene oder fehlende schliessende Klammer",//TODO maybe 'ueberfluessig' = superfluous is better? or 'zu viele' = too many? + "Zus\u00E4tzliche offene oder fehlende schliessende Klammer",//TODO maybe 'ueberfluessig' = superfluous is better? or 'zu viele' = too many? // "Extra open brace or missing close brace", ExtraCloseMissingOpen: - "Zus\u00E4 tzliche schliessende oder fehlende offene Klammer",//TODO ditto + "Zus\u00E4tzliche schliessende oder fehlende offene Klammer",//TODO ditto // "Extra close brace or missing open brace", MissingLeftExtraRight: - "Fehlendes \\left oder zus\u00E4 tzliches \\right", //TODO ditto + "Fehlendes '\\left' oder zus\u00E4tzliches '\\right'", //TODO ditto // "Missing \\left or extra \\right", MissingScript: @@ -19,11 +19,11 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Missing superscript or subscript argument", ExtraLeftMissingRight: - "Zus\u00E4 tzliches \\left oder fehlendes \\right",//TODO ditto + "Zus\u00E4tzliches '\\left' oder fehlendes '\\right'",//TODO ditto // "Extra \\left or missing \\right", Misplaced: - "%1 falsch plaziert", //TODO not sure about context. + "%1 falsch plaziert", //TODO not sure; context? // "Misplaced %1", MissingOpenForSub: @@ -51,7 +51,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Missing box for %1", MissingCloseBrace: - "Fehlende geschlossene Klammer Missing close brace", + "Fehlende geschlossene Klammer", // "Missing close brace", UndefinedControlSequence: @@ -59,7 +59,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Undefined control sequence %1", DoubleExponent: - "Doppeltes Superskript: verwende Klammern zum Gruppieren", + "Doppeltes Superskript: verwende Klammern zum Gruppieren", //TODO I used "use braces to group" // "Double exponent: use braces to clarify", DoubleSubscripts: @@ -75,7 +75,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "You can't use 'macro parameter character #' in math mode", MisplacedMiddle: - "%1 muss zwischen \\left und \\right stehen", + "%1 muss zwischen '\\left' und '\\right' stehen", // "%1 must be within \\left and \\right", MisplacedLimits: @@ -87,7 +87,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "%1 can appear only within a root", MultipleCommand: - "Zu viele %1",//TODO need context. I translated as "too many" + "Zu viele %1",//TODO need context. I translated this as "too many" // "Multiple %1", IntegerArg: @@ -123,7 +123,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Missing argument for %1", ExtraAlignTab: - "Zus\u00E4tzliches & im \\cases Text",//TODO not sure about German TeX jargon, but & might be clearer? Maybe switch to 'zu viele // too many' instead of extra. + "Zus\u00E4tzliches & im '\\cases' Text",//TODO not sure about German TeX jargon, but & might be clearer? Maybe switch to 'zu viele // too many' instead of extra. // "Extra alignment tab in \\cases text", BracketMustBeDimension: @@ -171,7 +171,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Illegal macro parameter reference", MaxBufferSize: - "Interner Puffergr\u00F6\u00DFe \u00FC berschritten; wird ein rekursiver Makroaufruf verwendet?", // TODO not sure about buffer/puffer, macro call/makroaufruf + "Interner Puffergr\u00F6\u00DFe \u00FCberschritten; wird ein rekursiver Makroaufruf verwendet?", // TODO not sure about buffer/puffer, macro call/makroaufruf // "MathJax internal buffer size exceeded; is there a recursive macro call?", /* AMSmath */ @@ -193,7 +193,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Illegal alignment specified in %1", ? BadMathStyleFor: - "Schlechter math style: %1", //TODO not sure about math style. + "Schlechtes 'math style' Argument: %1", //TODO not sure about math style. // "Bad math style for %1", PositiveIntegerArg: @@ -225,7 +225,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Extra %1 or missing \\begingroup", GlobalNotFollowedBy: - "%1 nicht von \\let, \\def oder \\newcommand gefolgt", + "%1 nicht von '\\let', '\\def' oder '\\newcommand' gefolgt", // "%1 not followed by \\let, \\def, or \\newcommand", /* color */ @@ -235,7 +235,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Color model '%1' not defined", ModelArg1: - "Farbwerte f\u00FCr Farbmodell %1 ben\u00F6tigen 3 Werte", + "Farbwerte f\u00FCr Farbmodell '%1' ben\u00F6tigen 3 Werte", // "Color values for the %1 model require 3 numbers", // *NEW* InvalidDecimalNumber: @@ -243,7 +243,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Invalid decimal number", ModelArg2: - "Farbwerte f\u00FCr Farbmodell %1 m\u00FCssen zwischen %2 und %3 liegen", + "Farbwerte f\u00FCr Farbmodell '%1' m\u00FCssen zwischen %2 und %3 liegen", // Color values for the %1 model must be between %2 and %3", // *NEW* InvalidNumber: diff --git a/unpacked/localization/de/de.js b/unpacked/localization/de/de.js index d4d6fec3b..c0bf0069a 100644 --- a/unpacked/localization/de/de.js +++ b/unpacked/localization/de/de.js @@ -7,8 +7,8 @@ MathJax.Localization.addTranslation("de",null,{ strings: { CookieConfig: - "MathJax hat eine Cookie mit ausf\u00FC hrbaren Code gefunden. " + - "Soll dieser Code ausgef\u00FC hrt werden?\n\n" + + "MathJax hat eine Cookie mit ausf\u00FChrbaren Code gefunden. " + + "Soll dieser Code ausgef\u00FChrt werden?\n\n" + "(Klicken Sie 'Abbrechen' falls Sie das Cookie nicht selber akzeptiert haben.)", // "MathJax has found a user-configuration cookie that includes code to " + // "be run. Do you want to run it?\n\n" + @@ -51,7 +51,7 @@ MathJax.Localization.addTranslation("de",null,{ // "Typesetting", MathJaxNotSupported: - "Ihr Webbrowser unterst\u00FC tzt MathJax nicht" + "Ihr Webbrowser unterst\u00FCtzt MathJax nicht" // "Your browser does not support MathJax" } From 492f4cd53d0c7de9f37e72cb792f69855c619eca Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 16 Apr 2013 19:24:08 -0400 Subject: [PATCH 29/41] Fix typo in IE warning message. Resolves issue #397. --- unpacked/extensions/MathMenu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index 293559d11..328aa5583 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -27,7 +27,7 @@ */ (function (HUB,HTML,AJAX,CALLBACK,OUTPUT) { - var VERSION = "2.1.1"; + var VERSION = "2.1.2"; var SIGNAL = MathJax.Callback.Signal("menu") // signal for menu events @@ -874,7 +874,7 @@ MSIE: ["MSIESVGWarning", "SVG is not implemented in Internet Explorer prior to " + "IE9 or when it is emulating IE8 or below. " + - "Switching to SVG output will cause the mathemtics to " + + "Switching to SVG output will cause the mathematics to " + "not display properly."] } }; From b14224d7c47abaf3ffacc8b5f25f82946830cdbf Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 16 Apr 2013 19:25:53 -0400 Subject: [PATCH 30/41] Fix typo in IE warning message (in English and German language files as well). Resolves issue #397. --- unpacked/localization/de/MathMenu.js | 2 +- unpacked/localization/en/MathMenu.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unpacked/localization/de/MathMenu.js b/unpacked/localization/de/MathMenu.js index 53d2284ae..018e0475b 100644 --- a/unpacked/localization/de/MathMenu.js +++ b/unpacked/localization/de/MathMenu.js @@ -93,7 +93,7 @@ MathJax.Localization.addTranslation("de","MathMenu",{ "SVG-Ausgabe wird die Mathematik nicht richtig dargestellt.", // "SVG is not implemented in Internet Explorer prior to " + // "IE9 or when it is emulating IE8 or below. " + -// "Switching to SVG output will cause the mathemtics to " + TODO TYPO IN ENGLISH +// "Switching to SVG output will cause the mathematics to " // "not display properly.", LoadURL: diff --git a/unpacked/localization/en/MathMenu.js b/unpacked/localization/en/MathMenu.js index 2ec01dfa8..8ab65c03a 100644 --- a/unpacked/localization/en/MathMenu.js +++ b/unpacked/localization/en/MathMenu.js @@ -79,7 +79,7 @@ MathJax.Localization.addTranslation("en","MathMenu",{ MSIESVGWarning: "SVG is not implemented in Internet Explorer prior to " + "IE9 or when it is emulating IE8 or below. " + - "Switching to SVG output will cause the mathemtics to " + + "Switching to SVG output will cause the mathematics to " + "not display properly.", LoadURL: From 028a2dd82de11479e8ff490fdb20967377d4b97f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 19 Apr 2013 14:04:31 +0200 Subject: [PATCH 31/41] Translate more French strings and escape the non-ASCII chars. --- unpacked/localization/fr/FontWarnings.js | 50 +++++----- unpacked/localization/fr/HTML-CSS.js | 10 +- unpacked/localization/fr/MathML.js | 30 +++--- unpacked/localization/fr/MathMenu.js | 64 ++++++------- unpacked/localization/fr/TeX.js | 112 +++++++++++------------ unpacked/localization/fr/fr.js | 16 ++-- unpacked/localization/fr/v1.0-warning.js | 8 +- 7 files changed, 145 insertions(+), 145 deletions(-) diff --git a/unpacked/localization/fr/FontWarnings.js b/unpacked/localization/fr/FontWarnings.js index 250826b01..3df03988f 100644 --- a/unpacked/localization/fr/FontWarnings.js +++ b/unpacked/localization/fr/FontWarnings.js @@ -4,47 +4,47 @@ MathJax.Localization.addTranslation("fr","FontWarnings",{ webFont: "MathJax utilise les polices Web pour afficher les expressions " + - "mathématiques sur cette page. Celles-ci mettent du temps à être "+ - "téléchargées et la page serait affichée plus rapidement si vous "+ - "installiez les polices mathématiques directement dans le dossier "+ - "des polices de votre système.", + "math\u00E9matiques sur cette page. Celles-ci mettent du temps \u00E0 \u00EAtre "+ + "t\u00E9l\u00E9charg\u00E9es et la page serait affich\u00E9e plus rapidement si vous "+ + "installiez les polices math\u00E9matiques directement dans le dossier "+ + "des polices de votre syst\u00E8me.", imageFonts: - "MathJax utilise des images de caractères plutôt que les polices "+ + "MathJax utilise des images de caract\u00E8res plutôt que les polices "+ "Web ou locales. Ceci rend le rendu plus lent que la normale et "+ - "les expressions mathématiques peuvent ne pas s'imprimer à la "+ - "résolution maximale de votre imprimante", + "les expressions math\u00E9matiques peuvent ne pas s'imprimer \u00E0 la "+ + "r\u00E9solution maximale de votre imprimante", noFonts: - "MathJax n'est pas parvenu à localiser une police pour afficher "+ - "les expressions mathématiques et les images de caractères ne "+ + "MathJax n'est pas parvenu \u00E0 localiser une police pour afficher "+ + "les expressions math\u00E9matiques et les images de caract\u00E8res ne "+ "sont pas disponibles. Comme solution de dernier recours, il "+ - "utilise des caractères Unicode génériques en espérant que votre "+ + "utilise des caract\u00E8res Unicode g\u00E9n\u00E9riques en esp\u00E9rant que votre "+ "navigateur sera capable de les afficher. Certains pourront "+ - "être rendus de façon incorrect voire pas du tout.", + "\u00EAtre rendus de fa\u00E7on incorrect voire pas du tout.", webFonts: - "La plupart des navigateurs modernes permettent de télécharger "+ - "des polices à partir du Web. En mettant à jour votre navigateur "+ - "vers une version plus récente (ou en changeant de navigateur) "+ - "la qualité des expressions mathématiques sur cette page pourrait "+ - "être améliorée.", + "La plupart des navigateurs modernes permettent de t\u00E9l\u00E9charger "+ + "des polices \u00E0 partir du Web. En mettant \u00E0 jour votre navigateur "+ + "vers une version plus r\u00E9cente (ou en changeant de navigateur) "+ + "la qualit\u00E9 des expressions math\u00E9matiques sur cette page pourrait "+ + "\u00EAtre am\u00E9lior\u00E9e.", fonts: "MathJax peut utiliser les [Polices STIX](%1) ou bien les " + - "[Polices TeX de MathJax](%2). Téléchargez et installez " + - "l'une de ces familles de polices pour améliorer votre "+ - "expérience avec MathJax.", + "[Polices TeX de MathJax](%2). T\u00E9l\u00E9chargez et installez " + + "l'une de ces familles de polices pour am\u00E9liorer votre "+ + "exp\u00E9rience avec MathJax.", TeXPage: - "Cette page est conçue pour utiliser les [Polices STIX](%1). " + - "Téléchargez et installez ces polices pour améliorer votre " + - "expérience avec MathJax", + "Cette page est con\u00E7ue pour utiliser les [Polices STIX](%1). " + + "T\u00E9l\u00E9chargez et installez ces polices pour am\u00E9liorer votre " + + "exp\u00E9rience avec MathJax", TeXPage: - "Cette page est conçue pour utiliser les [Polices TeX de MathJax](%1). " + - "Téléchargez et installez ces polices pour améliorer votre " + - "expérience avec MathJax" + "Cette page est con\u00E7ue pour utiliser les [Polices TeX de MathJax](%1). " + + "T\u00E9l\u00E9chargez et installez ces polices pour am\u00E9liorer votre " + + "exp\u00E9rience avec MathJax" } }); diff --git a/unpacked/localization/fr/HTML-CSS.js b/unpacked/localization/fr/HTML-CSS.js index 32c7b8cb3..95c976009 100644 --- a/unpacked/localization/fr/HTML-CSS.js +++ b/unpacked/localization/fr/HTML-CSS.js @@ -3,21 +3,21 @@ MathJax.Localization.addTranslation("fr","HTML-CSS",{ strings: { LoadWebFont: - "Téléchargement de la police Web %1", + "T\u00E9l\u00E9chargement de la police Web %1", CantLoadWebFont: - "Impossible de télécharger la police Web %1", + "Impossible de t\u00E9l\u00E9charger la police Web %1", FirefoxCantLoadWebFont: - "Firefox ne peut télécharger les polices Web à partir d'un hôte "+ + "Firefox ne peut t\u00E9l\u00E9charger les polices Web \u00E0 partir d'un hôte "+ "distant", CantFindFontUsing: "Impossible de trouver une police valide en utilisant %1", WebFontsNotAvailable: - "Polices Web non disponibles -- des images de caractères vont être "+ - "utilisées à la place" + "Polices Web non disponibles -- des images de caract\u00E8res vont \u00EAtre "+ + "utilis\u00E9es \u00E0 la place" } }); diff --git a/unpacked/localization/fr/MathML.js b/unpacked/localization/fr/MathML.js index ec5340dfd..288aab653 100644 --- a/unpacked/localization/fr/MathML.js +++ b/unpacked/localization/fr/MathML.js @@ -3,25 +3,25 @@ MathJax.Localization.addTranslation("fr","MathML",{ strings: { BadMglyph: - "Élement mglyph incorrect: %1", + "\u00C9lement mglyph incorrect: %1", BadMglyphFont: - "Police de caractère incorrecte: %1", + "Police de caract\u00E8re incorrecte: %1", MathPlayer: - "MathJax n'est pas parvenu à configurer MathPlayer.\n\n"+ - "Vous devez d'abord installer MathPlayer. Si c'est déjà le cas,\n"+ - "vos paramètres de sécurités peuvent empêcher l'exécution des\n"+ - "contrôles ActiveX. Sélectionnez Options Internet dans le menu\n"+ - "Outils et sélectionnez l'onglet Sécurité. Appuyez ensuite sur\n"+ - "le menu Niveau Personalisé. Assurez vous que les paramètres\n"+ - "Exécution des contrôles ActiveX et Comportements des exécutables\n"+ - "et des scripts sont activés.\n\n"+ - "Actuellement, vous verrez des messages d'erreur à la place des\n"+ - "expressions mathématiques.", + "MathJax n'est pas parvenu \u00E0 configurer MathPlayer.\n\n"+ + "Vous devez d'abord installer MathPlayer. Si c'est d\u00E9j\u00E0 le cas,\n"+ + "vos param\u00E8tres de s\u00E9curit\u00E9s peuvent emp\u00EAcher l'ex\u00E9cution des\n"+ + "contrôles ActiveX. S\u00E9lectionnez Options Internet dans le menu\n"+ + "Outils et s\u00E9lectionnez l'onglet S\u00E9curit\u00E9. Appuyez ensuite sur\n"+ + "le menu Niveau Personalis\u00E9. Assurez vous que les param\u00E8tres\n"+ + "Ex\u00E9cution des contrôles ActiveX et Comportements des ex\u00E9cutables\n"+ + "et des scripts sont activ\u00E9s.\n\n"+ + "Actuellement, vous verrez des messages d'erreur \u00E0 la place des\n"+ + "expressions math\u00E9matiques.", CantCreateXMLParser: - "MathJax ne peut créer un analyseur grammatical XML pour le MathML", + "MathJax ne peut cr\u00E9er un analyseur grammatical XML pour le MathML", UnknownNodeType: "Type de noeud inconnu: %1", @@ -36,10 +36,10 @@ MathJax.Localization.addTranslation("fr","MathML",{ "Erreur lors de l'analyse du code MathML: %1", MathMLSingleElement: - "Le code MathML doit être formé d'un unique élément", + "Le code MathML doit \u00EAtre form\u00E9 d'un unique \u00E9l\u00E9ment", MathMLRootElement: - "Le code MathML doit être formé d'un élément et non d'un élément %1" + "Le code MathML doit \u00EAtre form\u00E9 d'un \u00E9l\u00E9ment et non d'un \u00E9l\u00E9ment %1" } }); diff --git a/unpacked/localization/fr/MathMenu.js b/unpacked/localization/fr/MathMenu.js index 3987359f2..773ff2947 100644 --- a/unpacked/localization/fr/MathMenu.js +++ b/unpacked/localization/fr/MathMenu.js @@ -9,14 +9,14 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ AsciiMathInput: "de code AsciiMathML", Original: "originelle", ErrorMessage: "de message d'erreur", - texHints: "Inclure les données TeX dans le MathML", - Settings: "Paramètres", - ZoomTrigger: "Déclenchement du zoom", + texHints: "Inclure les donn\u00E9es TeX dans le MathML", + Settings: "Param\u00E8tres", + ZoomTrigger: "D\u00E9clenchement du zoom", Hover: "Survol de la souris", Click: "Clic de souris", DoubleClick: "Double-clic", NoZoom: "Pas de zoom", - TriggerRequires: "Le déclenchement nécessite la touche", + TriggerRequires: "Le d\u00E9clenchement n\u00E9cessite la touche", Option: "Option", Alt: "Alt", Command: "Command", @@ -24,11 +24,11 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ Shift: "Shift", ZoomFactor: "Facteur de zoom", Renderer: "Mode de rendu", - MPHandles: "Laissez MathPlayer gérer les", - MenuEvents: "Évènements du menu", - MouseEvents: "Évènements de la souris", - MenuAndMouse: "Évènements de menu et de la souris", - FontPrefs: "Préférences des polices", + MPHandles: "Laissez MathPlayer g\u00E9rer les", + MenuEvents: "\u00C9v\u00E8nements du menu", + MouseEvents: "\u00C9v\u00E8nements de la souris", + MenuAndMouse: "\u00C9v\u00E8nements de menu et de la souris", + FontPrefs: "Pr\u00E9f\u00E9rences des polices", ForHTMLCSS: "Pour le HTML-CSS:", Auto: "Auto", TeXLocal: "TeX (locales)", @@ -37,19 +37,19 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ STIXLocal: "STIX (locales)", ContextMenu: "Menu contextuel", Browser: "Navigateur", - Scale: "Mise à l'échelle ...", + Scale: "Mise \u00E0 l'\u00E9chelle ...", Discoverable: "Mettez en surbrillance lors du survol", Locale: "Langue", - LoadLocale: "Charger à partir de l'URL...", - About: "À propos de MathJax", + LoadLocale: "Charger \u00E0 partir de l'URL...", + About: "\u00C0 propos de MathJax", Help: "Aide MathJax", localTeXfonts: "utilisant les polices TeX locales", webTeXfonts: "utilisant les polices TeX Web", - imagefonts: "utilisant les images de caractères", + imagefonts: "utilisant les images de caract\u00E8res", localSTIXfonts: "utilisant les polices STIX locales", webSVGfonts: "utilisant les polices SVG Web", - genericfonts: "utilisant les polices locales génériques", + genericfonts: "utilisant les polices locales g\u00E9n\u00E9riques", wofforotffonts: "les polices woff ou otf", eotffonts: "les polices eot", @@ -58,59 +58,59 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ WebkitNativeMMLWarning: "Votre navigateur ne semble pas comporter de support MathML, " + "changer le mode de rendu pourrait rendre illisibles " + - "les expressions mathématiques.", + "les expressions math\u00E9matiques.", MSIENativeMMLWarning: - "Internet Explorer a besoin du module complémentaire MathPlayer " + + "Internet Explorer a besoin du module compl\u00E9mentaire MathPlayer " + "pour afficher le MathML.", OperaNativeMMLWarning: - "Le support MathML d'Opera est limité, changer le mode de rendu " + - "pourrait entrainer un affichage médiocre de certaines expressions.", + "Le support MathML d'Opera est limit\u00E9, changer le mode de rendu " + + "pourrait entrainer un affichage m\u00E9diocre de certaines expressions.", SafariNativeMMLWarning: "Le support MathML natif de votre navigateur ne comporte pas " + - "toutes les fonctionnalités requises par MathJax, certaines " + + "toutes les fonctionnalit\u00E9s requises par MathJax, certaines " + "expressions pourront donc ne pas s'afficher correctement.", FirefoxNativeMMLWarning: "Le support MathML natif de votre navigateur ne comporte pas " + - "toutes les fonctionnalités requises par MathJax, certaines " + + "toutes les fonctionnalit\u00E9s requises par MathJax, certaines " + "expressions pourront donc ne pas s'afficher correctement.", LoadURL: - "Charger les données de traduction à partir de cette addresse URL:", + "Charger les donn\u00E9es de traduction \u00E0 partir de cette addresse URL:", BadURL: - "L'adresse URL doit être un fichier Javascript contenant des données de traduction MathJax." + + "L'adresse URL doit \u00EAtre un fichier Javascript contenant des donn\u00E9es de traduction MathJax." + "Les noms de fichier Javascript doivent se terminer par '.js'", BadData: - "Échec du chargement des données de traduction à partir de %1", + "\u00C9chec du chargement des donn\u00E9es de traduction \u00E0 partir de %1", SwitchAnyway: - "Êtes vous certain de vouloir changer le mode de rendu ?\n\n" + + "\u00CAtes vous certain de vouloir changer le mode de rendu ?\n\n" + "Appuyez sur OK pour valider ou Annuler pour continuer avec le " + - "mode de rendu actuellement sélectionné.", + "mode de rendu actuellement s\u00E9lectionn\u00E9.", ScaleMath: - "Mise à l'échelle des expressions mathématiques (par rapport au " + + "Mise \u00E0 l'\u00E9chelle des expressions math\u00E9matiques (par rapport au " + "text environnant) de", NonZeroScale: - "L'échelle ne peut être nulle", + "L'\u00E9chelle ne peut \u00EAtre nulle", PercentScale: - "L'échelle doit être un pourcentage (e.g. 120%%)", + "L'\u00E9chelle doit \u00EAtre un pourcentage (e.g. 120%%)", IE8warning: - "Ceci désactivera le menu de MathJax et les fonctionalités de " + + "Ceci d\u00E9sactivera le menu de MathJax et les fonctionalit\u00E9s de " + "zoom mais vous pourrez toujours obtenir le menu de MathJax " + "en utilisant la commande Alt+Clic sur une expression.\n\n" + - "Êtes vous certain de vouloir choisir les options de MathPlayer?", + "\u00CAtes vous certain de vouloir choisir les options de MathPlayer?", IE9warning: - "Le menu contextuel de MathJax sera désactivé, " + + "Le menu contextuel de MathJax sera d\u00E9sactiv\u00E9, " + "mais vous pourrez toujours obtenir le menu de MathJax " + "en utilisant la commande Alt-Clic sur une expression.", @@ -121,7 +121,7 @@ MathJax.Localization.addTranslation("fr","MathMenu",{ "Fermer", EqSource: - "Source de l'équation MathJax" + "Source de l'\u00E9quation MathJax" } }); diff --git a/unpacked/localization/fr/TeX.js b/unpacked/localization/fr/TeX.js index fbfacab7a..8d19c22d9 100644 --- a/unpacked/localization/fr/TeX.js +++ b/unpacked/localization/fr/TeX.js @@ -3,7 +3,7 @@ MathJax.Localization.addTranslation("fr","TeX",{ strings: { ExtraOpenMissingClose: - "Accolade ouvrant manquante ou accolade fermante non attendue", + "Accolade ouvrante manquante ou accolade fermante non attendue", ExtraCloseMissingOpen: "Accolade fermante non attendue ou accolade ouvrante manquante", @@ -21,16 +21,16 @@ MathJax.Localization.addTranslation("fr","TeX",{ "Mauvaise position pour la commande %1", MissingOpenForSub: - "Missing open brace for subscript", // *NEW* + "Accolade ouvrante manquante pour le script en indice", MissingOpenForSup: - "Missing open brace for superscript", // *NEW* + "Accolade ouvrante manquante pour le script en exposant", AmbiguousUseOf: "Usage ambigu de la commande %1", EnvBadEnd: - "\\begin{%1} s'est terminé par un \\end{%2}", + "\\begin{%1} s'est termin\u00E9 par un \\end{%2}", EnvMissingEnd: "\\end{%1} manquant", @@ -42,13 +42,13 @@ MathJax.Localization.addTranslation("fr","TeX",{ "Accolade fermante manquante", UndefinedControlSequence: - "Commande %1 non définie", + "Commande %1 non d\u00E9finie", IllegalControlSequenceName: - "Nom de contrôle de séquence non autorisé pour la commande %1", + "Nom de contrôle de s\u00E9quence non autoris\u00E9 pour la commande %1", IllegalParamNumber: - "Nombre de paramètres incorrect pour la commande %1", + "Nombre de param\u00E8tres incorrect pour la commande %1", DoubleExponent: "Double exposant: utilisez des accolades pour clarifier", @@ -61,58 +61,58 @@ MathJax.Localization.addTranslation("fr","TeX",{ "des accolades pour clarifier", CantUseHash1: - "Vous ne pouvez pas utilisez le caractère #, indiquant un "+ - "paramètre de macro, dans le mode mathématique", + "Vous ne pouvez pas utilisez le caract\u00E8re #, indiquant un "+ + "param\u00E8tre de macro, dans le mode math\u00E9matique", CantUseHash2: - "Usage du caractère # non autorisé dans le modèle pour la séquence "+ + "Usage du caract\u00E8re # non autoris\u00E9 dans le mod\u00E8le pour la s\u00E9quence "+ "de contrôle %1", MisplacedMiddle: - "La commande %1 doit être placée à l'intérieur d'une section "+ + "La commande %1 doit \u00EAtre plac\u00E9e \u00E0 l'int\u00E9rieur d'une section "+ "\\left ... \right", MisplacedLimits: - "La commande %1 n'est autorisée que sur les opérateurs", + "La commande %1 n'est autoris\u00E9e que sur les op\u00E9rateurs", MisplacedMoveRoot: - "La commande %1 n'est autorisée qu'à l'intérieur d'une racine", + "La commande %1 n'est autoris\u00E9e qu'\u00E0 l'int\u00E9rieur d'une racine", MultipleCommand: "Usage multiple de la commande %1", IntegerArg: - "L'argument de la commande %1 doit être un entier", + "L'argument de la commande %1 doit \u00EAtre un entier", PositiveIntegerArg: - "L'argument de la commande %1 doit être un entier strictement "+ + "L'argument de la commande %1 doit \u00EAtre un entier strictement "+ "positif", NotMathMLToken: - "L'élément %1 n'est pas un élément MathML élémentaire", + "L'\u00E9l\u00E9ment %1 n'est pas un \u00E9l\u00E9ment MathML \u00E9l\u00E9mentaire", InvalidMathMLAttr: "Attribut MathML non valide: %1", UnknownAttrForElement: - "Attribut %1 inconnu pour l'élément %2", + "Attribut %1 inconnu pour l'\u00E9l\u00E9ment %2", 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\u00E9 par MathJax "+ + "a \u00E9t\u00E9 d\u00E9pass\u00E9. Il y a t'il un appel de macro r\u00E9cursif?", 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\u00E9 par MathJax "+ + "a \u00E9t\u00E9 d\u00E9pass\u00E9. Il y a t'il un environnement LaTeX r\u00E9cursif?", MissingArgFor: "Argument manquant pour la commande %1", ExtraAlignTab: - "Caractère d'alignement '&' non attendue pour le texte de la commande \\cases", + "Caract\u00E8re d'alignement '&' non attendue pour le texte de la commande \\cases", BracketMustBeDimension: - "L'argument entre crochets de la commande %1 doit être une dimension", + "L'argument entre crochets de la commande %1 doit \u00EAtre une dimension", InvalidEnv: "Nom d'environnement '%1' non valide", @@ -130,62 +130,62 @@ MathJax.Localization.addTranslation("fr","TeX",{ "Impossible de trouver le crochet fermant pour l'argument de la commande %1", MissingOrUnrecognizedDelim: - "Délimiteur manquant ou non reconnu pour la commande %1", + "D\u00E9limiteur manquant ou non reconnu pour la commande %1", MissingDimOrUnits: - "Dimension ou unité manquante pour la commande %1", + "Dimension ou unit\u00E9 manquante pour la commande %1", TokenNotFoundForCommand: "Impossible de trouver la commande %1 pour la commande %2", MathNotTerminated: - "Expression mathématique non terminée à l'intérieur de cette boite "+ + "Expression math\u00E9matique non termin\u00E9e \u00E0 l'int\u00E9rieur de cette boite "+ "de texte", IllegalMacroParam: - "Paramètre de référence de macro non autorisé", + "Param\u00E8tre de r\u00E9f\u00E9rence de macro non autoris\u00E9", 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\u00E9pass\u00E9e. " + + "Il y a t'il un appel de macro r\u00E9cursif?", CommandNotAllowedInEnv: - "La commande %1 n'est pas autorisé à l'intérieur de "+ + "La commande %1 n'est pas autoris\u00E9 \u00E0 l'int\u00E9rieur de "+ "l'environnement %2", MultipleCommand: "Usage multiple de la commande %1", MultipleLabel: - "Étiquette '%1' déjà définie", + "\u00C9tiquette '%1' d\u00E9j\u00E0 d\u00E9finie", CommandAtTheBeginingOfLine: - "La commande %1 doit être placée en début de ligne", + "La commande %1 doit \u00EAtre plac\u00E9e en d\u00E9but de ligne", IllegalAlign: - "Alignement non autorisé pour la commande %1", + "Alignement non autoris\u00E9 pour la commande %1", BadMathStyleFor: - "Style mathématique non valide pour la commande %1", + "Style math\u00E9matique non valide pour la commande %1", ErroneousNestingEq: - "Emboitement incorrect des structures d'équation", + "Emboitement incorrect des structures d'\u00E9quation", MultlineRowsOneCol: "L'environnement multline doit avoir exactement une colonne", NoClosingDelim: - "Impossible de trouver le délimiteur fermant pour la commande %1", + "Impossible de trouver le d\u00E9limiteur fermant pour la commande %1", NoClosingChar: - "Impossible de trouver le délimiteur '%1' fermant", + "Impossible de trouver le d\u00E9limiteur '%1' fermant", MultipleBBoxProperty: - "La propriété %1 de la commande %2 est spécifiée deux fois", + "La propri\u00E9t\u00E9 %1 de la commande %2 est sp\u00E9cifi\u00E9e deux fois", InvalidBBoxProperty: - "La valeur '%1' ne semble pas être une couleur, une dimension de "+ - "marge intérieur ou un style.", + "La valeur '%1' ne semble pas \u00EAtre une couleur, une dimension de "+ + "marge int\u00E9rieur ou un style.", ExtraEndMissingBegin: "Commande %1 non attendue ou commande \\begingroup manquante", @@ -194,47 +194,47 @@ MathJax.Localization.addTranslation("fr","TeX",{ "Commande %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", + "Le premier argument de la commande %1 doit \u00EAtre le nom d'une "+ + "s\u00E9quence de contrôle", NewextarrowArg2: - "Le second argument de la commande %1 doit être deux entiers "+ - "séparés par une virgule", + "Le second argument de la commande %1 doit \u00EAtre deux entiers "+ + "s\u00E9par\u00E9s par une virgule", NewextarrowArg3: - "Le troisième argument de la commande %1 doit être la valeur d'un "+ - "caractère unicode", + "Le troisi\u00E8me argument de la commande %1 doit \u00EAtre la valeur d'un "+ + "caract\u00E8re unicode", UndefinedColorModel: - "Le modèle de couleur '%1' n'est pas défini", + "Le mod\u00E8le de couleur '%1' n'est pas d\u00E9fini", ModelArg1: - "Color values for the %1 model require 3 numbers", // *NEW* + "Les valeurs de couleurs pour le mod\u00E8le %1 n\u00E9cessitent 3 nombres", InvalidDecimalNumber: - "Nombre décimal non valide", + "Nombre d\u00E9cimal non valide", ModelArg2: - "Color values for the %1 model must be between %2 and %3", // *NEW* + "Les valeurs de couleurs pour le mod\u00E8le %1 doivent \u00EAtre comprises entre %2 et %3", InvalidNumber: "Nombre non valide", DoubleBackSlash: - "\\ doit être suivi d'une séquence de contrôle", + "\\ doit \u00EAtre suivi d'une s\u00E9quence 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", + "Les param\u00E8tres de la s\u00E9quence de contrôle %1 doivent \u00EAtre "+ + "\u00E9num\u00E9r\u00E9s de fa\u00E7on s\u00E9quentielle", MissingReplacementString: - "Chaine de caractère de remplacement manquante pour la définition %1", + "Chaine de caract\u00E8re de remplacement manquante pour la d\u00E9finition %1", MismatchUseDef: - "L'utilisation de la commande %1 ne correspond pas à sa définition", + "L'utilisation de la commande %1 ne correspond pas \u00E0 sa d\u00E9finition", RunawayArgument: - "Argument manquant pour la commande %1?" + "Argument non termin\u00E9 pour la commande %1?" } }); diff --git a/unpacked/localization/fr/fr.js b/unpacked/localization/fr/fr.js index f8c21e277..14f18f241 100644 --- a/unpacked/localization/fr/fr.js +++ b/unpacked/localization/fr/fr.js @@ -7,21 +7,21 @@ MathJax.Localization.addTranslation("fr",null,{ strings: { CookieConfig: - "MathJax a trouvé un cookie de configuration utilisateur qui inclut "+ - "du code exécutable. Souhaitez vous l'exécuter?\n\n"+ - "(Choisissez Annuler sauf si vous avez créé ce cookie vous-même)", + "MathJax a trouv\u00E9 un cookie de configuration utilisateur qui inclut "+ + "du code ex\u00E9cutable. Souhaitez vous l'ex\u00E9cuter?\n\n"+ + "(Choisissez Annuler sauf si vous avez cr\u00E9\u00E9 ce cookie vous-m\u00EAme)", MathProcessingError: - "Erreur de traitement de la formule mathématique", + "Erreur de traitement de la formule math\u00E9matique", MathError: - "Erreur dans la formule mathématique", + "Erreur dans la formule math\u00E9matique", - LoadFile: "Téléchargement de %1", + LoadFile: "T\u00E9l\u00E9chargement de %1", - Loading: "Téléchargement", + Loading: "T\u00E9l\u00E9chargement", - LoadFailed: "Échec du téléchargement de %1", + LoadFailed: "\u00C9chec du t\u00E9l\u00E9chargement de %1", ProcessMath: "Traitement des formules: %1%%", diff --git a/unpacked/localization/fr/v1.0-warning.js b/unpacked/localization/fr/v1.0-warning.js index 8a929a8dc..51eb09d5a 100644 --- a/unpacked/localization/fr/v1.0-warning.js +++ b/unpacked/localization/fr/v1.0-warning.js @@ -3,11 +3,11 @@ MathJax.Localization.addTranslation("fr","v1.0-warning",{ strings: { MissingConfig: - "MathJax ne charge plus de fichier de configuration par défaut; "+ - "vous devez spécifier ces fichiers de façons explicites. Cette "+ + "MathJax ne charge plus de fichier de configuration par d\u00E9faut; "+ + "vous devez sp\u00E9cifier ces fichiers de fa\u00E7ons explicites. Cette "+ "page semble utiliser l'ancien fichier de configuration par "+ - "défaut %1 et doit donc être mise à jour. Ceci est expliqué "+ - "en détails à l'addresse suivante: %2" + "d\u00E9faut %1 et doit donc \u00EAtre mise \u00E0 jour. Ceci est expliqu\u00E9 "+ + "en d\u00E9tails \u00E0 l'addresse suivante: %2" } }); From ba574e6c2a0de7a9a8a0ef1fe2bef537193e48fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 19 Apr 2013 14:29:02 +0200 Subject: [PATCH 32/41] =?UTF-8?q?Escape=20the=20=C3=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unpacked/localization/fr/FontWarnings.js | 2 +- unpacked/localization/fr/HTML-CSS.js | 2 +- unpacked/localization/fr/MathML.js | 4 ++-- unpacked/localization/fr/TeX.js | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/unpacked/localization/fr/FontWarnings.js b/unpacked/localization/fr/FontWarnings.js index 3df03988f..4b11b80bc 100644 --- a/unpacked/localization/fr/FontWarnings.js +++ b/unpacked/localization/fr/FontWarnings.js @@ -10,7 +10,7 @@ MathJax.Localization.addTranslation("fr","FontWarnings",{ "des polices de votre syst\u00E8me.", imageFonts: - "MathJax utilise des images de caract\u00E8res plutôt que les polices "+ + "MathJax utilise des images de caract\u00E8res plut\u00F4t que les polices "+ "Web ou locales. Ceci rend le rendu plus lent que la normale et "+ "les expressions math\u00E9matiques peuvent ne pas s'imprimer \u00E0 la "+ "r\u00E9solution maximale de votre imprimante", diff --git a/unpacked/localization/fr/HTML-CSS.js b/unpacked/localization/fr/HTML-CSS.js index 95c976009..5e6040c94 100644 --- a/unpacked/localization/fr/HTML-CSS.js +++ b/unpacked/localization/fr/HTML-CSS.js @@ -9,7 +9,7 @@ MathJax.Localization.addTranslation("fr","HTML-CSS",{ "Impossible de t\u00E9l\u00E9charger la police Web %1", FirefoxCantLoadWebFont: - "Firefox ne peut t\u00E9l\u00E9charger les polices Web \u00E0 partir d'un hôte "+ + "Firefox ne peut t\u00E9l\u00E9charger les polices Web \u00E0 partir d'un h\u00F4te "+ "distant", CantFindFontUsing: diff --git a/unpacked/localization/fr/MathML.js b/unpacked/localization/fr/MathML.js index 288aab653..751e176cb 100644 --- a/unpacked/localization/fr/MathML.js +++ b/unpacked/localization/fr/MathML.js @@ -12,10 +12,10 @@ MathJax.Localization.addTranslation("fr","MathML",{ "MathJax n'est pas parvenu \u00E0 configurer MathPlayer.\n\n"+ "Vous devez d'abord installer MathPlayer. Si c'est d\u00E9j\u00E0 le cas,\n"+ "vos param\u00E8tres de s\u00E9curit\u00E9s peuvent emp\u00EAcher l'ex\u00E9cution des\n"+ - "contrôles ActiveX. S\u00E9lectionnez Options Internet dans le menu\n"+ + "contr\u00F4les ActiveX. S\u00E9lectionnez Options Internet dans le menu\n"+ "Outils et s\u00E9lectionnez l'onglet S\u00E9curit\u00E9. Appuyez ensuite sur\n"+ "le menu Niveau Personalis\u00E9. Assurez vous que les param\u00E8tres\n"+ - "Ex\u00E9cution des contrôles ActiveX et Comportements des ex\u00E9cutables\n"+ + "Ex\u00E9cution des contr\u00F4les ActiveX et Comportements des ex\u00E9cutables\n"+ "et des scripts sont activ\u00E9s.\n\n"+ "Actuellement, vous verrez des messages d'erreur \u00E0 la place des\n"+ "expressions math\u00E9matiques.", diff --git a/unpacked/localization/fr/TeX.js b/unpacked/localization/fr/TeX.js index 8d19c22d9..9d656d2a6 100644 --- a/unpacked/localization/fr/TeX.js +++ b/unpacked/localization/fr/TeX.js @@ -45,7 +45,7 @@ MathJax.Localization.addTranslation("fr","TeX",{ "Commande %1 non d\u00E9finie", IllegalControlSequenceName: - "Nom de contrôle de s\u00E9quence non autoris\u00E9 pour la commande %1", + "Nom de contr\u00F4le de s\u00E9quence non autoris\u00E9 pour la commande %1", IllegalParamNumber: "Nombre de param\u00E8tres incorrect pour la commande %1", @@ -66,7 +66,7 @@ MathJax.Localization.addTranslation("fr","TeX",{ CantUseHash2: "Usage du caract\u00E8re # non autoris\u00E9 dans le mod\u00E8le pour la s\u00E9quence "+ - "de contrôle %1", + "de contr\u00F4le %1", MisplacedMiddle: "La commande %1 doit \u00EAtre plac\u00E9e \u00E0 l'int\u00E9rieur d'une section "+ @@ -195,7 +195,7 @@ MathJax.Localization.addTranslation("fr","TeX",{ NewextarrowArg1: "Le premier argument de la commande %1 doit \u00EAtre le nom d'une "+ - "s\u00E9quence de contrôle", + "s\u00E9quence de contr\u00F4le", NewextarrowArg2: "Le second argument de la commande %1 doit \u00EAtre deux entiers "+ @@ -221,10 +221,10 @@ MathJax.Localization.addTranslation("fr","TeX",{ "Nombre non valide", DoubleBackSlash: - "\\ doit \u00EAtre suivi d'une s\u00E9quence de contrôle", + "\\ doit \u00EAtre suivi d'une s\u00E9quence de contr\u00F4le", SequentialParam: - "Les param\u00E8tres de la s\u00E9quence de contrôle %1 doivent \u00EAtre "+ + "Les param\u00E8tres de la s\u00E9quence de contr\u00F4le %1 doivent \u00EAtre "+ "\u00E9num\u00E9r\u00E9s de fa\u00E7on s\u00E9quentielle", MissingReplacementString: From f04a2e3037befdcbc476aab1f914ae1fc7587736 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 20 Apr 2013 16:35:52 -0400 Subject: [PATCH 33/41] Change URL for MathJax font download to point ot GitHub. --- unpacked/extensions/FontWarnings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unpacked/extensions/FontWarnings.js b/unpacked/extensions/FontWarnings.js index 628684193..37cec70d7 100644 --- a/unpacked/extensions/FontWarnings.js +++ b/unpacked/extensions/FontWarnings.js @@ -86,10 +86,10 @@ */ (function (HUB,HTML) { - var VERSION = "2.1.1"; + var VERSION = "2.1.2"; var STIXURL = "http://www.stixfonts.org/"; - var MATHJAXURL = "http://www.mathjax.org/help-v2/fonts"; + var MATHJAXURL = "https://github.com/mathjax/MathJax/tree/master/fonts/HTML-CSS/TeX/otf"; var CONFIG = HUB.CombineConfig("FontWarnings",{ // From 3901529db9fd1c08ba8950ab851ea32e69599c2b Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 22 Apr 2013 13:18:58 -0400 Subject: [PATCH 34/41] Add Help dialog box (rather than link to a site). Fix Markdown to substitue values for URL's in links. --- unpacked/MathJax.js | 4 +- unpacked/extensions/HelpDialog.js | 151 +++++++++++++++++++++++++ unpacked/extensions/MathMenu.js | 11 +- unpacked/localization/de/HelpDialog.js | 47 ++++++++ unpacked/localization/en/HelpDialog.js | 47 ++++++++ unpacked/localization/fr/HelpDialog.js | 47 ++++++++ 6 files changed, 298 insertions(+), 9 deletions(-) create mode 100644 unpacked/extensions/HelpDialog.js create mode 100644 unpacked/localization/de/HelpDialog.js create mode 100644 unpacked/localization/en/HelpDialog.js create mode 100644 unpacked/localization/fr/HelpDialog.js diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 5f86c88cf..f2ff558f0 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -730,7 +730,7 @@ MathJax.fileversion = "2.1.2"; script: script }; // Add this to the structure above after it is created to prevent recursion - // when loading the initial localiation file (before loading messsage is available) + // when loading the initial localization file (before loading messsage is available) this.loading[file].message = BASE.Message.File(file); script.onerror = timeout; // doesn't work in IE and no apparent substitute script.type = "text/javascript"; @@ -1215,7 +1215,7 @@ MathJax.Localization = { // data = this.processString(parts[i+5],args,domain); if (!(data instanceof Array)) {data = [data]} - data = ["a",{href:parts[i+6],target:"_blank"},data]; + data = ["a",{href:this.processString(parts[i+6],args),target:"_blank"},data]; } else { // // Escaped character (%c) gets added into the string. diff --git a/unpacked/extensions/HelpDialog.js b/unpacked/extensions/HelpDialog.js new file mode 100644 index 000000000..521a6a35f --- /dev/null +++ b/unpacked/extensions/HelpDialog.js @@ -0,0 +1,151 @@ +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ + +/************************************************************* + * + * MathJax/extensions/HelpDialog.js + * + * Implements the MathJax Help dialog box. + * + * --------------------------------------------------------------------- + * + * Copyright (c) 2013 Design Science, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +(function (HUB,HTML,AJAX,OUTPUT) { + + var HELP = MathJax.Extension.Help = { + version: "2.1" + }; + + var STIXURL = "http://www.stixfonts.org/"; + var MENU = MathJax.Menu; + + var CONFIG = HUB.CombineConfig("HelpDialog",{ + closeImg: AJAX.fileURL(OUTPUT.imageDir+"/CloseX-31.png"), // image for close "X" for mobiles + + styles: { + "#MathJax_Help": { + position:"fixed", left:"50%", width:"auto", "max-width": "90%", "text-align":"center", + border:"3px outset", padding:"1em 2em", "background-color":"#DDDDDD", color:"black", + cursor: "default", "font-family":"message-box", "font-size":"120%", + "font-style":"normal", "text-indent":0, "text-transform":"none", + "line-height":"normal", "letter-spacing":"normal", "word-spacing":"normal", + "word-wrap":"normal", "white-space":"wrap", "float":"none", "z-index":201, + + "border-radius": "15px", // Opera 10.5 and IE9 + "-webkit-border-radius": "15px", // Safari and Chrome + "-moz-border-radius": "15px", // Firefox + "-khtml-border-radius": "15px", // Konqueror + + "box-shadow":"0px 10px 20px #808080", // Opera 10.5 and IE9 + "-webkit-box-shadow":"0px 10px 20px #808080", // Safari 3 and Chrome + "-moz-box-shadow":"0px 10px 20px #808080", // Forefox 3.5 + "-khtml-box-shadow":"0px 10px 20px #808080", // Konqueror + filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')" // IE + }, + + "#MathJax_HelpContent": { + overflow:"auto", "text-align":"left", "font-size":"80%", + padding:".4em .6em", border:"1px inset", margin:"1em 0px", + "max-height":"20em", "max-width":"30em", "background-color":"#EEEEEE" + } + } + }); + + /* + * Handle the Help Dialog box + */ + HELP.Dialog = function () { + this.div = MENU.Background(this); + var help = HTML.addElement(this.div,"div",{ + id: "MathJax_Help" + },MathJax.Localization._("HelpDialog",[ + ["b",{style:{fontSize:"120%"}},[["Help","MathJax Help"]]], + ["div",{id: "MathJax_HelpContent"},[ + ["p",{},[["MathJax", + "*MathJax* is a JavaScript library that allows page authors to include " + + "mathematics within their web pages. As a reader, you don't need to do " + + "anything to make that happen."]] + ], + ["p",{},[["Browsers", + "*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " + + "Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers."]] + ], + ["p",{},[["Menu", + "*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " + + "CTRL-click on any mathematics to access the menu."]] + ], + ["div",{style:{"margin-left":"1em"}},[ + ["p",{},[["ShowMath", + "*Show Math As* allows you to view the formula's source markup " + + "for copy & paste (as MathML or in its origianl format)."]] + ], + ["p",{},[["Settings", + "*Settings* gives you control over features of MathJax, such as the " + + "size of the mathematics, and the mechanism used to display equations."]] + ], + ["p",{},[["Language", + "*Language* lets you select the language used by MathJax for its menus " + + "and warning messages."]] + ], + ]], + ["p",{},[["Zoom", + "*Math Zoom*: If you are having difficulty reading an equation, MathJax can " + + "enlarge it to help you see it better."]] + ], + ["p",{},[["Accessibilty", + "*Accessibility*: MathJax will automatically work with screen readers to make " + + "mathematics accessible to the visually impaired."]] + ], + ["p",{},[["Fonts", + "*Fonts*: MathJax will use certain math fonts if they are installed on your " + + "computer; otherwise, it will use web-based fonts. Although not required, " + + "locally installed fonts will speed up typesetting. We suggest installing " + + "the [STIX fonts](%1).",STIXURL]] + ] + ]], + ["a",{href:"http://www.mathjax.org/"},["www.mathjax.org"]], + ["img", { + src: CONFIG.closeImg, + style: {width:"21px", height:"21px", position:"absolute", top:".2em", right:".2em"}, + onclick: HELP.Remove + }] + ])); + MathJax.Localization.setCSS(help); + var doc = (document.documentElement||{}); + var H = window.innerHeight || doc.clientHeight || doc.scrollHeight || 0; + if (MENU.prototype.msieAboutBug) { + help.style.width = "20em"; help.style.position = "absolute"; + help.style.left = Math.floor((document.documentElement.scrollWidth - help.offsetWidth)/2)+"px"; + help.style.top = (Math.floor((H-help.offsetHeight)/3)+document.body.scrollTop)+"px"; + } else { + help.style.marginLeft = Math.floor(-help.offsetWidth/2)+"px"; + help.style.top = Math.floor((H-help.offsetHeight)/3)+"px"; + } + }; + HELP.Remove = function (event) { + if (HELP.div) {document.body.removeChild(HELP.div); delete HELP.div} + }; + + MathJax.Callback.Queue( + HUB.Register.StartupHook("End Config",{}), // wait until config is complete + ["Styles",AJAX,CONFIG.styles], + ["loadDomain",MathJax.Localization,"HelpDialog"], + ["Post",HUB.Startup.signal,"HelpDialig Ready"], + ["loadComplete",AJAX,"[MathJax]/extensions/HelpDialog.js"] + ); + +})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.OutputJax); diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index 328aa5583..ca04b1f42 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -48,7 +48,6 @@ var CONFIG = HUB.CombineConfig("MathMenu",{ delay: 150, // the delay for submenus - helpURL: "http://www.mathjax.org/help-v2/user/", // the URL for the "MathJax Help" menu closeImg: AJAX.fileURL(OUTPUT.imageDir+"/CloseX-31.png"), // image for close "X" for mobiles showRenderer: true, // show the "Math Renderer" menu? @@ -331,12 +330,12 @@ var div = HTML.addElement(document.body,"div",{style:this.BGSTYLE, id:"MathJax_MenuFrame"}, [["div",{style: this.BGSTYLE, menuItem: menu, onmousedown: this.Remove}]]); var bg = div.firstChild; - if (menu.msieBackgroundBug) { + if (MENU.msieBackgroundBug) { // MSIE doesn't allow transparent background to be hit boxes, so // fake it using opacity with solid background color bg.style.backgroundColor = "white"; bg.style.filter = "alpha(opacity=0)"; } - if (menu.msieFixedPositionBug) { + if (MENU.msieFixedPositionBug) { // MSIE can't do fixed position, so use a full-sized background // and an onresize handler to update it (stupid, but necessary) div.width = div.height = 0; this.Resize(); @@ -615,9 +614,6 @@ /* * Handle the ABOUT box */ - // Localization: need to be reorganized. currently, there are concatenation - // of HTMLCSS.fontInUse and English strings based on the values of - // HTMLCSS.webFonts and HTMLCSS.imgFonts, HTMLCSS.allowWebFonts etc MENU.About = function () { var HTMLCSS = OUTPUT["HTML-CSS"] || {}; var font = @@ -687,7 +683,8 @@ * Handle the MathJax HELP menu */ MENU.Help = function () { - window.open(CONFIG.helpURL,"MathJaxHelp"); + AJAX.Require("[MathJax]/extensions/HelpDialog.js", + function () {MathJax.Extension.Help.Dialog()}); }; /* diff --git a/unpacked/localization/de/HelpDialog.js b/unpacked/localization/de/HelpDialog.js new file mode 100644 index 000000000..a1049f06f --- /dev/null +++ b/unpacked/localization/de/HelpDialog.js @@ -0,0 +1,47 @@ +MathJax.Localization.addTranslation("de","HelpDialog",{ + isLoaded: true, + strings: { + + MathJax: + "*MathJax* is a JavaScript library that allows page authors to include " + + "mathematics within their web pages. As a reader, you don't need to do " + + "anything to make that happen.", + + Browsers: + "*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " + + "Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers.", + + Menu: + "*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " + + "CTRL-click on any mathematics to access the menu.", + + ShowMath: + "*Show Math As* allows you to view the formula's source markup " + + "for copy & paste (as MathML or in its origianl format).", + + Settings: + "*Settings* gives you control over features of MathJax, such as the " + + "size of the mathematics, and the mechanism used to display equations.", + + Language: + "*Language* lets you select the language used by MathJax for its menus " + + "and warning messages.", + + Zoom: + "*Math Zoom*: If you are having difficulty reading an equation, MathJax can " + + "enlarge it to help you see it better.", + + Accessibilty: + "*Accessibility*: MathJax will automatically work with screen readers to make " + + "mathematics accessible to the visually impaired.", + + Fonts: + "*Fonts*: MathJax will use certain math fonts if they are installed on your " + + "computer; otherwise, it will use web-based fonts. Although not required, " + + "locally installed fonts will speed up typesetting. We suggest installing " + + "the [STIX fonts](%1)." + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/de/HelpDialog.js"); diff --git a/unpacked/localization/en/HelpDialog.js b/unpacked/localization/en/HelpDialog.js new file mode 100644 index 000000000..51636ff44 --- /dev/null +++ b/unpacked/localization/en/HelpDialog.js @@ -0,0 +1,47 @@ +MathJax.Localization.addTranslation("en","HelpDialog",{ + isLoaded: true, + strings: { + + MathJax: + "*MathJax* is a JavaScript library that allows page authors to include " + + "mathematics within their web pages. As a reader, you don't need to do " + + "anything to make that happen.", + + Browsers: + "*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " + + "Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers.", + + Menu: + "*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " + + "CTRL-click on any mathematics to access the menu.", + + ShowMath: + "*Show Math As* allows you to view the formula's source markup " + + "for copy & paste (as MathML or in its origianl format).", + + Settings: + "*Settings* gives you control over features of MathJax, such as the " + + "size of the mathematics, and the mechanism used to display equations.", + + Language: + "*Language* lets you select the language used by MathJax for its menus " + + "and warning messages.", + + Zoom: + "*Math Zoom*: If you are having difficulty reading an equation, MathJax can " + + "enlarge it to help you see it better.", + + Accessibilty: + "*Accessibility*: MathJax will automatically work with screen readers to make " + + "mathematics accessible to the visually impaired.", + + Fonts: + "*Fonts*: MathJax will use certain math fonts if they are installed on your " + + "computer; otherwise, it will use web-based fonts. Although not required, " + + "locally installed fonts will speed up typesetting. We suggest installing " + + "the [STIX fonts](%1)." + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/en/HelpDialog.js"); diff --git a/unpacked/localization/fr/HelpDialog.js b/unpacked/localization/fr/HelpDialog.js new file mode 100644 index 000000000..9f6ea5882 --- /dev/null +++ b/unpacked/localization/fr/HelpDialog.js @@ -0,0 +1,47 @@ +MathJax.Localization.addTranslation("fr","HelpDialog",{ + isLoaded: true, + strings: { + + MathJax: + "*MathJax* is a JavaScript library that allows page authors to include " + + "mathematics within their web pages. As a reader, you don't need to do " + + "anything to make that happen.", + + Browsers: + "*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " + + "Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers.", + + Menu: + "*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " + + "CTRL-click on any mathematics to access the menu.", + + ShowMath: + "*Show Math As* allows you to view the formula's source markup " + + "for copy & paste (as MathML or in its origianl format).", + + Settings: + "*Settings* gives you control over features of MathJax, such as the " + + "size of the mathematics, and the mechanism used to display equations.", + + Language: + "*Language* lets you select the language used by MathJax for its menus " + + "and warning messages.", + + Zoom: + "*Math Zoom*: If you are having difficulty reading an equation, MathJax can " + + "enlarge it to help you see it better.", + + Accessibilty: + "*Accessibility*: MathJax will automatically work with screen readers to make " + + "mathematics accessible to the visually impaired.", + + Fonts: + "*Fonts*: MathJax will use certain math fonts if they are installed on your " + + "computer; otherwise, it will use web-based fonts. Although not required, " + + "locally installed fonts will speed up typesetting. We suggest installing " + + "the [STIX fonts](%1)." + + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/localization/fr/HelpDialog.js"); From 7214be5ff1917a3286845d880796cd82539130e5 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 22 Apr 2013 13:27:39 -0400 Subject: [PATCH 35/41] Add HelpDialog to the list of domains for the three languages, and make sure that the domain file is loaded (even if the language is changed after the help dialog has been viewed in another language). --- unpacked/extensions/HelpDialog.js | 13 ++++++++----- unpacked/localization/de/de.js | 1 + unpacked/localization/en/en.js | 1 + unpacked/localization/fr/fr.js | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/unpacked/extensions/HelpDialog.js b/unpacked/extensions/HelpDialog.js index 521a6a35f..7d92bd287 100644 --- a/unpacked/extensions/HelpDialog.js +++ b/unpacked/extensions/HelpDialog.js @@ -24,7 +24,7 @@ * limitations under the License. */ -(function (HUB,HTML,AJAX,OUTPUT) { +(function (HUB,HTML,AJAX,OUTPUT,LOCALE) { var HELP = MathJax.Extension.Help = { version: "2.1" @@ -69,10 +69,14 @@ * Handle the Help Dialog box */ HELP.Dialog = function () { + LOCALE.loadDomain("HelpDialog",["Post",HELP]); + }; + + HELP.Post = function () { this.div = MENU.Background(this); var help = HTML.addElement(this.div,"div",{ id: "MathJax_Help" - },MathJax.Localization._("HelpDialog",[ + },LOCALE._("HelpDialog",[ ["b",{style:{fontSize:"120%"}},[["Help","MathJax Help"]]], ["div",{id: "MathJax_HelpContent"},[ ["p",{},[["MathJax", @@ -124,7 +128,7 @@ onclick: HELP.Remove }] ])); - MathJax.Localization.setCSS(help); + LOCALE.setCSS(help); var doc = (document.documentElement||{}); var H = window.innerHeight || doc.clientHeight || doc.scrollHeight || 0; if (MENU.prototype.msieAboutBug) { @@ -143,9 +147,8 @@ MathJax.Callback.Queue( HUB.Register.StartupHook("End Config",{}), // wait until config is complete ["Styles",AJAX,CONFIG.styles], - ["loadDomain",MathJax.Localization,"HelpDialog"], ["Post",HUB.Startup.signal,"HelpDialig Ready"], ["loadComplete",AJAX,"[MathJax]/extensions/HelpDialog.js"] ); -})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.OutputJax); +})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.OutputJax,MathJax.Localization); diff --git a/unpacked/localization/de/de.js b/unpacked/localization/de/de.js index c0bf0069a..14810c7c4 100644 --- a/unpacked/localization/de/de.js +++ b/unpacked/localization/de/de.js @@ -59,6 +59,7 @@ MathJax.Localization.addTranslation("de",null,{ MathMenu: {}, FontWarnings: {}, + HelpDialog: {}, "v1.0-warning": {}, TeX: {}, MathML: {}, diff --git a/unpacked/localization/en/en.js b/unpacked/localization/en/en.js index 4bc1e9cdd..dbf571c8c 100644 --- a/unpacked/localization/en/en.js +++ b/unpacked/localization/en/en.js @@ -38,6 +38,7 @@ MathJax.Localization.addTranslation("en",null,{ }, MathMenu: {}, FontWarnings: {}, + HelpDialog: {}, "v1.0-warning": {}, TeX: {}, MathML: {}, diff --git a/unpacked/localization/fr/fr.js b/unpacked/localization/fr/fr.js index 14f18f241..661172043 100644 --- a/unpacked/localization/fr/fr.js +++ b/unpacked/localization/fr/fr.js @@ -38,6 +38,7 @@ MathJax.Localization.addTranslation("fr",null,{ }, MathMenu: {}, FontWarnings: {}, + HelpDialog: {}, "v1.0-warning": {}, TeX: {}, MathML: {}, From 8edd633609e723c1c8ec8e6464b7885104728f94 Mon Sep 17 00:00:00 2001 From: pkra Date: Mon, 22 Apr 2013 15:34:52 -0700 Subject: [PATCH 36/41] fixed typo in DE locale menu name --- unpacked/localization/de/de.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpacked/localization/de/de.js b/unpacked/localization/de/de.js index 14810c7c4..bd9bc79db 100644 --- a/unpacked/localization/de/de.js +++ b/unpacked/localization/de/de.js @@ -1,5 +1,5 @@ MathJax.Localization.addTranslation("de",null,{ - menuTitle: "Deutch", + menuTitle: "Deutsch", isLoaded: true, domains: { "_": { From 30de539d654fd8b7b764388b4ad815a4a1660f57 Mon Sep 17 00:00:00 2001 From: pkra Date: Mon, 22 Apr 2013 16:17:56 -0700 Subject: [PATCH 37/41] DE locale: removed comments --- unpacked/localization/de/FontWarnings.js | 6 +-- unpacked/localization/de/HelpDialog.js | 65 ++++++++++++++++-------- unpacked/localization/de/MathML.js | 2 +- unpacked/localization/de/MathMenu.js | 18 +++---- unpacked/localization/de/TeX.js | 62 +++++++++++----------- unpacked/localization/de/v1.0-warning.js | 2 +- 6 files changed, 88 insertions(+), 67 deletions(-) diff --git a/unpacked/localization/de/FontWarnings.js b/unpacked/localization/de/FontWarnings.js index 8aded9af6..f41f8af97 100644 --- a/unpacked/localization/de/FontWarnings.js +++ b/unpacked/localization/de/FontWarnings.js @@ -41,19 +41,19 @@ MathJax.Localization.addTranslation("de","FontWarnings",{ fonts: "MathJax kann [STIX Fonts](%1) oder [MathJax TeX Fonts](%2) verwenden. "+ - "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern.", //TODO ???? + "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern.", // "MathJax can use either the [STIX Fonts](%1) or the [MathJax TeX fonts](%2). " + // "Download and install one of those fonts to improve your MathJax experience.", STIXPage: "Diese Seite ist optimiert fuer [STIX Fonts](%1). " + - "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern.", //TODO ???? + "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern.", // "This page is designed to use the %1. " + // "Download and install those fonts to improve your MathJax experience.", TeXPage: "Diese Seite ist optimiert fuer [MathJax TeX Fonts](%1). " + - "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern." //TODO ???? + "Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern." // "This page is designed to use the %1. " + // "Download and install those fonts to improve your MathJax experience." diff --git a/unpacked/localization/de/HelpDialog.js b/unpacked/localization/de/HelpDialog.js index a1049f06f..e073e2c88 100644 --- a/unpacked/localization/de/HelpDialog.js +++ b/unpacked/localization/de/HelpDialog.js @@ -1,45 +1,66 @@ -MathJax.Localization.addTranslation("de","HelpDialog",{ + MathJax.Localization.addTranslation("de","HelpDialog",{ isLoaded: true, strings: { MathJax: - "*MathJax* is a JavaScript library that allows page authors to include " + - "mathematics within their web pages. As a reader, you don't need to do " + - "anything to make that happen.", + "*MathJax* ist eine JavaScript-Bibliothek, die Autoren erlaubt, " + + "Ihren Webseiten mathematische Inhalte hinzuzuf\u00FCgen. Als Besucher " + + "m\u00FCssen sie nichts zus\u00E4tzliches tun, damit MathJax funktioniert." +// "*MathJax* is a JavaScript library that allows page authors to include " + +// "mathematics within their web pages. As a reader, you don't need to do " + +// "anything to make that happen.", Browsers: - "*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " + - "Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers.", + "*Browser*: MathJax ist kompatibel zu allen modernen Webbrowsern inklusive " + + "IE6+, Firefox 3+, Chrome 0.2+, Safari 2+, Opera 9.6+ und g\u00E4ngigen mobilen Browsern." +// "*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " + +// "Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers.", Menu: - "*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " + - "CTRL-click on any mathematics to access the menu.", + "*Mathe Men\u00FC*: MathJax f\u00FCgt ein Kontextmen\u00FC bei allen Formen hinzu. " + + "Es wird mit Rechtsklick oder STRG+Linksklick auf einer Formel aufgerufen." +// "*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " + +// "CTRL-click on any mathematics to access the menu.", ShowMath: - "*Show Math As* allows you to view the formula's source markup " + - "for copy & paste (as MathML or in its origianl format).", + "*Zeige Mathe als* erlaubt es, eine Formel im Quellformat anzuzeigen, " //NOTE needs to match menu item translations! + "um Kopieren und Einf\u00FCgen (als MathML oder im Originalformat) zu erm00F6glichen." +// "*Show Math As* allows you to view the formula's source markup " + +// "for copy & paste (as MathML or in its origianl format).", Settings: - "*Settings* gives you control over features of MathJax, such as the " + - "size of the mathematics, and the mechanism used to display equations.", + "*Einstellungen* erlabut es, das Verhalten von MathJax zu modifizieren, "+ //NOTE needs to match menu item translations! + "so z.B. die Gr\u00CS\u00DFe der Mathematik sowie den Ausgabemechanismus." +// "*Settings* gives you control over features of MathJax, such as the " + +// "size of the mathematics, and the mechanism used to display equations.", Language: - "*Language* lets you select the language used by MathJax for its menus " + - "and warning messages.", + "*Sprache* erlaubt es, die Sprache zu wechseln, die MathJax im Men\u00FC " + //NOTE needs to match menu item translations! + "und den Warnmeldungen verwendent." +// "*Language* lets you select the language used by MathJax for its menus " + +// "and warning messages.", Zoom: - "*Math Zoom*: If you are having difficulty reading an equation, MathJax can " + - "enlarge it to help you see it better.", + "*Zoom*: Falls das Lesen der Formeln schwer f\u00E4llt, kann MathJax diese " + //NOTE needs to match menu item translations! + "vergr\u00CS\u00DFern, um es zu erleichtern." +// "*Math Zoom*: If you are having difficulty reading an equation, MathJax can " + +// "enlarge it to help you see it better.", Accessibilty: - "*Accessibility*: MathJax will automatically work with screen readers to make " + - "mathematics accessible to the visually impaired.", + "*Barrierfreiheit*: MathJax arbeite automatisch mit g\u00E4ngigen Screenreadern " + + "zusammen, um Mathematik barrierefrei darzustellen." +// "*Accessibility*: MathJax will automatically work with screen readers to make " + +// "mathematics accessible to the visually impaired.", Fonts: - "*Fonts*: MathJax will use certain math fonts if they are installed on your " + - "computer; otherwise, it will use web-based fonts. Although not required, " + - "locally installed fonts will speed up typesetting. We suggest installing " + - "the [STIX fonts](%1)." + "*Fonts*: MathJax benutzt gewisse mathematische Fonts, falls sie auf dem System" + + "installiert sind; ansonsten verwendet es Webfonts. Obwohl nicht notwendig, " + + "k\u00F6nnen installierte Fonts den Textsatz beschleunigen. Wir empfehlen, " + + "die [STIX fonts](%1) zu installieren." +// "*Fonts*: MathJax will use certain math fonts if they are installed on your " + +// "computer; otherwise, it will use web-based fonts. Although not required, " + +// "locally installed fonts will speed up typesetting. We suggest installing " + +// "the [STIX fonts](%1)." } }); diff --git a/unpacked/localization/de/MathML.js b/unpacked/localization/de/MathML.js index 22735240b..1b8531287 100644 --- a/unpacked/localization/de/MathML.js +++ b/unpacked/localization/de/MathML.js @@ -39,7 +39,7 @@ MathJax.Localization.addTranslation("de","MathML",{ // "setting is enabled (use the Internet Options item in the Tools\n"+ // "menu, and select the Security panel, then press the Custom Level\n"+ // "button to check this).\n\n"+ -// "MathML equations will not be able to be processed by MathJax.", TODO Cumbersome English +// "MathML equations will not be able to be processed by MathJax.", UnknownNodeType: "Unbekannter Knotentyp: %1", //"Unknown node type: %1", diff --git a/unpacked/localization/de/MathMenu.js b/unpacked/localization/de/MathMenu.js index 018e0475b..e0bde5e47 100644 --- a/unpacked/localization/de/MathMenu.js +++ b/unpacked/localization/de/MathMenu.js @@ -2,15 +2,15 @@ MathJax.Localization.addTranslation("de","MathMenu",{ isLoaded: true, strings: { - Show: "Zeige Mathe als", // "Show Math As", TODO It's a bit weird to have "Math" instead of "equation" "formula" etc but if we keep it we should follow this "globally" + Show: "Zeige Mathe als", // "Show Math As", MathMLcode: "MathML Code", OriginalMathML: "Original MathML", TeXCommands: "Original TeX", // "TeX Commands", AsciiMathInput: "Original AsciiMathML", // "AsciiMathML input" - Original: "Originalform", // "Original Form", TODO What is that referring to? + Original: "Originalform", // "Original Form", ErrorMessage: "Fehlermeldung", // "Error Message", - texHints: "TeX Tipps in MathML", // "Show TeX hints in MathML", TODO I left out "show" -- seemed redundant; "embed" or "add" is more appropriate. - Settings: "Einstellungen", // "Math Settings", //TODO I dropped the "Math", is that ok? Should we do this in general? + texHints: "TeX Tipps in MathML", // "Show TeX hints in MathML", + Settings: "Einstellungen", // "Math Settings", ZoomTrigger: "Zoom ausl\u00F6sen", // "Zoom Trigger", Hover: "Hover", Click: "Klick", // "Click", @@ -25,10 +25,10 @@ MathJax.Localization.addTranslation("de","MathMenu",{ ZoomFactor: "Zoomfaktor", // "Zoom Factor", Renderer: "Mathe Renderer", // "Math Renderer", MPHandles: "An MathPlayer \u00FCbergeben:", // "Let MathPlayer Handle:", - MenuEvents: "Men\u00FC Events", // "Menu Events", //TODO not sure about "Events" jargon. what are these? + MenuEvents: "Men\u00FC Events", // "Menu Events", MouseEvents: "Maus Events", // "Mouse Events", MenuAndMouse: "Maus und Men\u00FC Events", // "Mouse and Menu Events", - FontPrefs: "Font Einstellungen", // "Font Preferences", //TODO What's this? + FontPrefs: "Font Einstellungen", // "Font Preferences", ForHTMLCSS: "F\u00FCr HTML-CSS", // "For HTML-CSS:", Auto: "Auto", TeXLocal: "TeX (lokal)", // "TeX (local)", @@ -41,7 +41,7 @@ MathJax.Localization.addTranslation("de","MathMenu",{ Discoverable: "Highlight durch Hovern", // "Highlight on Hover", Locale: "Sprache", // "Language", LoadLocale: "Von URL laden ...", // "Load from URL ...", - About: "\u00DCber MathJax", // "About MathJax", TODO should be a line lower before the rest of the about box? + About: "\u00DCber MathJax", // "About MathJax", Help: "MathJax Hilfe", // "MathJax Help", /* About MathJax dialogue ? */ localTeXfonts: "Lokale TeX-Fonts verwendet", // "using local TeX fonts", @@ -51,7 +51,7 @@ MathJax.Localization.addTranslation("de","MathMenu",{ webSVGfonts: "Web SVG-fonts verwendet", // "using web SVG fonts", genericfonts: "Generische Unicode-Fonts verwendet", // "using generic unicode fonts", - wofforotffonts: "WOFF- oder OTF-Fonts", // "woff or otf fonts", TODO capitalize English? + wofforotffonts: "WOFF- oder OTF-Fonts", // "woff or otf fonts", eotffonts: "EOT-Fonts", // "eot fonts", svgfonts: "SVG-Fonts", // "svg fonts", @@ -112,7 +112,7 @@ MathJax.Localization.addTranslation("de","MathMenu",{ SwitchAnyway: "Renderer trotzdem \u00E4ndern?\n\n" + - "(Mit OK wechseln, mit ABBRECHEN den akt\u00FCllen Renderer verwenden)", //TODO check German browser lingo OK // Abbrechen + "(Mit OK wechseln, mit ABBRECHEN den akt\u00FCllen Renderer verwenden)", // "Switch the renderer anyway?\n\n" + // "(Press OK to switch, CANCEL to continue with the current renderer)", diff --git a/unpacked/localization/de/TeX.js b/unpacked/localization/de/TeX.js index 5838d6adf..75f1336f3 100644 --- a/unpacked/localization/de/TeX.js +++ b/unpacked/localization/de/TeX.js @@ -3,15 +3,15 @@ MathJax.Localization.addTranslation("de","TeX",{ strings: { ExtraOpenMissingClose: - "Zus\u00E4tzliche offene oder fehlende schliessende Klammer",//TODO maybe 'ueberfluessig' = superfluous is better? or 'zu viele' = too many? + "Zus\u00E4tzliche offene oder fehlende schliessende Klammer", //TODO better alternative for "zusaetzlich"? Maybe a good translation of mismatched braces instead? // "Extra open brace or missing close brace", ExtraCloseMissingOpen: - "Zus\u00E4tzliche schliessende oder fehlende offene Klammer",//TODO ditto + "Zus\u00E4tzliche schliessende oder fehlende offene Klammer", // "Extra close brace or missing open brace", MissingLeftExtraRight: - "Fehlendes '\\left' oder zus\u00E4tzliches '\\right'", //TODO ditto + "Fehlendes '\\left' oder zus\u00E4tzliches '\\right'", // "Missing \\left or extra \\right", MissingScript: @@ -19,20 +19,20 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Missing superscript or subscript argument", ExtraLeftMissingRight: - "Zus\u00E4tzliches '\\left' oder fehlendes '\\right'",//TODO ditto + "Zus\u00E4tzliches '\\left' oder fehlendes '\\right'", // "Extra \\left or missing \\right", Misplaced: - "%1 falsch plaziert", //TODO not sure; context? + "%1 falsch plaziert", // "Misplaced %1", MissingOpenForSub: "Fehlende offende Klammer im Subskript", -// "Missing open brace for subscript", // *NEW* +// "Missing open brace for subscript", MissingOpenForSup: "Fehlende offene Klammer im Superskript", -// "Missing open brace for superscript", // *NEW* +// "Missing open brace for superscript", AmbiguousUseOf: "Mehrdeutige Verwendung von %1", @@ -47,7 +47,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Missing \\end{%1}", MissingBoxFor: - "Fehlende Box: %1", //TODO What kind of TeX is this referring to? + "Fehlende Box: %1", // "Missing box for %1", MissingCloseBrace: @@ -59,7 +59,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Undefined control sequence %1", DoubleExponent: - "Doppeltes Superskript: verwende Klammern zum Gruppieren", //TODO I used "use braces to group" + "Doppeltes Superskript: verwende Klammern zum Gruppieren", // "Double exponent: use braces to clarify", DoubleSubscripts: @@ -71,7 +71,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Prime causes double exponent: use braces to clarify", CantUseHash1: - "Das Zeichen '#' ist ein Makroparameter und kann nicht im Mathematikmodus verwendet werden.", //TODO Do we need to explain the why? Should we just say "can't be used, use '\#' instead" + "Das Zeichen '#' ist ein Makroparameter und kann nicht im Mathematikmodus verwendet werden.", // "You can't use 'macro parameter character #' in math mode", MisplacedMiddle: @@ -79,7 +79,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "%1 must be within \\left and \\right", MisplacedLimits: - "%1 ist nur bei Operatoren erlaubt", //TODO "bei" could be wrong, maybe 'in', 'an' + "%1 ist nur bei Operatoren erlaubt", // "%1 is allowed only on operators", MisplacedMoveRoot: @@ -87,7 +87,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "%1 can appear only within a root", MultipleCommand: - "Zu viele %1",//TODO need context. I translated this as "too many" + "Zu viele %1", // "Multiple %1", IntegerArg: @@ -116,18 +116,18 @@ MathJax.Localization.addTranslation("de","TeX",{ "Maximale Anzahl an Substitutionen ist erreicht; " + "wird eine rekursive LaTeX-Umgebung verwendet?", // "MathJax maximum substitution count exceeded; " + -// "is there a recursive latex environment?", //TODO use LaTeX ? +// "is there a recursive latex environment?", MissingArgFor: - "Fehlendes Argument in %1", //TODO 'in' could be wrong preposition + "Fehlendes Argument in %1", // "Missing argument for %1", ExtraAlignTab: - "Zus\u00E4tzliches & im '\\cases' Text",//TODO not sure about German TeX jargon, but & might be clearer? Maybe switch to 'zu viele // too many' instead of extra. + "Zus\u00E4tzliches & im '\\cases' Text", // "Extra alignment tab in \\cases text", BracketMustBeDimension: - "Das geklammerte Argument f\u00FCr %1 muss eine Dimension sein", //TODO wasn't sure about Dimension jargon + "Das geklammerte Argument f\u00FCr %1 muss eine Dimension sein", // "Bracket argument to %1 must be a dimension", InvalidEnv: @@ -139,11 +139,11 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Unknown environment '%1'", ExtraClose: - "Zus\u00E4tzliche geschlossene Klammer", //TODO 'zu viele / too many' might be better + "Zus\u00E4tzliche geschlossene Klammer", // "Extra close brace", ExtraCloseLooking: - "Zus\u00E4tzliche geschlossene Klammer w\u00E4hrend der Suche nach %1", //TODO 'zu viele / too many' might be better, not sure about programming jargon for "while looking for" + "Zus\u00E4tzliche geschlossene Klammer w\u00E4hrend der Suche nach %1", // "Extra close brace while looking for %1", MissingCloseBracket: @@ -151,15 +151,15 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Couldn't find closing ']' for argument to %1", MissingOrUnrecognizedDelim: - "Fehlender oder nichterkannter Delimiter bei %1", //TODO not sure about Delimiter as TeX jargon + "Fehlender oder nichterkannter Delimiter bei %1", // "Missing or unrecognized delimiter for %1", MissingDimOrUnits: - "Fehlende Dimension oder Einheiten bei %1", //TODO not sure about TeX jargon + "Fehlende Dimension oder Einheiten bei %1", // "Missing dimension or its units for %1", TokenNotFoundForCommand: - "Konnte %1 nicht f\u00FCr %2 finden", //TODO not sure about 'fuer' preposition. What's the context? + "Konnte %1 nicht f\u00FCr %2 finden", // "Couldn't find %1 for %2", MathNotTerminated: @@ -171,7 +171,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Illegal macro parameter reference", MaxBufferSize: - "Interner Puffergr\u00F6\u00DFe \u00FCberschritten; wird ein rekursiver Makroaufruf verwendet?", // TODO not sure about buffer/puffer, macro call/makroaufruf + "Interner Puffergr\u00F6\u00DFe \u00FCberschritten; wird ein rekursiver Makroaufruf verwendet?", // "MathJax internal buffer size exceeded; is there a recursive macro call?", /* AMSmath */ @@ -189,11 +189,11 @@ MathJax.Localization.addTranslation("de","TeX",{ // "%1 must come at the beginning of the line", IllegalAlign: - "Ung\u00FCltige Ausrichtung in %1",//TODO not sure about Ausrichtung/alignment + "Ung\u00FCltige Ausrichtung in %1", // "Illegal alignment specified in %1", ? BadMathStyleFor: - "Schlechtes 'math style' Argument: %1", //TODO not sure about math style. + "Schlechtes 'math style' Argument: %1", // "Bad math style for %1", PositiveIntegerArg: @@ -201,7 +201,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Argument to %1 must me a positive integer", ErroneousNestingEq: - "Fehlerhafte Verschachtelung von Gleichungen", //TODO not sure about Verschachtelung/nesting jargon + "Fehlerhafte Verschachtelung von Gleichungen", // "Erroneous nesting of equation structures", MultlineRowsOneCol: @@ -215,7 +215,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "%1 specified twice in %2", InvalidBBoxProperty: - "'%1' scheint keine Farbe, Padding-Dimension oder Stil zu sein",//TODO not sure about TeX jargon + "'%1' scheint keine Farbe, Padding-Dimension oder Stil zu sein", // "'%1' doesn't look like a color, a padding dimension, or a style", /* begingroup */ @@ -267,7 +267,7 @@ MathJax.Localization.addTranslation("de","TeX",{ /* mhchem */ NoClosingChar: - "Kann geschlossenes %1 nicht finden",//TODO geschlossenes is neutral Gender, hope this works, but probably not since chars have different genders + "Kann geschlossene %1 nicht finden", // "Can't find closing %1", /* newcommand */ @@ -285,7 +285,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "\\ must be followed by a control sequence", CantUseHash2: - "Ung\u00FCltige Verwendung von # im Template von %1", //TODO not sure about 'im' and 'von'. + "Ung\u00FCltige Verwendung von # im Template von %1", // "Illegal use of # in template for %1", SequentialParam: @@ -293,7 +293,7 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Parameters for %1 must be numbered sequentially", MissingReplacementString: - "Ersetzende Zeichenkette f\u00FCr Definition von %1 fehlt", //TODO not sure about "ersetzen" + "Ersetzende Zeichenkette f\u00FCr Definition von %1 fehlt", // "Missing replacement string for definition of %1", MismatchUseDef: @@ -301,13 +301,13 @@ MathJax.Localization.addTranslation("de","TeX",{ // "Use of %1 doesn't match its definition", RunawayArgument: - "Nichtgeschlossenes Argument f\u00FCr %1?", //TODO not sure about runaway argument, translated as 'not closed', not sure about 'fuer'. + "Nichtgeschlossenes Argument f\u00FCr %1?", // "Runaway argument for %1?" /* verb */ NoClosingDelim: - "Kein schliessender Delimiter f\u00FCr %1" //TODO not sure about Delimiter jargon, not sure about 'fuer' + "Kein schliessender Delimiter f\u00FCr %1" // "Can't find closing delimiter for %1" } diff --git a/unpacked/localization/de/v1.0-warning.js b/unpacked/localization/de/v1.0-warning.js index c5f4d5d26..d530cbac3 100644 --- a/unpacked/localization/de/v1.0-warning.js +++ b/unpacked/localization/de/v1.0-warning.js @@ -2,7 +2,7 @@ MathJax.Localization.addTranslation("de","v1.0-warning",{ isLoaded: true, strings: { - MissingConfig: //TODO discuss how to get rid of this + MissingConfig: "MathJax l\u00E4dt keine Standardkonfiguration mehr; " + "der Author der Seite muss eine Konfigurationsdatei angeben. " + "Diese Seite nutze die alte Standardkonfiguration %1 " + From 3e3591ab7e2263f88016ddfe72d15917fda1c69e Mon Sep 17 00:00:00 2001 From: pkra Date: Mon, 22 Apr 2013 16:33:20 -0700 Subject: [PATCH 38/41] EN locale: added comments for translators --- unpacked/localization/en/HTML-CSS.js | 2 +- unpacked/localization/en/HelpDialog.js | 4 +-- unpacked/localization/en/MathML.js | 4 +-- unpacked/localization/en/MathMenu.js | 48 +++++++++++++------------- unpacked/localization/en/TeX.js | 40 ++++++++++----------- unpacked/localization/en/en.js | 22 ++++++------ 6 files changed, 60 insertions(+), 60 deletions(-) diff --git a/unpacked/localization/en/HTML-CSS.js b/unpacked/localization/en/HTML-CSS.js index a1725c42d..41677f116 100644 --- a/unpacked/localization/en/HTML-CSS.js +++ b/unpacked/localization/en/HTML-CSS.js @@ -3,7 +3,7 @@ MathJax.Localization.addTranslation("en","HTML-CSS",{ strings: { LoadWebFont: - "Loading web-font %1", + "Loading web-font %1", // NOTE %1 is the name of a webfont file CantLoadWebFont: "Can't load web font %1", diff --git a/unpacked/localization/en/HelpDialog.js b/unpacked/localization/en/HelpDialog.js index 51636ff44..97a4ba348 100644 --- a/unpacked/localization/en/HelpDialog.js +++ b/unpacked/localization/en/HelpDialog.js @@ -3,7 +3,7 @@ MathJax.Localization.addTranslation("en","HelpDialog",{ strings: { MathJax: - "*MathJax* is a JavaScript library that allows page authors to include " + + "*MathJax* is a JavaScript library that allows page authors to include " + //NOTE Markdown syntax *...* "mathematics within their web pages. As a reader, you don't need to do " + "anything to make that happen.", @@ -39,7 +39,7 @@ MathJax.Localization.addTranslation("en","HelpDialog",{ "*Fonts*: MathJax will use certain math fonts if they are installed on your " + "computer; otherwise, it will use web-based fonts. Although not required, " + "locally installed fonts will speed up typesetting. We suggest installing " + - "the [STIX fonts](%1)." + "the [STIX fonts](%1)." //NOTE Markdown syntax for links. %1 is a URL to the STIX fonts } }); diff --git a/unpacked/localization/en/MathML.js b/unpacked/localization/en/MathML.js index eebd1e388..bb203f501 100644 --- a/unpacked/localization/en/MathML.js +++ b/unpacked/localization/en/MathML.js @@ -2,7 +2,7 @@ MathJax.Localization.addTranslation("en","MathML",{ isLoaded: true, strings: { - BadMglyph: + BadMglyph: //NOTE refers to MathML's mglyph element. "Bad mglyph: %1", BadMglyphFont: @@ -29,7 +29,7 @@ MathJax.Localization.addTranslation("en","MathML",{ "MathML equations will not be able to be processed by MathJax.", UnknownNodeType: - "Unknown node type: %1", + "Unknown node type: %1", //NOTE refers to XML nodes UnexpectedTextNode: "Unexpected text node: %1", diff --git a/unpacked/localization/en/MathMenu.js b/unpacked/localization/en/MathMenu.js index 8ab65c03a..96058b2ab 100644 --- a/unpacked/localization/en/MathMenu.js +++ b/unpacked/localization/en/MathMenu.js @@ -2,49 +2,49 @@ MathJax.Localization.addTranslation("en","MathMenu",{ isLoaded: true, strings: { - Show: "Show Math As", - MathMLcode: "MathML Code", - OriginalMathML: "Original MathML", - TeXCommands: "TeX Commands", - AsciiMathInput: "AsciiMathML input", - Original: "Original Form", - ErrorMessage: "Error Message", - texHints: "Show TeX hints in MathML", - Settings: "Math Settings", - ZoomTrigger: "Zoom Trigger", + Show: "Show Math As", //NOTE MathJax uses 'Math' as a distinct UI choice. Please translate it literally whenever possible. + MathMLcode: "MathML Code", // NOTE This menu item shows the MathML code that MathJax has produced internally (sanitized, indented etc) + OriginalMathML: "Original MathML", // NOTE This menu item shows the MathML code if that was originally in the page source + TeXCommands: "TeX Commands", // NOTE This menu item shows the TeX code if that was originally in the page source + AsciiMathInput: "AsciiMathML input", // NOTE This menu item shows the asciimath code if that was originally in the page source + Original: "Original Form", // NOTE This menu item shows the code that was originally in the page source but has no registered type. This can happen when extensions add new input formats but fail to provide an adequate format name. + ErrorMessage: "Error Message", //NOTE This menu item shows the error message if MathJax fails to process the source + texHints: "Show TeX hints in MathML", // NOTE This menu option adds comments to the code produced by 'MathMLCode' + Settings: "Math Settings", + ZoomTrigger: "Zoom Trigger", //NOTE This menu determines how MathJax's zoom is triggered Hover: "Hover", Click: "Click", DoubleClick: "Double-Click", NoZoom: "No Zoom", - TriggerRequires: "Trigger Requires:", - Option: "Option", + TriggerRequires: "Trigger Requires:", //NOTE This menu item determines if the ZoomTrigger requires additional keys + Option: "Option", //NOTE refers to Apple-style OPTION key Alt: "Alt", - Command: "Command", + Command: "Command", //NOTE This menu item Apple-style COMMAND key Control: "Control", Shift: "Shift", ZoomFactor: "Zoom Factor", - Renderer: "Math Renderer", - MPHandles: "Let MathPlayer Handle:", + Renderer: "Math Renderer",//NOTE This menu changes the output extension used by MathJax + MPHandles: "Let MathPlayer Handle:",//NOTE MathJax recognizes MathPlayer when present. This submenu deals with MathJax/MathPlayer interaction. MenuEvents: "Menu Events", MouseEvents: "Mouse Events", MenuAndMouse: "Mouse and Menu Events", - FontPrefs: "Font Preferences", + FontPrefs: "Font Preferences", //NOTE This menu item is mostly used for develoment purposes ForHTMLCSS: "For HTML-CSS:", Auto: "Auto", - TeXLocal: "TeX (local)", + TeXLocal: "TeX (local)", //NOTE 'TeX' refers to the MathJax fonts TeXWeb: "TeX (web)", TeXImage: "TeX (image)", STIXLocal: "STIX (local)", ContextMenu: "Contextual Menu", Browser: "Browser", - Scale: "Scale All Math ...", + Scale: "Scale All Math ...", //NOTE This menu item allows users to set a scaling factor for the MathJax output (relative to the surrounding content) Discoverable: "Highlight on Hover", Locale: "Language", LoadLocale: "Load from URL ...", About: "About MathJax", Help: "MathJax Help", - localTeXfonts: "using local TeX fonts", + localTeXfonts: "using local TeX fonts", //NOTE This section deals with the 'About' overlay popup webTeXfonts: "using web TeX font", imagefonts: "using Image fonts", localSTIXfonts: "using local STIX fonts", @@ -55,7 +55,7 @@ MathJax.Localization.addTranslation("en","MathMenu",{ eotffonts: "eot fonts", svgfonts: "svg fonts", - WebkitNativeMMLWarning: + WebkitNativeMMLWarning: //NOTE This section deals with warnings for when a user changes the rendering output via the MathJax menu but a browser does not support the chosen mechanism "Your browser doesn't seem to support MathML natively, " + "so switching to MathML output may cause the mathematics " + "on the page to become unreadable.", @@ -97,7 +97,7 @@ MathJax.Localization.addTranslation("en","MathMenu",{ "(Press OK to switch, CANCEL to continue with the current renderer)", ScaleMath: - "Scale all mathematics (compared to surrounding text) by", + "Scale all mathematics (compared to surrounding text) by", //NOTE This section deals with 'MathJax menu-> Scale all math' NonZeroScale: "The scale should not be zero", @@ -105,7 +105,7 @@ MathJax.Localization.addTranslation("en","MathMenu",{ PercentScale: "The scale should be a percentage (e.g., 120%%)", - IE8warning: + IE8warning: //NOTE This section deals with MathPlayer hand-over "This will disable the MathJax menu and zoom features, " + "but you can Alt-Click on an expression to obtain the MathJax " + "menu instead.\n\nReally change the MathPlayer settings?", @@ -115,10 +115,10 @@ MathJax.Localization.addTranslation("en","MathMenu",{ "Alt-Click on an expression to obtain the MathJax menu instead.", NoOriginalForm: - "No original form available", + "No original form available", //NOTE This refers to missing source formats when using 'MathJax Menu -> show math as" Close: - "Close", + "Close", //NOTE for closing overlay popups like the 'MathJax Menu => about MathJax' box. EqSource: "MathJax Equation Source" diff --git a/unpacked/localization/en/TeX.js b/unpacked/localization/en/TeX.js index 1aaf53b77..03e922445 100644 --- a/unpacked/localization/en/TeX.js +++ b/unpacked/localization/en/TeX.js @@ -1,21 +1,21 @@ -MathJax.Localization.addTranslation("en","TeX",{ +MathJax.Localization.addTranslation("en","TeX",{ //NOTE use correct ISO name TODO autopopulate? isLoaded: true, strings: { ExtraOpenMissingClose: - "Extra open brace or missing close brace", + "Extra open brace or missing close brace", //NOTE TeX commands use braces and brackets as delimiters ExtraCloseMissingOpen: "Extra close brace or missing open brace", MissingLeftExtraRight: - "Missing \\left or extra \\right", + "Missing \\left or extra \\right", //NOTE do not translate \\left and \\right, they are TeX commands MissingScript: "Missing superscript or subscript argument", ExtraLeftMissingRight: - "Extra \\left or missing \\right", + "Extra \\left or missing \\right", //NOTE do not translate \\left and \\right, they are TeX commands Misplaced: "Misplaced %1", @@ -27,72 +27,72 @@ MathJax.Localization.addTranslation("en","TeX",{ "Missing open brace for superscript", AmbiguousUseOf: - "Ambiguous use of %1", + "Ambiguous use of %1", //NOTE %1 will be a TeX command EnvBadEnd: - "\\begin{%1} ended with \\end{%2}", + "\\begin{%1} ended with \\end{%2}", //NOTE do not translate \\begin{%1} and \\end{{%1}}, they are TeX commands EnvMissingEnd: - "Missing \\end{%1}", + "Missing \\end{%1}", //NOTE do not translate \\end MissingBoxFor: - "Missing box for %1", + "Missing box for %1", //NOTE refers to TeX boxes MissingCloseBrace: "Missing close brace", UndefinedControlSequence: - "Undefined control sequence %1", + "Undefined control sequence %1", //NOTE %1 will be a TeX command DoubleExponent: - "Double exponent: use braces to clarify", + "Double exponent: use braces to clarify", // NOTE example: x^3^2 should be x^{3^2} or {x^3}^2 DoubleSubscripts: "Double subscripts: use braces to clarify", DoubleExponentPrime: - "Prime causes double exponent: use braces to clarify", + "Prime causes double exponent: use braces to clarify", //NOTE example TODO CantUseHash1: - "You can't use 'macro parameter character #' in math mode", + "You can't use 'macro parameter character #' in math mode", //NOTE '#' is used in TeX macros MisplacedMiddle: - "%1 must be within \\left and \\right", + "%1 must be within \\left and \\right", //NOTE do not translate \\left and \\right, they are TeX commands MisplacedLimits: - "%1 is allowed only on operators", + "%1 is allowed only on operators", MisplacedMoveRoot: "%1 can appear only within a root", MultipleCommand: - "Multiple %1", + "Multiple %1", //NOTE happens when a command or token can only be preset once IntegerArg: "The argument to %1 must be an integer", NotMathMLToken: - "%1 is not a token element", + "%1 is not a token element", //NOTE MathJax has a non-standard /mmltoken command to insert MathML token elements InvalidMathMLAttr: - "Invalid MathML attribute: %1", + "Invalid MathML attribute: %1", //NOTE MathJax has non standard MathML and HTML related commands which can contain attributes UnknownAttrForElement: "%1 is not a recognized attribute for %2", MaxMacroSub1: - "MathJax maximum macro substitution count exceeded; " + + "MathJax maximum macro substitution count exceeded; " + //NOTE MathJax has a limited for iterating macros "is there a recursive macro call?", MaxMacroSub2: - "MathJax maximum substitution count exceeded; " + + "MathJax maximum substitution count exceeded; " +//NOTE MathJax has a limited for iterating substitutions "is there a recursive latex environment?", MissingArgFor: "Missing argument for %1", ExtraAlignTab: - "Extra alignment tab in \\cases text", + "Extra alignment tab in \\cases text", //NOTE do not translate //cases BracketMustBeDimension: "Bracket argument to %1 must be a dimension", diff --git a/unpacked/localization/en/en.js b/unpacked/localization/en/en.js index dbf571c8c..3cee86ea9 100644 --- a/unpacked/localization/en/en.js +++ b/unpacked/localization/en/en.js @@ -1,5 +1,5 @@ -MathJax.Localization.addTranslation("en",null,{ - menuTitle: "English", +MathJax.Localization.addTranslation("en",null,{ // NOTE use correct ISO-639-1 two letter code http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes + menuTitle: "English", // NOTE language name; will appear in the MathJax submenu for switching locales isLoaded: true, domains: { "_": { @@ -12,27 +12,27 @@ MathJax.Localization.addTranslation("en",null,{ "(You should press Cancel unless you set up the cookie yourself.)", MathProcessingError: - "Math Processing Error", + "Math Processing Error", // NOTE: MathJax uses 'Math' as a distinct UI choice. Please translate it literally whenever possible. MathError: - "Math Error", + "Math Error", // generic error message - LoadFile: "Loading %1", + LoadFile: "Loading %1", - Loading: "Loading", + Loading: "Loading", // NOTE followed by growing sequence of dots LoadFailed: "File failed to load: %1", - ProcessMath: "Processing Math: %1%%", + ProcessMath: "Processing Math: %1%%", //NOTE appears during the conversion process from an input format (e.g., LaTeX, asciimath) to MathJax's internal format - Processing: "Processing", + Processing: "Processing", //NOTE followed by growing sequence of dots - TypesetMath: "Typesetting Math: %1%%", + TypesetMath: "Typesetting Math: %1%%",//NOTE appears during the layout process of converting the internal format to the output format - Typesetting: "Typesetting", + Typesetting: "Typesetting", //NOTE followed by growing sequence of dots MathJaxNotSupported: - "Your browser does not support MathJax" + "Your browser does not support MathJax" //NOTE will load when MathJax determines the browser does not have adequate features } }, From 68cec1915b7a606bc0cdbb93d25566ede6d1c922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Tue, 23 Apr 2013 09:28:17 +0200 Subject: [PATCH 39/41] Translate HelpDialog in French ; fix a typo in the English version ; add "MathJax Help" to the HelpDialog domain. --- unpacked/localization/de/HelpDialog.js | 2 + unpacked/localization/en/HelpDialog.js | 4 +- unpacked/localization/fr/HelpDialog.js | 52 +++++++++++++++----------- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/unpacked/localization/de/HelpDialog.js b/unpacked/localization/de/HelpDialog.js index a1049f06f..65d9f1ec5 100644 --- a/unpacked/localization/de/HelpDialog.js +++ b/unpacked/localization/de/HelpDialog.js @@ -2,6 +2,8 @@ MathJax.Localization.addTranslation("de","HelpDialog",{ isLoaded: true, strings: { + Help: "MathJax Hilfe", + MathJax: "*MathJax* is a JavaScript library that allows page authors to include " + "mathematics within their web pages. As a reader, you don't need to do " + diff --git a/unpacked/localization/en/HelpDialog.js b/unpacked/localization/en/HelpDialog.js index 51636ff44..98945916d 100644 --- a/unpacked/localization/en/HelpDialog.js +++ b/unpacked/localization/en/HelpDialog.js @@ -2,6 +2,8 @@ MathJax.Localization.addTranslation("en","HelpDialog",{ isLoaded: true, strings: { + Help: "MathJax Help", + MathJax: "*MathJax* is a JavaScript library that allows page authors to include " + "mathematics within their web pages. As a reader, you don't need to do " + @@ -17,7 +19,7 @@ MathJax.Localization.addTranslation("en","HelpDialog",{ ShowMath: "*Show Math As* allows you to view the formula's source markup " + - "for copy & paste (as MathML or in its origianl format).", + "for copy & paste (as MathML or in its original format).", Settings: "*Settings* gives you control over features of MathJax, such as the " + diff --git a/unpacked/localization/fr/HelpDialog.js b/unpacked/localization/fr/HelpDialog.js index 9f6ea5882..1ccb4e5e3 100644 --- a/unpacked/localization/fr/HelpDialog.js +++ b/unpacked/localization/fr/HelpDialog.js @@ -2,44 +2,54 @@ MathJax.Localization.addTranslation("fr","HelpDialog",{ isLoaded: true, strings: { + Help: "Aide MathJax", + MathJax: - "*MathJax* is a JavaScript library that allows page authors to include " + - "mathematics within their web pages. As a reader, you don't need to do " + - "anything to make that happen.", + "*MathJax* est une librairie Javascript qui permet aux auteurs " + + "d'inclure des formules math\u00E9matiques au sein de leurs pages Web. " + + "Aucune action suppl\u00E9mentaire n'est n\u00E9cessaire de la part des visiteurs.", Browsers: - "*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " + - "Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers.", + "*Navigateurs*: MathJax fonctionne avec tous les navigateurs modernes " + + "y compris Internet Explorer 6, Firefox 3, " + + "Chrome 0.2, Safari 2, Opera 9.6 et leurs versions sup\u00E9rieures ainsi " + + "que la plupart des navigateurs pour mobiles et tablettes.", Menu: - "*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " + - "CTRL-click on any mathematics to access the menu.", + "*Menu Math\u00E9matiques*: MathJax ajoute un menu contextuel aux \u00E9quations. "+ + "Acc\u00E9dez au menu en effectuant un clic droit ou un Ctrl+clic sur " + + "n'importe quelle formule math\u00E9matique.", ShowMath: - "*Show Math As* allows you to view the formula's source markup " + - "for copy & paste (as MathML or in its origianl format).", + "Le menu *Afficher sous forme* vous permet de voir le code source de la "+ + "formule pour la copier et coller (sous forme MathML ou sous son format "+ + "d'origine).", Settings: - "*Settings* gives you control over features of MathJax, such as the " + - "size of the mathematics, and the mechanism used to display equations.", + "Le menu *Param\u00E8tres* vous permet de contr\u00F4ler diverses "+ + "caract\u00E9ristiques de MathJax, telles que la taille des formules "+ + "math\u00E9matiques ou le m\u00E9canisme utilis\u00E9 pour afficher ces formules.", Language: - "*Language* lets you select the language used by MathJax for its menus " + - "and warning messages.", + "Le menu *Langue* vous permet de s\u00E9lectionnez la langue utilis\u00E9e par "+ + "MathJax pour ses menus et messages d'avertissement.", Zoom: - "*Math Zoom*: If you are having difficulty reading an equation, MathJax can " + - "enlarge it to help you see it better.", + "*Math Zoom*: si vous rencontrez des difficult\u00E9s pour lire les formules "+ + "math\u00E9matiques, MathJax peut les agrandir de fa\u00E7on \u00E0 ce qu'elles soient "+ + "plus lisibles.", Accessibilty: - "*Accessibility*: MathJax will automatically work with screen readers to make " + - "mathematics accessible to the visually impaired.", + "*Accessibilit\u00E9*: MathJax fonctionnera automatiquement avec les "+ + "lecteurs d'\u00E9cran pour rendre les expressions math\u00E9matiques accessibles "+ + "aux personnes malvoyantes.", Fonts: - "*Fonts*: MathJax will use certain math fonts if they are installed on your " + - "computer; otherwise, it will use web-based fonts. Although not required, " + - "locally installed fonts will speed up typesetting. We suggest installing " + - "the [STIX fonts](%1)." + "*Polices*: MathJax utilisera certaines polices math\u00E9matiques si elles "+ + "sont intall\u00E9es sur votre syst\u00E8me ou bien des polices Web dans le cas "+ + "contraire. Bien que non recquises, ces polices install\u00E9es sur votre "+ + "syst\u00E8me acc\u00E9lereront le rendu des expressions math\u00E9matiques. Nous "+ + "recommandons d'installer les [Polices STIX](%1)." } }); From b0cfb7f14a19030118b753d5fa03ab557469cb10 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 23 Apr 2013 08:58:02 -0400 Subject: [PATCH 40/41] Normalize formatting. Add more comments for translators. Remove v1.0-warnings (since that is being removed in v2.2). --- unpacked/localization/de/HelpDialog.js | 88 ++++++++++++------------ unpacked/localization/de/MathML.js | 18 +++-- unpacked/localization/de/MathMenu.js | 17 +++-- unpacked/localization/de/de.js | 1 - unpacked/localization/de/v1.0-warning.js | 18 ----- unpacked/localization/en/HTML-CSS.js | 4 +- unpacked/localization/en/HelpDialog.js | 7 +- unpacked/localization/en/MathML.js | 4 +- unpacked/localization/en/MathMenu.js | 52 +++++++------- unpacked/localization/en/TeX.js | 56 +++++++-------- unpacked/localization/en/en.js | 26 ++++--- unpacked/localization/en/v1.0-warning.js | 14 ---- unpacked/localization/fr/fr.js | 1 - unpacked/localization/fr/v1.0-warning.js | 15 ---- 14 files changed, 148 insertions(+), 173 deletions(-) delete mode 100644 unpacked/localization/de/v1.0-warning.js delete mode 100644 unpacked/localization/en/v1.0-warning.js delete mode 100644 unpacked/localization/fr/v1.0-warning.js diff --git a/unpacked/localization/de/HelpDialog.js b/unpacked/localization/de/HelpDialog.js index f66d67b47..5778b3128 100644 --- a/unpacked/localization/de/HelpDialog.js +++ b/unpacked/localization/de/HelpDialog.js @@ -2,67 +2,69 @@ isLoaded: true, strings: { - Help: "MathJax Hilfe", + Help: + "MathJax Hilfe", +// "MathJax Help", MathJax: - "*MathJax* ist eine JavaScript-Bibliothek, die Autoren erlaubt, " + - "Ihren Webseiten mathematische Inhalte hinzuzuf\u00FCgen. Als Besucher " + - "m\u00FCssen sie nichts zus\u00E4tzliches tun, damit MathJax funktioniert." -// "*MathJax* is a JavaScript library that allows page authors to include " + -// "mathematics within their web pages. As a reader, you don't need to do " + -// "anything to make that happen.", + "*MathJax* ist eine JavaScript-Bibliothek, die Autoren erlaubt, " + + "Ihren Webseiten mathematische Inhalte hinzuzuf\u00FCgen. Als Besucher " + + "m\u00FCssen sie nichts zus\u00E4tzliches tun, damit MathJax funktioniert." +// "*MathJax* is a JavaScript library that allows page authors to include " + +// "mathematics within their web pages. As a reader, you don't need to do " + +// "anything to make that happen.", Browsers: - "*Browser*: MathJax ist kompatibel zu allen modernen Webbrowsern inklusive " + - "IE6+, Firefox 3+, Chrome 0.2+, Safari 2+, Opera 9.6+ und g\u00E4ngigen mobilen Browsern." -// "*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " + -// "Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers.", + "*Browser*: MathJax ist kompatibel zu allen modernen Webbrowsern inklusive " + + "IE6+, Firefox 3+, Chrome 0.2+, Safari 2+, Opera 9.6+ und g\u00E4ngigen mobilen Browsern." +// "*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " + +// "Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers.", Menu: - "*Mathe Men\u00FC*: MathJax f\u00FCgt ein Kontextmen\u00FC bei allen Formen hinzu. " + - "Es wird mit Rechtsklick oder STRG+Linksklick auf einer Formel aufgerufen." -// "*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " + -// "CTRL-click on any mathematics to access the menu.", + "*Mathe Men\u00FC*: MathJax f\u00FCgt ein Kontextmen\u00FC bei allen Formen hinzu. " + + "Es wird mit Rechtsklick oder STRG+Linksklick auf einer Formel aufgerufen." +// "*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " + +// "CTRL-click on any mathematics to access the menu.", ShowMath: - "*Zeige Mathe als* erlaubt es, eine Formel im Quellformat anzuzeigen, " //NOTE needs to match menu item translations! - "um Kopieren und Einf\u00FCgen (als MathML oder im Originalformat) zu erm00F6glichen." -// "*Show Math As* allows you to view the formula's source markup " + -// "for copy & paste (as MathML or in its origianl format).", + "*Zeige Mathe als* erlaubt es, eine Formel im Quellformat anzuzeigen, " //NOTE needs to match menu item translations! + "um Kopieren und Einf\u00FCgen (als MathML oder im Originalformat) zu erm00F6glichen." +// "*Show Math As* allows you to view the formula's source markup " + +// "for copy & paste (as MathML or in its origianl format).", Settings: - "*Einstellungen* erlabut es, das Verhalten von MathJax zu modifizieren, "+ //NOTE needs to match menu item translations! - "so z.B. die Gr\u00CS\u00DFe der Mathematik sowie den Ausgabemechanismus." -// "*Settings* gives you control over features of MathJax, such as the " + -// "size of the mathematics, and the mechanism used to display equations.", + "*Einstellungen* erlabut es, das Verhalten von MathJax zu modifizieren, "+ //NOTE needs to match menu item translations! + "so z.B. die Gr\u00CS\u00DFe der Mathematik sowie den Ausgabemechanismus." +// "*Settings* gives you control over features of MathJax, such as the " + +// "size of the mathematics, and the mechanism used to display equations.", Language: - "*Sprache* erlaubt es, die Sprache zu wechseln, die MathJax im Men\u00FC " + //NOTE needs to match menu item translations! - "und den Warnmeldungen verwendent." -// "*Language* lets you select the language used by MathJax for its menus " + -// "and warning messages.", + "*Sprache* erlaubt es, die Sprache zu wechseln, die MathJax im Men\u00FC " + //NOTE needs to match menu item translations! + "und den Warnmeldungen verwendent." +// "*Language* lets you select the language used by MathJax for its menus " + +// "and warning messages.", Zoom: - "*Zoom*: Falls das Lesen der Formeln schwer f\u00E4llt, kann MathJax diese " + //NOTE needs to match menu item translations! - "vergr\u00CS\u00DFern, um es zu erleichtern." -// "*Math Zoom*: If you are having difficulty reading an equation, MathJax can " + -// "enlarge it to help you see it better.", + "*Zoom*: Falls das Lesen der Formeln schwer f\u00E4llt, kann MathJax diese " + //NOTE needs to match menu item translations! + "vergr\u00CS\u00DFern, um es zu erleichtern." +// "*Math Zoom*: If you are having difficulty reading an equation, MathJax can " + +// "enlarge it to help you see it better.", Accessibilty: - "*Barrierfreiheit*: MathJax arbeite automatisch mit g\u00E4ngigen Screenreadern " + - "zusammen, um Mathematik barrierefrei darzustellen." -// "*Accessibility*: MathJax will automatically work with screen readers to make " + -// "mathematics accessible to the visually impaired.", + "*Barrierfreiheit*: MathJax arbeite automatisch mit g\u00E4ngigen Screenreadern " + + "zusammen, um Mathematik barrierefrei darzustellen." +// "*Accessibility*: MathJax will automatically work with screen readers to make " + +// "mathematics accessible to the visually impaired.", Fonts: - "*Fonts*: MathJax benutzt gewisse mathematische Fonts, falls sie auf dem System" + - "installiert sind; ansonsten verwendet es Webfonts. Obwohl nicht notwendig, " + - "k\u00F6nnen installierte Fonts den Textsatz beschleunigen. Wir empfehlen, " + - "die [STIX fonts](%1) zu installieren." -// "*Fonts*: MathJax will use certain math fonts if they are installed on your " + -// "computer; otherwise, it will use web-based fonts. Although not required, " + -// "locally installed fonts will speed up typesetting. We suggest installing " + -// "the [STIX fonts](%1)." + "*Fonts*: MathJax benutzt gewisse mathematische Fonts, falls sie auf dem System" + + "installiert sind; ansonsten verwendet es Webfonts. Obwohl nicht notwendig, " + + "k\u00F6nnen installierte Fonts den Textsatz beschleunigen. Wir empfehlen, " + + "die [STIX fonts](%1) zu installieren." +// "*Fonts*: MathJax will use certain math fonts if they are installed on your " + +// "computer; otherwise, it will use web-based fonts. Although not required, " + +// "locally installed fonts will speed up typesetting. We suggest installing " + +// "the [STIX fonts](%1)." } }); diff --git a/unpacked/localization/de/MathML.js b/unpacked/localization/de/MathML.js index 1b8531287..6217d1e7c 100644 --- a/unpacked/localization/de/MathML.js +++ b/unpacked/localization/de/MathML.js @@ -42,22 +42,28 @@ MathJax.Localization.addTranslation("de","MathML",{ // "MathML equations will not be able to be processed by MathJax.", UnknownNodeType: - "Unbekannter Knotentyp: %1", //"Unknown node type: %1", + "Unbekannter Knotentyp: %1", +// "Unknown node type: %1", UnexpectedTextNode: - "Unbekannter Textknoten: %1", //"Unexpected text node: %1", + "Unbekannter Textknoten: %1", +// "Unexpected text node: %1", ErrorParsingMathML: - "Fehler beim Parsen von MathML", //"Error parsing MathML", + "Fehler beim Parsen von MathML", +// "Error parsing MathML", ParsingError: - "Fehler beim Parsen von MathML: %1", // "Error parsing MathML: %1", + "Fehler beim Parsen von MathML: %1", +// "Error parsing MathML: %1", MathMLSingleElement: - "MathML muss ein einzelnes Element sein", //"MathML must be formed by a single element", + "MathML muss ein einzelnes Element sein", +// "MathML must be formed by a single element", MathMLRootElement: - "MathML muss ein einzelnes Element sein, nicht %1", //"MathML must be formed by a element, not %1" + "MathML muss ein einzelnes Element sein, nicht %1" +// "MathML must be formed by a element, not %1" } }); diff --git a/unpacked/localization/de/MathMenu.js b/unpacked/localization/de/MathMenu.js index e0bde5e47..e5e71b72e 100644 --- a/unpacked/localization/de/MathMenu.js +++ b/unpacked/localization/de/MathMenu.js @@ -29,21 +29,24 @@ MathJax.Localization.addTranslation("de","MathMenu",{ MouseEvents: "Maus Events", // "Mouse Events", MenuAndMouse: "Maus und Men\u00FC Events", // "Mouse and Menu Events", FontPrefs: "Font Einstellungen", // "Font Preferences", - ForHTMLCSS: "F\u00FCr HTML-CSS", // "For HTML-CSS:", + ForHTMLCSS: "F\u00FCr HTML-CSS", // "For HTML-CSS:", Auto: "Auto", TeXLocal: "TeX (lokal)", // "TeX (local)", TeXWeb: "TeX (Web)", // "TeX (web)", TeXImage: "TeX (Bild)", // "TeX (image)", STIXLocal: "STIX (lokal)", // "STIX (local)", - ContextMenu: "Kontextmen\u00FC ", // "Contextual Menu", + ContextMenu: "Kontextmen\u00FC ", // "Contextual Menu", Browser: "Browser", Scale: "Alle Mathe skalieren ...", // "Scale All Math ...", Discoverable: "Highlight durch Hovern", // "Highlight on Hover", Locale: "Sprache", // "Language", LoadLocale: "Von URL laden ...", // "Load from URL ...", - About: "\u00DCber MathJax", // "About MathJax", + About: "\u00DCber MathJax", // "About MathJax", Help: "MathJax Hilfe", // "MathJax Help", -/* About MathJax dialogue ? */ + + +/* About MathJax dialogue */ + localTeXfonts: "Lokale TeX-Fonts verwendet", // "using local TeX fonts", webTeXfonts: "Web TeX-Fonts verwendet", // "using web TeX font", imagefonts: "Bild-Fonts verwendet", // "using Image fonts", @@ -55,6 +58,9 @@ MathJax.Localization.addTranslation("de","MathMenu",{ eotffonts: "EOT-Fonts", // "eot fonts", svgfonts: "SVG-Fonts", // "svg fonts", + +/* Warnings when switching to MathML mode */ + WebkitNativeMMLWarning: "Ihr Browser scheint MathML nicht zu unterst\u00FCtzen, " + "so dass ein Wechsel zur MathML-Ausgabe die Mathematik " + @@ -87,6 +93,9 @@ MathJax.Localization.addTranslation("de","MathMenu",{ // "Your browser's native MathML does not implement all the features " + // "used by MathJax, so some expressions may not render properly.", + +/* Warning when switching to SVG mode */ + MSIESVGWarning: "Internet Explorer unterst\u00FCtzt SVG erst ab IE9 und " + "nicht im IE8-Emulationsmodus. Beim Wechsel zur " + diff --git a/unpacked/localization/de/de.js b/unpacked/localization/de/de.js index bd9bc79db..414f2ff58 100644 --- a/unpacked/localization/de/de.js +++ b/unpacked/localization/de/de.js @@ -60,7 +60,6 @@ MathJax.Localization.addTranslation("de",null,{ MathMenu: {}, FontWarnings: {}, HelpDialog: {}, - "v1.0-warning": {}, TeX: {}, MathML: {}, "HTML-CSS": {} diff --git a/unpacked/localization/de/v1.0-warning.js b/unpacked/localization/de/v1.0-warning.js deleted file mode 100644 index d530cbac3..000000000 --- a/unpacked/localization/de/v1.0-warning.js +++ /dev/null @@ -1,18 +0,0 @@ -MathJax.Localization.addTranslation("de","v1.0-warning",{ - isLoaded: true, - strings: { - - MissingConfig: - "MathJax l\u00E4dt keine Standardkonfiguration mehr; " + - "der Author der Seite muss eine Konfigurationsdatei angeben. " + - "Diese Seite nutze die alte Standardkonfiguration %1 " + - "und benoetigt ein Update. Siehe auch: %2" -// "MathJax no longer loads a default configuration file; " + -// "you must specify such files explicitly. " + -// "This page seems to use the older default %1 " + -// "file, and so needs to be updated. This is explained further at %2" - - } -}); - -MathJax.Ajax.loadComplete("[MathJax]/localization/de/v1.0-warning.js"); diff --git a/unpacked/localization/en/HTML-CSS.js b/unpacked/localization/en/HTML-CSS.js index 41677f116..8cd3c18ec 100644 --- a/unpacked/localization/en/HTML-CSS.js +++ b/unpacked/localization/en/HTML-CSS.js @@ -3,7 +3,7 @@ MathJax.Localization.addTranslation("en","HTML-CSS",{ strings: { LoadWebFont: - "Loading web-font %1", // NOTE %1 is the name of a webfont file + "Loading web-font %1", // NOTE: %1 is the name of a webfont file CantLoadWebFont: "Can't load web font %1", @@ -12,7 +12,7 @@ MathJax.Localization.addTranslation("en","HTML-CSS",{ "Firefox can't load web fonts from a remote host", CantFindFontUsing: - "Can't find a valid font using %1", + "Can't find a valid font using %1", // Note: %1 is a list of font names WebFontsNotAvailable: "Web-Fonts not available -- using image fonts instead" diff --git a/unpacked/localization/en/HelpDialog.js b/unpacked/localization/en/HelpDialog.js index 2c54d5f50..8fe0680aa 100644 --- a/unpacked/localization/en/HelpDialog.js +++ b/unpacked/localization/en/HelpDialog.js @@ -2,10 +2,11 @@ MathJax.Localization.addTranslation("en","HelpDialog",{ isLoaded: true, strings: { - Help: "MathJax Help", + Help: + "MathJax Help", MathJax: - "*MathJax* is a JavaScript library that allows page authors to include " + //NOTE Markdown syntax *...* + "*MathJax* is a JavaScript library that allows page authors to include " + // NOTE: Markdown syntax *...* "mathematics within their web pages. As a reader, you don't need to do " + "anything to make that happen.", @@ -41,7 +42,7 @@ MathJax.Localization.addTranslation("en","HelpDialog",{ "*Fonts*: MathJax will use certain math fonts if they are installed on your " + "computer; otherwise, it will use web-based fonts. Although not required, " + "locally installed fonts will speed up typesetting. We suggest installing " + - "the [STIX fonts](%1)." //NOTE Markdown syntax for links. %1 is a URL to the STIX fonts + "the [STIX fonts](%1)." // NOTE: Markdown syntax for links. %1 is a URL to the STIX fonts } }); diff --git a/unpacked/localization/en/MathML.js b/unpacked/localization/en/MathML.js index bb203f501..1de8fc1bd 100644 --- a/unpacked/localization/en/MathML.js +++ b/unpacked/localization/en/MathML.js @@ -2,7 +2,7 @@ MathJax.Localization.addTranslation("en","MathML",{ isLoaded: true, strings: { - BadMglyph: //NOTE refers to MathML's mglyph element. + BadMglyph: // NOTE: refers to MathML's mglyph element. "Bad mglyph: %1", BadMglyphFont: @@ -29,7 +29,7 @@ MathJax.Localization.addTranslation("en","MathML",{ "MathML equations will not be able to be processed by MathJax.", UnknownNodeType: - "Unknown node type: %1", //NOTE refers to XML nodes + "Unknown node type: %1", // NOTE: refers to XML nodes UnexpectedTextNode: "Unexpected text node: %1", diff --git a/unpacked/localization/en/MathMenu.js b/unpacked/localization/en/MathMenu.js index 96058b2ab..16c544643 100644 --- a/unpacked/localization/en/MathMenu.js +++ b/unpacked/localization/en/MathMenu.js @@ -2,49 +2,49 @@ MathJax.Localization.addTranslation("en","MathMenu",{ isLoaded: true, strings: { - Show: "Show Math As", //NOTE MathJax uses 'Math' as a distinct UI choice. Please translate it literally whenever possible. - MathMLcode: "MathML Code", // NOTE This menu item shows the MathML code that MathJax has produced internally (sanitized, indented etc) - OriginalMathML: "Original MathML", // NOTE This menu item shows the MathML code if that was originally in the page source - TeXCommands: "TeX Commands", // NOTE This menu item shows the TeX code if that was originally in the page source - AsciiMathInput: "AsciiMathML input", // NOTE This menu item shows the asciimath code if that was originally in the page source - Original: "Original Form", // NOTE This menu item shows the code that was originally in the page source but has no registered type. This can happen when extensions add new input formats but fail to provide an adequate format name. - ErrorMessage: "Error Message", //NOTE This menu item shows the error message if MathJax fails to process the source - texHints: "Show TeX hints in MathML", // NOTE This menu option adds comments to the code produced by 'MathMLCode' + Show: "Show Math As", // NOTE: MathJax uses 'Math' as a distinct UI choice. Please translate it literally whenever possible. + MathMLcode: "MathML Code", // NOTE: This menu item shows the MathML code that MathJax has produced internally (sanitized, indented etc) + OriginalMathML: "Original MathML", // NOTE: This menu item shows the MathML code if that was originally in the page source + TeXCommands: "TeX Commands", // NOTE: This menu item shows the TeX code if that was originally in the page source + AsciiMathInput: "AsciiMathML input", // NOTE: This menu item shows the asciimath code if that was originally in the page source + Original: "Original Form", // NOTE: This menu item shows the code that was originally in the page source but has no registered type. This can happen when extensions add new input formats but fail to provide an adequate format name. + ErrorMessage: "Error Message", // NOTE: This menu item shows the error message if MathJax fails to process the source + texHints: "Show TeX hints in MathML", // NOTE: This menu option adds comments to the code produced by 'MathMLCode' Settings: "Math Settings", - ZoomTrigger: "Zoom Trigger", //NOTE This menu determines how MathJax's zoom is triggered + ZoomTrigger: "Zoom Trigger", // NOTE: This menu determines how MathJax's zoom is triggered Hover: "Hover", Click: "Click", DoubleClick: "Double-Click", NoZoom: "No Zoom", - TriggerRequires: "Trigger Requires:", //NOTE This menu item determines if the ZoomTrigger requires additional keys - Option: "Option", //NOTE refers to Apple-style OPTION key - Alt: "Alt", - Command: "Command", //NOTE This menu item Apple-style COMMAND key + TriggerRequires: "Trigger Requires:", // NOTE: This menu item determines if the ZoomTrigger requires additional keys + Option: "Option", // NOTE: refers to Apple-style OPTION key + Alt: "Alt", // NOTE: refers to Windows-style ALT key + Command: "Command", // NOTE: refers to Apple-style COMMAND key Control: "Control", Shift: "Shift", ZoomFactor: "Zoom Factor", - Renderer: "Math Renderer",//NOTE This menu changes the output extension used by MathJax - MPHandles: "Let MathPlayer Handle:",//NOTE MathJax recognizes MathPlayer when present. This submenu deals with MathJax/MathPlayer interaction. - MenuEvents: "Menu Events", - MouseEvents: "Mouse Events", + Renderer: "Math Renderer", // NOTE: This menu changes the output processor used by MathJax + MPHandles: "Let MathPlayer Handle:", // NOTE: MathJax recognizes MathPlayer when present. This submenu deals with MathJax/MathPlayer interaction. + MenuEvents: "Menu Events", // NOTE: refers to contextual menu selections + MouseEvents: "Mouse Events", // NOTE: refers to mouse clicks MenuAndMouse: "Mouse and Menu Events", - FontPrefs: "Font Preferences", //NOTE This menu item is mostly used for develoment purposes + FontPrefs: "Font Preferences", // NOTE: This menu item allows selection of the font to use (and is mostly for development purposes) ForHTMLCSS: "For HTML-CSS:", Auto: "Auto", - TeXLocal: "TeX (local)", //NOTE 'TeX' refers to the MathJax fonts + TeXLocal: "TeX (local)", // NOTE: 'TeX' refers to the MathJax fonts TeXWeb: "TeX (web)", TeXImage: "TeX (image)", STIXLocal: "STIX (local)", ContextMenu: "Contextual Menu", Browser: "Browser", - Scale: "Scale All Math ...", //NOTE This menu item allows users to set a scaling factor for the MathJax output (relative to the surrounding content) + Scale: "Scale All Math ...", // NOTE: This menu item allows users to set a scaling factor for the MathJax output (relative to the surrounding content) Discoverable: "Highlight on Hover", Locale: "Language", LoadLocale: "Load from URL ...", About: "About MathJax", Help: "MathJax Help", - localTeXfonts: "using local TeX fonts", //NOTE This section deals with the 'About' overlay popup + localTeXfonts: "using local TeX fonts", // NOTE: This section deals with the 'About' overlay popup webTeXfonts: "using web TeX font", imagefonts: "using Image fonts", localSTIXfonts: "using local STIX fonts", @@ -55,7 +55,7 @@ MathJax.Localization.addTranslation("en","MathMenu",{ eotffonts: "eot fonts", svgfonts: "svg fonts", - WebkitNativeMMLWarning: //NOTE This section deals with warnings for when a user changes the rendering output via the MathJax menu but a browser does not support the chosen mechanism + WebkitNativeMMLWarning: // NOTE: This section deals with warnings for when a user changes the rendering output via the MathJax menu but a browser does not support the chosen mechanism "Your browser doesn't seem to support MathML natively, " + "so switching to MathML output may cause the mathematics " + "on the page to become unreadable.", @@ -97,7 +97,7 @@ MathJax.Localization.addTranslation("en","MathMenu",{ "(Press OK to switch, CANCEL to continue with the current renderer)", ScaleMath: - "Scale all mathematics (compared to surrounding text) by", //NOTE This section deals with 'MathJax menu-> Scale all math' + "Scale all mathematics (compared to surrounding text) by", // NOTE: This section deals with 'MathJax menu-> Scale all math' NonZeroScale: "The scale should not be zero", @@ -105,7 +105,7 @@ MathJax.Localization.addTranslation("en","MathMenu",{ PercentScale: "The scale should be a percentage (e.g., 120%%)", - IE8warning: //NOTE This section deals with MathPlayer hand-over + IE8warning: // NOTE: This section deals with MathPlayer and menu/mouse event handling "This will disable the MathJax menu and zoom features, " + "but you can Alt-Click on an expression to obtain the MathJax " + "menu instead.\n\nReally change the MathPlayer settings?", @@ -115,10 +115,10 @@ MathJax.Localization.addTranslation("en","MathMenu",{ "Alt-Click on an expression to obtain the MathJax menu instead.", NoOriginalForm: - "No original form available", //NOTE This refers to missing source formats when using 'MathJax Menu -> show math as" + "No original form available", // NOTE: This refers to missing source formats when using 'MathJax Menu -> show math as" Close: - "Close", //NOTE for closing overlay popups like the 'MathJax Menu => about MathJax' box. + "Close", // NOTE: for closing button in the 'MathJax Menu => SHow Math As' window. EqSource: "MathJax Equation Source" diff --git a/unpacked/localization/en/TeX.js b/unpacked/localization/en/TeX.js index 03e922445..3300f51c3 100644 --- a/unpacked/localization/en/TeX.js +++ b/unpacked/localization/en/TeX.js @@ -1,21 +1,21 @@ -MathJax.Localization.addTranslation("en","TeX",{ //NOTE use correct ISO name TODO autopopulate? +MathJax.Localization.addTranslation("en","TeX",{ isLoaded: true, strings: { ExtraOpenMissingClose: - "Extra open brace or missing close brace", //NOTE TeX commands use braces and brackets as delimiters + "Extra open brace or missing close brace", // NOTE: TeX commands use braces and brackets as delimiters ExtraCloseMissingOpen: "Extra close brace or missing open brace", MissingLeftExtraRight: - "Missing \\left or extra \\right", //NOTE do not translate \\left and \\right, they are TeX commands + "Missing \\left or extra \\right", // NOTE: do not translate \\left and \\right; they are TeX commands MissingScript: "Missing superscript or subscript argument", ExtraLeftMissingRight: - "Extra \\left or missing \\right", //NOTE do not translate \\left and \\right, they are TeX commands + "Extra \\left or missing \\right", // NOTE: do not translate \\left and \\right; they are TeX commands Misplaced: "Misplaced %1", @@ -27,72 +27,72 @@ MathJax.Localization.addTranslation("en","TeX",{ //NOTE use correct ISO name TOD "Missing open brace for superscript", AmbiguousUseOf: - "Ambiguous use of %1", //NOTE %1 will be a TeX command + "Ambiguous use of %1", // NOTE: %1 will be a TeX command EnvBadEnd: - "\\begin{%1} ended with \\end{%2}", //NOTE do not translate \\begin{%1} and \\end{{%1}}, they are TeX commands + "\\begin{%1} ended with \\end{%2}", // NOTE: do not translate \\begin{%1} and \\end{%1}; they are TeX commands EnvMissingEnd: - "Missing \\end{%1}", //NOTE do not translate \\end + "Missing \\end{%1}", // NOTE: do not translate \\end MissingBoxFor: - "Missing box for %1", //NOTE refers to TeX boxes + "Missing box for %1", //NOTE: refers to TeX boxes MissingCloseBrace: "Missing close brace", UndefinedControlSequence: - "Undefined control sequence %1", //NOTE %1 will be a TeX command + "Undefined control sequence %1", // NOTE: %1 will be a TeX command DoubleExponent: - "Double exponent: use braces to clarify", // NOTE example: x^3^2 should be x^{3^2} or {x^3}^2 + "Double exponent: use braces to clarify", // NOTE: example: x^3^2 should be x^{3^2} or {x^3}^2 DoubleSubscripts: "Double subscripts: use braces to clarify", DoubleExponentPrime: - "Prime causes double exponent: use braces to clarify", //NOTE example TODO + "Prime causes double exponent: use braces to clarify", // NOTE: example: x^a' should be {x^a}' or x^{a'} CantUseHash1: - "You can't use 'macro parameter character #' in math mode", //NOTE '#' is used in TeX macros + "You can't use 'macro parameter character #' in math mode", // NOTE: '#' is used in TeX macros MisplacedMiddle: - "%1 must be within \\left and \\right", //NOTE do not translate \\left and \\right, they are TeX commands + "%1 must be within \\left and \\right", // NOTE: do not translate \\left and \\right; they are TeX commands MisplacedLimits: - "%1 is allowed only on operators", + "%1 is allowed only on operators", // NOTE: %1 will be \limits MisplacedMoveRoot: - "%1 can appear only within a root", + "%1 can appear only within a root", // NOTE: %1 will be \uproot or \leftroot MultipleCommand: - "Multiple %1", //NOTE happens when a command or token can only be preset once + "Multiple %1", // NOTE: happens when a command or token can only be present once, e.g., \tag{} IntegerArg: "The argument to %1 must be an integer", NotMathMLToken: - "%1 is not a token element", //NOTE MathJax has a non-standard /mmltoken command to insert MathML token elements + "%1 is not a token element", // NOTE: MathJax has a non-standard \mmltoken command to insert MathML token elements InvalidMathMLAttr: - "Invalid MathML attribute: %1", //NOTE MathJax has non standard MathML and HTML related commands which can contain attributes + "Invalid MathML attribute: %1", // NOTE: MathJax has non standard MathML and HTML related commands which can contain attributes UnknownAttrForElement: "%1 is not a recognized attribute for %2", MaxMacroSub1: - "MathJax maximum macro substitution count exceeded; " + //NOTE MathJax has a limited for iterating macros + "MathJax maximum macro substitution count exceeded; " + // NOTE: MathJax limits the number of macro substitutions to prevent infinite loops "is there a recursive macro call?", MaxMacroSub2: - "MathJax maximum substitution count exceeded; " +//NOTE MathJax has a limited for iterating substitutions + "MathJax maximum substitution count exceeded; " + // NOTE: MathJax limits the number of nested environements to prevent infinite loops "is there a recursive latex environment?", MissingArgFor: - "Missing argument for %1", + "Missing argument for %1", // NOTE: %1 will be a macro name ExtraAlignTab: - "Extra alignment tab in \\cases text", //NOTE do not translate //cases + "Extra alignment tab in \\cases text", // NOTE: do not translate \\cases; it is a TeX command BracketMustBeDimension: "Bracket argument to %1 must be a dimension", @@ -119,7 +119,7 @@ MathJax.Localization.addTranslation("en","TeX",{ //NOTE use correct ISO name TOD "Missing dimension or its units for %1", TokenNotFoundForCommand: - "Couldn't find %1 for %2", + "Couldn't find %1 for %2", // NOTE: %1 is a token (e.g.,macro or symbol) and %2 is a macro name MathNotTerminated: "Math not terminated in text box", @@ -139,10 +139,10 @@ MathJax.Localization.addTranslation("en","TeX",{ //NOTE use correct ISO name TOD "Label '%1' multiply defined", CommandAtTheBeginingOfLine: - "%1 must come at the beginning of the line", + "%1 must come at the beginning of the line", // NOTE: %1 will be a macro name IllegalAlign: - "Illegal alignment specified in %1", + "Illegal alignment specified in %1", // NOTE: %1 will be an environment name BadMathStyleFor: "Bad math style for %1", @@ -167,10 +167,10 @@ MathJax.Localization.addTranslation("en","TeX",{ //NOTE use correct ISO name TOD /* begingroup */ ExtraEndMissingBegin: - "Extra %1 or missing \\begingroup", + "Extra %1 or missing \\begingroup", // NOTE: do not translate \\begingroup GlobalNotFollowedBy: - "%1 not followed by \\let, \\def, or \\newcommand", + "%1 not followed by \\let, \\def, or \\newcommand", // NOTE: do not translate \\let, \\def, or \\newcommand; they are TeX commands /* color */ @@ -203,7 +203,7 @@ MathJax.Localization.addTranslation("en","TeX",{ //NOTE use correct ISO name TOD /* mhchem */ NoClosingChar: - "Can't find closing %1", + "Can't find closing %1", // NOTE: %1 will be ) or } or ] /* newcommand */ diff --git a/unpacked/localization/en/en.js b/unpacked/localization/en/en.js index 3cee86ea9..3dc809ccb 100644 --- a/unpacked/localization/en/en.js +++ b/unpacked/localization/en/en.js @@ -15,31 +15,37 @@ MathJax.Localization.addTranslation("en",null,{ // NOTE use correct ISO-639-1 tw "Math Processing Error", // NOTE: MathJax uses 'Math' as a distinct UI choice. Please translate it literally whenever possible. MathError: - "Math Error", // generic error message + "Math Error", // Error message used in obsolete Accessible configurations - LoadFile: "Loading %1", + LoadFile: + "Loading %1", - Loading: "Loading", // NOTE followed by growing sequence of dots + Loading: + "Loading", // NOTE: followed by growing sequence of dots - LoadFailed: "File failed to load: %1", + LoadFailed: + "File failed to load: %1", - ProcessMath: "Processing Math: %1%%", //NOTE appears during the conversion process from an input format (e.g., LaTeX, asciimath) to MathJax's internal format + ProcessMath: + "Processing Math: %1%%", // NOTE: appears during the conversion process from an input format (e.g., LaTeX, asciimath) to MathJax's internal format - Processing: "Processing", //NOTE followed by growing sequence of dots + Processing: + "Processing", // NOTE: followed by growing sequence of dots - TypesetMath: "Typesetting Math: %1%%",//NOTE appears during the layout process of converting the internal format to the output format + TypesetMath: + "Typesetting Math: %1%%", // NOTE: appears during the layout process of converting the internal format to the output format - Typesetting: "Typesetting", //NOTE followed by growing sequence of dots + Typesetting: + "Typesetting", // NOTE: followed by growing sequence of dots MathJaxNotSupported: - "Your browser does not support MathJax" //NOTE will load when MathJax determines the browser does not have adequate features + "Your browser does not support MathJax" // NOTE: will load when MathJax determines the browser does not have adequate features } }, MathMenu: {}, FontWarnings: {}, HelpDialog: {}, - "v1.0-warning": {}, TeX: {}, MathML: {}, "HTML-CSS": {} diff --git a/unpacked/localization/en/v1.0-warning.js b/unpacked/localization/en/v1.0-warning.js deleted file mode 100644 index e4bbed506..000000000 --- a/unpacked/localization/en/v1.0-warning.js +++ /dev/null @@ -1,14 +0,0 @@ -MathJax.Localization.addTranslation("en","v1.0-warning",{ - isLoaded: true, - strings: { - - MissingConfig: - "MathJax no longer loads a default configuration file; " + - "you must specify such files explicitly. " + - "This page seems to use the older default %1 " + - "file, and so needs to be updated. This is explained further at %2" - - } -}); - -MathJax.Ajax.loadComplete("[MathJax]/localization/en/v1.0-warning.js"); diff --git a/unpacked/localization/fr/fr.js b/unpacked/localization/fr/fr.js index 661172043..741263a51 100644 --- a/unpacked/localization/fr/fr.js +++ b/unpacked/localization/fr/fr.js @@ -39,7 +39,6 @@ MathJax.Localization.addTranslation("fr",null,{ MathMenu: {}, FontWarnings: {}, HelpDialog: {}, - "v1.0-warning": {}, TeX: {}, MathML: {}, "HTML-CSS": {} diff --git a/unpacked/localization/fr/v1.0-warning.js b/unpacked/localization/fr/v1.0-warning.js deleted file mode 100644 index 51eb09d5a..000000000 --- a/unpacked/localization/fr/v1.0-warning.js +++ /dev/null @@ -1,15 +0,0 @@ -MathJax.Localization.addTranslation("fr","v1.0-warning",{ - isLoaded: true, - strings: { - - MissingConfig: - "MathJax ne charge plus de fichier de configuration par d\u00E9faut; "+ - "vous devez sp\u00E9cifier ces fichiers de fa\u00E7ons explicites. Cette "+ - "page semble utiliser l'ancien fichier de configuration par "+ - "d\u00E9faut %1 et doit donc \u00EAtre mise \u00E0 jour. Ceci est expliqu\u00E9 "+ - "en d\u00E9tails \u00E0 l'addresse suivante: %2" - - } -}); - -MathJax.Ajax.loadComplete("[MathJax]/localization/fr/v1.0-warning.js"); From bdb131a907653c2f9e5ac2289624d196a52c0a16 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 23 Apr 2013 09:32:09 -0400 Subject: [PATCH 41/41] Fix German title in initial language list. Add missing commas and fix incorrect unicode in German HelpDialog. --- unpacked/MathJax.js | 2 +- unpacked/localization/de/HelpDialog.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index f2ff558f0..cc638f2aa 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1059,7 +1059,7 @@ MathJax.Localization = { directory: "[MathJax]/localization", strings: { en: {isLoaded: true, menuTitle: "English"}, // nothing needs to be loaded for this - de: {menuTitle: "Deutch"}, + de: {menuTitle: "Deutsch"}, fr: {menuTitle: "Fran\u00E7ais"} }, diff --git a/unpacked/localization/de/HelpDialog.js b/unpacked/localization/de/HelpDialog.js index 5778b3128..3773057a7 100644 --- a/unpacked/localization/de/HelpDialog.js +++ b/unpacked/localization/de/HelpDialog.js @@ -9,50 +9,50 @@ MathJax: "*MathJax* ist eine JavaScript-Bibliothek, die Autoren erlaubt, " + "Ihren Webseiten mathematische Inhalte hinzuzuf\u00FCgen. Als Besucher " + - "m\u00FCssen sie nichts zus\u00E4tzliches tun, damit MathJax funktioniert." + "m\u00FCssen sie nichts zus\u00E4tzliches tun, damit MathJax funktioniert.", // "*MathJax* is a JavaScript library that allows page authors to include " + // "mathematics within their web pages. As a reader, you don't need to do " + // "anything to make that happen.", Browsers: "*Browser*: MathJax ist kompatibel zu allen modernen Webbrowsern inklusive " + - "IE6+, Firefox 3+, Chrome 0.2+, Safari 2+, Opera 9.6+ und g\u00E4ngigen mobilen Browsern." + "IE6+, Firefox 3+, Chrome 0.2+, Safari 2+, Opera 9.6+ und g\u00E4ngigen mobilen Browsern.", // "*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " + // "Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers.", Menu: "*Mathe Men\u00FC*: MathJax f\u00FCgt ein Kontextmen\u00FC bei allen Formen hinzu. " + - "Es wird mit Rechtsklick oder STRG+Linksklick auf einer Formel aufgerufen." + "Es wird mit Rechtsklick oder STRG+Linksklick auf einer Formel aufgerufen.", // "*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " + // "CTRL-click on any mathematics to access the menu.", ShowMath: - "*Zeige Mathe als* erlaubt es, eine Formel im Quellformat anzuzeigen, " //NOTE needs to match menu item translations! - "um Kopieren und Einf\u00FCgen (als MathML oder im Originalformat) zu erm00F6glichen." + "*Zeige Mathe als* erlaubt es, eine Formel im Quellformat anzuzeigen, " + //NOTE needs to match menu item translations! + "um Kopieren und Einf\u00FCgen (als MathML oder im Originalformat) zu erm00F6glichen.", // "*Show Math As* allows you to view the formula's source markup " + // "for copy & paste (as MathML or in its origianl format).", Settings: - "*Einstellungen* erlabut es, das Verhalten von MathJax zu modifizieren, "+ //NOTE needs to match menu item translations! - "so z.B. die Gr\u00CS\u00DFe der Mathematik sowie den Ausgabemechanismus." + "*Einstellungen* erlabut es, das Verhalten von MathJax zu modifizieren, " + //NOTE needs to match menu item translations! + "so z.B. die Gr\u00F6\u00DFe der Mathematik sowie den Ausgabemechanismus.", // "*Settings* gives you control over features of MathJax, such as the " + // "size of the mathematics, and the mechanism used to display equations.", Language: "*Sprache* erlaubt es, die Sprache zu wechseln, die MathJax im Men\u00FC " + //NOTE needs to match menu item translations! - "und den Warnmeldungen verwendent." + "und den Warnmeldungen verwendent.", // "*Language* lets you select the language used by MathJax for its menus " + // "and warning messages.", Zoom: "*Zoom*: Falls das Lesen der Formeln schwer f\u00E4llt, kann MathJax diese " + //NOTE needs to match menu item translations! - "vergr\u00CS\u00DFern, um es zu erleichtern." + "vergr\u00F6\u00DFern, um es zu erleichtern.", // "*Math Zoom*: If you are having difficulty reading an equation, MathJax can " + // "enlarge it to help you see it better.", Accessibilty: "*Barrierfreiheit*: MathJax arbeite automatisch mit g\u00E4ngigen Screenreadern " + - "zusammen, um Mathematik barrierefrei darzustellen." + "zusammen, um Mathematik barrierefrei darzustellen.", // "*Accessibility*: MathJax will automatically work with screen readers to make " + // "mathematics accessible to the visually impaired.",