Opened 7 years ago

Closed 7 years ago

#16838 closed defect (invalid)

Bundle not found for specified locale warning message displayed in IE only

Reported by: ghurtado Owned by: ghurtado
Priority: undecided Milestone: tbd
Component: Internationalization Version: 1.4.3
Keywords: Cc:
Blocked By: Blocking:

Description

Environment

Dojo Version 1.4.3
Internet Explorer 8
Windows 7 OS (Non-English locale. i.e: Danish)

Problem Description

IE displays a "Bundle not found" warning message ONLY when opening a link to the web application from an external document such as MS Word, or Outlook. Note that IE is set to be the default system browser.

The message is thrown in the getLocalization method of the i18n.j module. When opening a localization package, the code attempts to find the requested locale and throws an error if the locale is not found. For some reason, when the link is open from an external document such as MS Word (Windows 7 Danish install in this scenario) IE passes "da" for the locale and it is omitting the optional "Dk" country locale. In the method dojo.i18n.getLocalization, bundleda? is undefined and then the "Bundle Not Found" error is displayed.

Refreshing the page however causes "da-DK" to be passed as the locale instead. Find the code in question below:

CODE BEGIN

dojo.i18n.getLocalization = function(/*String*/packageName, /*String*/bundleName, /*String?*/locale){

summary: Returns an Object containing the localization for a given resource bundle in a package, matching the specified locale. description: Returns a hash containing name/value pairs in its prototypesuch that values can be easily overridden. Throws an exception if the bundle is not found. ...

locale = dojo.i18n.normalizeLocale(locale);

look for nearest locale match var elements = locale.split('-'); var module = [packageName,"nls",bundleName].join('.'); var bundle = dojo._loadedModules[module]; if(bundle){

var localization; for(var i = elements.length; i > 0; i--){

var loc = elements.slice(0, i).join('_');

Attachments (1)

webuierror.gif (78.9 KB) - added by ghurtado 7 years ago.
Error in IE8

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by ghurtado

Attachment: webuierror.gif added

Error in IE8

comment:1 Changed 7 years ago by ghurtado

The code snipped was trimmed in the previous message....

CODE BEGINS

dojo.i18n.getLocalization = function(/*String*/packageName, /*String*/bundleName, /*String?*/locale){

summary: Returns an Object containing the localization for a given resource bundle in a package, matching the specified locale. description: Returns a hash containing name/value pairs in its prototypesuch that values can be easily overridden. Throws an exception if the bundle is not found. ...

locale = dojo.i18n.normalizeLocale(locale);

look for nearest locale match var elements = locale.split('-'); var module = [packageName,"nls",bundleName].join('.'); var bundle = dojo._loadedModules[module]; if(bundle){

var localization; for(var i = elements.length; i > 0; i--){

var loc = elements.slice(0, i).join('_');


bundle is undefined here if locale="da"

if(bundle[loc]){ localization = bundle[loc]; break;

}

}

... We hit this error.

throw new Error("Bundle not found: " + bundleName + " in " + packageName+" , locale=" + locale); };

CODE END

comment:2 Changed 7 years ago by Adam Peller

It's difficult to speculate on what's causing this problem without digging into the application. I suggest you file this ticket at the jazz project. To be clear: did passing the country variant make any difference? (should be all lowercase, e.g. da-dk) It would be uncommon to provide translations specific to country variants for Danish.

comment:3 Changed 7 years ago by Adam Peller

Owner: changed from Adam Peller to ghurtado
Status: newpending

comment:4 Changed 7 years ago by ghurtado

Status: pendingnew

I have also created a ticket on the jazz project. To answer your question about the country variant, I examined the HTTP headers that are sent to the server and I see that when I enter the URL directly into IE - or after I refresh the page in IE - the country variant is passed in the request.

comment:5 Changed 7 years ago by Adam Peller

Resolution: invalid
Status: newclosed

Dojo is unaware of the accept-language locale headers being passed in HTTP (if that's what you're referring to) only what is set in dojo-config and reported as the locale by the navigator object. There may be some negotiation done by the server-side application.

Note: See TracTickets for help on using tickets.