Bug 63927 - Inconsistent mapping of Norwegian locales for date formats
Summary: Inconsistent mapping of Norwegian locales for date formats
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2019-11-15 07:55 UTC by JDM
Modified: 2019-12-08 23:38 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description JDM 2019-11-15 07:55:58 UTC
In class org.apache.poi.ss.util.DateFormatConverter, the locale mapping is defined as:
result.put( "nn", "[$-0814]" ); 
result.put( "no", "[$-0414]" ); 
result.put( "no_no", "[$-0814]" ); 

I suppose that 0414 is Bokmål and 0814 is Nynorsk. If I am correct, a Norwegian user uses Nynorsk if located in Norway and Bokmål if located elsewhere. 

Should all locales starting with the "no" prefix be mapped to Bokmål ?
Comment 1 Andreas Beeker 2019-12-08 00:13:26 UTC
So according https://www.science.co.il/language/Locale-codes.php, the assumption about the mapping seems correct.

What puzzles me is, that ISO 639-1 language code for Bokmål is "nb", which is not in the list.

And according https://www.oracle.com/technetwork/java/javase/java8locales-2095355.html, this should be "nb-NO". Also have look at the notes.

So I would ignore the no-NO-x-lvariant-NY variant and change it to the following:
"no","no_no","nb","nb_no" -> 0414
"nn","nn_no" -> 0814


As a side note, we are using a hashmap here ... and add/overwrite multiple entries with the same key - this is anyway wrong :(
Comment 2 Andreas Beeker 2019-12-08 00:23:22 UTC
I found a better reference for the locale -> windows code translation:
Comment 3 Andreas Beeker 2019-12-08 00:28:44 UTC
... and the offical MS spec is [MS_LCID]:
Comment 4 Andreas Beeker 2019-12-08 23:38:17 UTC
I've provided a reworked mapping of the LCIDs via r1871066.

The mapping is based on the [MS-LCID] specs.

Please verify, if this is ok for you.