Some scenarios are too big to cover

by Michael S. Kaplan, published on 2006/01/27 10:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/01/27/518216.aspx


As you might imagine, these days I get a lot of email from people in different groups at Microsoft about all kinds of internationalization issues.

Usually they are polite, but some of them can be demanding at times!

Now while it is true that I have a lot of different things that I know something about, it is not like I know everything about every single issue.

Unfortunately, I usually do know the answer often enough that people keep on asking. :-)

Anyway, yesterday someone was looking for a way to convert between Locale Identifiers (LCIDs) and culture names.

So I immediately suggested the NLS API functions LocaleNameToLCID and LCIDToLocaleName.

"I'm sorry," they said. "We need something that works in managed code."

Ah, that is even easier since the CultureInfo class has both Name and LCID properties.

"Hmmm," they said. "We need something that will work downlevel."

No problem, since the .NET Framework can run as far downlevel as Windows 98 if needed.

"Ah, but we have to handle custom locales, too," they offered.

As you can imagine, I was getting a little exasperated by then. I pointed out that custom locales are a new feature in Vista, so there was no downlevel requiremnt for them.

"No, we need to support all of these scenarios" was the response.

Hmmm.... so basically they need:

But they wanted to be "good citizens" and start using names and getting rid of their LCID dependency.

(of course in most societies the good citiziens would not be expected to be quite this demanding, but that is another story!)

Well, I told them, they will probably need to store both names and LCIDs.

We simply were not able to know through special psychic powers that all these things would be needed to build such functionality into prior versions. Not that I would complain if I had this ability, but for the present it is simply beyond my power....

Anyway, I think when the extreme nature of their request was so baldly laid out, they kind of understood they were looking for a bit more than was possible. Which is not to say they won't be emailing me tomorrow to ask another question. :-)

 

This post brought to you by "" (U+134f, a.k.a. ETHIOPIC SYLLABLE FWA)


# Jerry Pisk on 27 Jan 2006 1:41 PM:

But if they do store the mapping themselves they would not support custom locales or any locales they missed when they released their code :) There is a way to do it, combination of on-demand loaded code and static code with some decent version and feature checking would do but it'd be pain to manage, mean a lot of duplicated code, probably not work correctly as the logic would be hard to get right and it would still not support anything new added in post-vista world.

To add my own rant - my managers still require me to write code that will work on Win95, even though about 0.3% of our users still use that. Welcome to corporate america.

# Michael S. Kaplan on 27 Jan 2006 1:43 PM:

Hi Jerry --

If they store both items any time something is created, then they never need to convert. If they areabale to create then the locale works on the machine, so they can grab the two properties and store them.

And then everybody wins. :-)

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.

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