﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc
541,Option to force use of English (or any arbitrary locale?) in bibliographies,dstillman,dstillman,"From http://forums.zotero.org/discussion/441/:

   ''I would like to generate my bibliography in english. At the moment, the bibliography contains the dutch expression 'en anderen' instead of the desired 'et al.' ''

I'm not totally clear on how the locale-handling works in cite.js, but along with a pref to force the locale, we presumably also need a way of accessing a specific locales.xml file. The easiest thing to do would probably be to just have the pref to force English and say to use a different localized Firefox to generate bibliographies in another language. Otherwise, I guess we could move the locales.xml file out of the locale directories and into a common directory and just include the locale in the filename, e.g. locales-en-US.xml. That would probably be the most flexible solution.

The other possibly involved issue here is that Zotero.locale, from getLocaleComponentForUserAgent(), seems to use the system locale, not the Firefox locale. I don't think we want to do anything based on the system locale (as it's returning en-US for me even if I use a German locale). Even getApplicationLocale().getCategory(""NSILOCALE_MESSAGES"") is returning 'en-US' for me, which seems totally wrong.

I can get the application locale with the following code:

{{{
var ph = Components.classes[""@mozilla.org/network/protocol;1?name=http""].getService(Components.interfaces.nsIHttpProtocolHandler);
if (ph.language.length == 2) {
   this.locale = ph.language + '-' + ph.language.toUpperCase();
}
else {
   this.locale = ph.language;
}
}}}

nsIHTTPPH.language is the same as navigator.language. It returns a two-character code if the language and country code are the same ('de-DE' returns just 'de') and a five-character code otherwise (e.g. 'en-US').

So perhaps we should use that to set Zotero.locale, move the locales.xml files to a common directory and rename them based on their locales, put in the ability to override Zotero.locale with a pref, and grab the appropriate locales-*.xml file, falling back to English (locales-en-US.xml) if a string isn't available.

Simon, if that all seems reasonable, I can take care of the pref/Zotero.locale/locales*.xml part if you want, leaving you the cite.js part.",enhancement,closed,minor,1.5 Beta 1,export,1.5,fixed,localization,simon stakats
