The example was wrong, but the point of the example was spot on!

by Michael S. Kaplan, published on 2011/04/06 07:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2011/04/06/10150467.aspx


Way back in December of 2005, in my Calendars in other languages blog, I hinted at what would pretty much have been a terrible behavior in NLS:

Though to be honest, it bothers me more that the Hijri calendar is always in Arabic (even in the Divehi language's locale, where it makes no sense) than the Hebrew calendar is always in Hebrew. Because truthfully in the context of the Hebrew calendar it is in the most sensible language already, and having it in localized or even English form is not quite as important....

That's all well and good, mind you.

But the words here have one big flaw in them: when you use the Hijri calendar with Divehi, here are your month names: 

މުޙައްރަމް
ޞަފަރު
ރަބީޢުލްއައްވަލް
ރަބީޢުލްއާޚިރު
ޖުމާދަލްއޫލާ
ޖުމާދަލްއާޚިރާ
ރަޖަބް
ޝަޢްބާން
ރަމަޟާން
ޝައްވާލް
ޛުލްޤަޢިދާ
ޛުލްޙިއްޖާ

Um, that ain't Arabic. Looks like Divehi to me!

So, how did I miss this?

Well, there is a special hack in place where if you are using CAL_HIJRI and the PRIMARYLANGID of your LCID is LANG_DIVEHI.

The flag that is used internally is even named HACK_VALUE_ICALDIVEHI, so just in case you fear I'm being judgmental in calling it a hack, the authors of it felt the same way! Though I concur with their assessment. :-)

And that hack gives you these month names that are not in Arabic!

Now the implementation via this hack leads to a few problems:

Perhaps all of these other cases have languages where people understand the Arabic language Hijri months, and actually prefer them. Though it seems fairly unlikely....

The hack itself is pretty unwieldy; to fix it even for the non-custom cases would probably require a more sustainable technique than they are using.

Solving it for custom locales would require extensions to the entire model that give ways to add the other names -- and such extensions to Windows, .Net, and Locale Builder all seem highly unlikely.

So if you look at my original quote:

Though to be honest, it bothers me more that the Hijri calendar is always in Arabic (even in the Divehi language's locale, where it makes no sense) than the Hebrew calendar is always in Hebrew. Because truthfully in the context of the Hebrew calendar it is in the most sensible language already, and having it in localized or even English form is not quite as important....

I guess you could say while totally inaccurate for Divehi -- the original subject of the quote -- it is eerily and almost prophetically true for every other locale that uses Hijri for a calendar but does not use (or prefer or even know!) Arabic for a language.

And note I am assuming that all sixteen of the Arabic locales on Windows all support the exact same spelling of the Hijri month names, even though some have slightly different spelling of the Gregorian month names (and other dialectical differences as well). Maybe this is more reasonable to let slide, even if there are in-county differences in Iraq, Egypt, Libya, Algeria, Morocco, Tunisia, Oman, Yemen, Syria, Jordan, Lebanon, Kuwait, U.A.E., Bahrain, or Qatar. Certainly more than the ones I mentioned earlier.

Somebody should remind me to report this issue (which has been present since Windows 2000!) as a bug at some point to fix the easiest of these issues (though even that involves a bunch of data collection followed by code change to use the new data).

It seems to get a little worse each version, which does wonders for the statute of limitation on fixing such bugs. And it would be nice to finally do something for the long-standing lack of Calendars in other languages that is happening to quite a few people (even if not the ones I mentioned as an example in my original bloc so long ago)....


no comments

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2012/03/08 The evolving Story of Locale Support, part 21: The Windows 8 Hijripalooza extraordinaire!

2011/12/28 I won't Dari or double Dari you to knock our Persian calendar support...

2011/09/10 It may be one of the reasons there are different Arabic locales

2011/08/01 The only way to be impressed by Microsoft is to ignore calendars

2011/05/04 Regarding the overthinking and underimplementing of names

go to newer or older post, or back to index or month or day