Opened 8 years ago
Closed 8 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)
Change History (6)
Changed 8 years ago by
Attachment: | webuierror.gif added |
---|
comment:1 Changed 8 years ago by
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 8 years ago by
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 8 years ago by
Owner: | changed from Adam Peller to ghurtado |
---|---|
Status: | new → pending |
comment:4 Changed 8 years ago by
Status: | pending → new |
---|
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 8 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.
Error in IE8