# Locale handling

**URL:** <https://discourse.citationstyles.org/t/locale-handling/801>\
**Category:** CSL Development\
**Created:** [December 10, 2009, 7:04am UTC](https://discourse.citationstyles.org/t/locale-handling/801 "2009-12-10T07:04:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [December 10, 2009, 7:04am UTC](https://discourse.citationstyles.org/t/locale-handling/801/1 "2009-12-10T07:04:53Z")

</div>

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:

\*de-AT  
\*de  
\*""  
\*\*de-AT  
\*\*de-DE  
\*\*en-US

- = 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.

Frank

---

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [December 10, 2009, 9:39am UTC](https://discourse.citationstyles.org/t/locale-handling/801/2 "2009-12-10T09:39:56Z")

</div>

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:  
[http://bitbucket.org/bdarcus/csl-schema/issue/11/allow-locale-element-in-style-with-no-xml-lang](http://bitbucket.org/bdarcus/csl-schema/issue/11/allow-locale-element-in-style-with-no-xml-lang)

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