Locale handling

Rintze asked about locale priorities yesterday, which reminded me that
this needed to be fixed in citeproc-js. It’s now been set up, subject
to confirmation that it’s not set up wrongly. I haven’t checked any
RFCs or anything, but it all seems pretty straightforward. Here’s the
overlay hierarchy, using Austrian as an example. The last-loaded
locale node is at the top of the list:


  • = in-style locales
    ** = on-disk locales

Note that the “base” atop which more specific locales are loaded
differs between the disk files and the in-style locales. The former
uses en-US as the base (a failsafe in case a non-existent locale is
specified), followed by the most-common dialect of the target language
(if it differs from English). The latter uses the empty locale,
followed by the undelimited language. I don’t think this is likely to
surprise anyone, but this description just in case there’s a problem
lurking in there that I haven’t spotted.


I think this is correct. For the other people following this, note that this
priority list assumes that:

  1. locales files are only created for country languages (e.g. “de-AT” and
    "de-DE", but not “de”). I don’t think this should be a problem.
  2. an empty locale (i.e. cs:locale in a style lacking the xml:lang
    attribute) is valid CSL. This is still an open ticket, although I don’t
    expect a lot of resistance here:

RintzeOn Thu, Dec 10, 2009 at 8:04 AM, Frank Bennett <@Frank_Bennett>wrote: