[Xsltforms-support] Problem with locale while loading message with XsltForms_globals.language != na
Brought to you by:
alain-couthures
From: Javier D. <jd...@tc...> - 2012-06-06 17:36:07
|
Hello, I have a problem with loading message while using XsltForms_globals.language != navigator (for example, "es"). When it is loading, internationalized message is loaded here: init : function() { XsltForms_browser.setValue(document.getElementById("statusPanel"), XsltForms_browser.i18n.get("status")); var b = XsltForms_browser.isXhtml ? document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "body")[0] : document.getElementsByTagName("body")[0]; Inside "XsltForms_browser.i18n.get("status")" we have: if (XsltForms_globals.language === "navigator" || XsltForms_globals.language !== XsltForms_browser.selectSingleNodeText('language', XsltForms_browser.config)) { var lan = XsltForms_globals.language === "navigator" ? (navigator.language || navigator.userLanguage) : XsltForms_browser.selectSingleNodeText('language', XsltForms_browser.config); lan = lan.replace("-", "_").toLowerCase(); If "XsltForms_globals.language" equals "navigator", everything is OK, but when it is any other value, no language is retrieved because XsltForms_browser.config value is "dummy". Its content is loaded after, in this line at the end of init method: XsltForms_xmlevents.dispatchList(this.models, "xforms-model-construct"); Although it were loaded before, it would still fail because in config.xsl it says language value must be "navigator" or "default". I have done this change and it seems it is working: if (XsltForms_globals.language === "navigator" || XsltForms_globals.language !== XsltForms_browser.selectSingleNodeText('language', XsltForms_browser.config)) { - var lan = XsltForms_globals.language === "navigator" ? (navigator.language || navigator.userLanguage) : XsltForms_browser.selectSingleNodeText('language', XsltForms_browser.config); + var lan = XsltForms_globals.language === "navigator" ? (navigator.language || navigator.userLanguage) : XsltForms_globals.language; Best Regards, Javier ************************************************************************************************************************************************ *La información contenida en este mensaje de correo electrónico es confidencial y puede revestir el carácter de reservada. * *Está dirigida exclusivamente a la persona destinataria. * *El acceso o cualquier uso por parte de cualquier otra persona de este mensaje no están autorizados y pueden ser ilegales.* *Si no es Ud. la persona destinataria, le rogamos que proceda a borrarlo. * *The information in this e-mail is confidential and may be legally privileged. * *It is intended solely for the addressee. * *Access or any use by any other person to this Internet e-mail is not authorised and may be unlawful. * *If you are not the intended recipient, please delete this e-mail. * ************************************************************************************************************************************************ |