Sorting it all Out Michael Kaplan's random stuff of dubious value Be sure to read the disclaimer here first!
Regular readers may remember my Four cases where I don't like ResolveLocaleName (and you shouldn't either!) from a few months ago.
I described a terrible sitation with ResolveLocaleName.
Ths function, added in Windows 7, would do all of the following:
and I pointed out how this function works. It works badly.
Well, one person took this to heart, my friend Brendan.
He entered a bug on this for Windows 8 (I was actually just looking at the Win7 repro but it was I guess in Win8 too!).
Anyhow, despite how late it was they did do a quick fix!
So, once you have RTM bits, the results are much more reasonable:
Wow -- much bettter!
Now, we just need to port it to Wndows 7... ::-)
I've been working on this very problem: perhaps you reached the same conclusion I did, that the correct way to handle these things is via the traversal of a tree-structure representing the range of permissible/available language options. My own algorithm actually does something slightly more advanced: it takes two SETS of language codes (one set, the permissible/available options for a particular URI; the other set, the permissible/desired options according to a website visitor's HTTP language preferences.) Using set theory and ordered trees, I combine the sets into an ordered list of language options. You can see the results, for example, at the foot of this page:
Change the language options in your browser, and see which localization options you are offered! This is just Version 1 of my system. I'm working on Version 2, which will work on simpler, tidier code; and give better results. I plan to publish my code & algorithms, possibly as "open-source code". Might pay this page another visit when I've done it...