[sword-devel] Locale - proposal

Chris Little chrislit at crosswire.org
Fri Jan 3 16:08:18 MST 2014

On 1/3/2014 2:03 PM, DM Smith wrote:
> Troy,
> Chris has documented that the locale mechanism should look for 3 things: language, optional country and optional script. The code as it stands works for any two, treating script as country (I didn't look but assume that country can take a 4 character script.).
> The standard (I read it at one point but am not sure what its designation is) has the names in one of the following orders:
> L
> LC
> LS
> There is a separator between them but not sure whether _ or -. And the casing of the parts is well defined. L - lower, C - UPPER, S - Title (If I remember correctly).
> Here is some Microsoft documentation on it: http://msdn.microsoft.com/en-us/library/windows/desktop/dd373814(v=vs.85).aspx

The relevant standard is BCP 47: https://tools.ietf.org/html/bcp47

The standard separator is hyphen (-), but use of underscore is common. 
POSIX locales, for example, use underscore. I guess hyphen should be 
preferred, but we should accept underscores and map them to hyphens. In 
any case, they are treated identically and underscore is never permitted 
by BCP 47, so folding them together as hyphens is safe.


More information about the sword-devel mailing list