return false when a locales file cannot be found, instead of throwing an error

This commit is contained in:
Simon Kornblith 2010-06-03 03:09:10 +00:00
parent 7b062f3b15
commit 69a962be90

View file

@ -203,8 +203,12 @@ Zotero.Cite.System.retrieveLocale = function(lang) {
var xhr = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance();
xhr.open("GET", "chrome://zotero/content/locale/csl/locales-"+lang+".xml", false);
xhr.overrideMimeType("application/octet-stream");
xhr.send();
return xhr.responseText;
try {
xhr.send();
return xhr.responseText;
} catch(e) {
return false;
}
};
Zotero.Cite.System.getAbbreviations = function() {