tags:

views:

197

answers:

1

Hi All, I'm using Dijit.dialog widget. I've set the "lang" attibute's value to en-US. But still when I hover on the Cancel button I see the tool tip in some other language. Can someone please help to change the default language of the widget? Thanks in advance.

Thanks, Steve

+1  A: 

Try setting djConfig.locale when you load dojo.js. Otherwise, the browser's default will be used to load localizations (navigator.language) Make sure to use all lowercase and treat it as a quoted string (e.g. "en-us") The 'lang' attribute on Widgets is only for edge cases where you want to specify something other than the declared locale for the page, and even then you'd need to specify it at load time using djConfig.extraLocale.

HTH

peller
djConfig is really meant to be configurable by web apps; hard-coding locales anywhere should be avoided if you want your app to be flexible to work in other locales.
peller
Thank you very much for you kind reply Pellar. I tried setting the locale to "en-us" in djConfig. Still I'm seeing the tooltip in other locale. Please find the imagehttp://www.freecodesource.com/image-hosting/view/img137/7893/dialoglocale.jpg/
Steve
Hi Steve. That link doesn't seem to work for me, and even so the image probably wouldn't help me; I'd need to see the page source. Are you setting djConfig on the script tag that loads dojo.js or prior to loading dojo.js, as described in the link above?
peller
Thank you very much for your reply.I'm using IBM Websphere Portal. It is set before loading dojo.js file.<script type="text/javascript">var djConfig = {parseOnLoad: false, locale: 'en-us', baseUrl: "/MyTheme/themes/./dojo/portal_dojo/dojo/"};</script>dojo.js file is called after this.
Steve
Looks right to me. You could try inspecting dojo.locale after page load to make sure it gets set to 'en-us'. Otherwise, I'd have to suggest reducing this to a simple test page so we can figure out what's going on.
peller
Hi Pellar I've removed the lang attribute from the widget. Also I'm able to create the issue on a sample test page.http://img511.imageshack.us/img511/6678/dialogtooltip1.jpg. Browser's locale is set to en-us. The issue is there with both Firefox and IE
Steve
That setting actually does not affect Dojo. It's only for the HTTP header. The browser's locale as available to javascript (navigator.language) is fixed.If you can post the sample test page somewhere, I'd be happy to look at it.
peller
Thank you very much for your reply. I've uploaded the test html file to http://www.4shared.com/file/147185272/ec4acff4/Dialog_Test.html. Please let me know if any further information is required. I'm using dojo version 1.3.2.
Steve
Hi Pellar, I was able to download the document and see the HTML file. Is it possible to send the HTML file to your mail address? Please let me know.
Steve
Hi Peller,I've sent the file to your mail id. Please check.
Steve