From f42ac43cd47e35e06f195c96d179701feaed02d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Thu, 8 Aug 2013 10:30:36 +0200 Subject: [PATCH] Fix more localization errors and update the test/localization.html accordingly ; Also force all menu items to display in the test. #529 --- test/localization.html | 73 +++++++++++++-------------- unpacked/extensions/TeX/newcommand.js | 4 +- unpacked/jax/input/TeX/jax.js | 5 +- 3 files changed, 39 insertions(+), 43 deletions(-) diff --git a/test/localization.html b/test/localization.html index fb2a32e95..1fc54c21c 100644 --- a/test/localization.html +++ b/test/localization.html @@ -48,16 +48,7 @@ /* set the currentLocale */ MathJax.Hub.Config({ - menuSettings: { locale: currentLocale }, - MathMenu: { - showRenderer: true, - showMathPlayer: true, - showFontMenu: true, - showContext: true, - showDiscoverable: true, - showLocale: true, - showLocaleURL: true - } + menuSettings: { locale: currentLocale } }); var menu = MathJax.HTML.Cookie.Get("menu"); menu.locale = currentLocale; @@ -102,14 +93,23 @@ message += MathJax.Localization._(["MathMenu","SwitchAnyway"], _M_); alert(message); } + function showAllItems(aMenu) + { + for (var i = 0, m = aMenu.items.length; i < m; i++) { + var item = aMenu.items[i]; + item.hidden = false; + item.disabled = false; + if (item.menu) showAllItems(item.menu); + } + } + MathJax.Hub.Register.StartupHook("MathMenu Ready", function () { + showAllItems(MathJax.Menu.menu); + }); - /* Simulate some error messages... */ + /* These MathML parsing errors happen only in rare cases, so we fake them... */ MathJax.Hub.Queue(function() { document.getElementById('ErrorParsingMathML').innerHTML = MathJax.Localization._(['MathML','ErrorParsingMathML'], _M_); document.getElementById('MathMLSingleElement').innerHTML = MathJax.Localization._(['MathML','MathMLSingleElement'], _M_); - document.getElementById('MissingOpenForSub').innerHTML = MathJax.Localization._(['TeX','MissingOpenForSub'], _M_); - document.getElementById('MissingBoxFor').innerHTML = MathJax.Localization._(['TeX','MissingBoxFor'], _M_, 'COMMANDNAME'); - document.getElementById('ExtraClose').innerHTML = MathJax.Localization._(['TeX','ExtraClose'], _M_); }); @@ -152,14 +152,10 @@
  • CantCreateXMLParser:
  • UnknownNodeType:
  • UnexpectedTextNode: UNEXPECTEDTEXT
  • -
  • ErrorParsingMathML: - - +
  • ErrorParsingMathML:
  • ParsingError:
  • -
  • MathMLSingleElement: - - +
  • MathMLSingleElement:
  • MathMLRootElement:
  • @@ -173,14 +169,25 @@
  • MathMenu: -