다음을 통해 공유


Locale Builder and Finnish or other locales...

The Locale Builder tool, https://aka.ms/localebuilder, runs on Windows 10 and can be used to modify your computer's locale if you don't want the defaults that ship in the OS.  For example, the Finnish locale was updated to use . for the time separator, however that is currently causing some confusion because it is identical to the date separator, which is also a .  Since they're both the same, it's hard to tell if 25.12 is Christmas or a little after noon.  (The reason this changed is to align with the CLDR standard data)

I confess I did have a little bit of trouble getting the locale builder to behave with this one, I had to save it as LDML, then load the LDML and then build the Zip batch file from that.

Attached is the resulting Zip file with the locales for fi-FI (Finnish Finland) and fi (Finnish).  You can extract the zip file to some folder (path cannot have a space in it), then run "InstallLocales.cmd".  All that InstallLocales.cmd does is copy the two .nlp files to %windir%\globalization and make the two registry entries.

The zip also contains the LDML file for Locale Builder, which is just an XML file if you want to look at it in an editor.  You can also use that LDML file to open Locale Builder and generate your own custom locales with those settings since I have no way to sign any of these files on my blog.

Step by step, here's how I did it:

1) Download and install the Locale Builder Tool from https://aka.ms/localebuilder

2) Open Locale Builder and pick Finnish (Finland) (you'll also probably want to do this with Finnish)

3) From the Time section select the H.mm.ss Long Time Pattern and hit remove (you'll have to do this on the next two tabs as well, Short Time Pattern and Time Formatting

4) Enter H:mm:ss into the custom pattern and hit "Add" so that it ends up in the right panel.  Note that the preview is wrong, this is a bug :(

5) Repeat for the Short Time Pattern and Time Formatting.  You want to end up with H:mm and h:mm:ss in those tabs respectively.

6) Save as LDML somewhere and exit Locale Builder (this is to work around the above preview bug)

7) Open your LDML file (double click works) and verify that the preview is correct for the two Time Patterns.

8) Select Build -> Build Zip Batch File and save it as a zip somewhere (without a space in the path!)

9) Extract the zip folder and run the InstallLocales.cmd, which will elevate to copy fi-FI.nlp to %windir%\globalization and add a REG_SZ "fi-FI"="fi-FI" to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CustomLocale]

10) Repeat for the Finnish neutral locale.  If you want to share, you can copy all of the files to a single .zip like I did in the attached .zip.

I hope this post is useful,

Shawn

 

 

LocaleOverrides.zip

Comments

  • Anonymous
    September 08, 2015
    How to parse "25.12" in Finnish: It is not a date with day=25 and month=12 because the month number is not followed by a period.  In Finnish, if we write the day or month with digits, we normally put a period after it to indicate that it is an ordinal number.  This is documented in CLDR: www.unicode.org/.../fi.html shows that the Finnish flexible Gregorian date format with code "Md" is "d.M." rather than "d.M". It is not a time of day with minute=25 and hour=12 because we'd write the hour first, i.e. "12.25". It is not a time of day with hour=25 and minute=12 because there are only 24 hours per day. It might be a time of day with hour=unspecified, minute=25, and seconds=12.  Omitting the hour seems odd but might be done in a time table if the events recur every hour. It might be a time duration with minutes=25 and seconds=12, e.g. in sports results. Although then the fractions of seconds would often be shown as well.

  • Anonymous
    September 09, 2015
    Ok, so my example was bad, sorry :)  I was trying to show the more general problem and oversimplified my example.