2007/05/05

What are these directories called 0409 and 1033?

A reader asked,
I was wondering why it's common for some Microsoft products to have a directory called "1033" within it's program directory installation location? What does it mean?

This reader was probably from the United States, because 1033 is the locale identifier for "English (United States)", whose hexadecimal value is 0x0409. You may also find directories called "0409". Some programs use hex codes and some use decimal. Go figure.

Here is a list of a whole bunch of locales and their identification numbers, both in decimal and hexadecimal. Now you too can become an expert in locale identifiers.

The value of a locale identifier is given by the formula
primary language + 1024 * sub-language

For example, Swiss German is LANG_GERMAN + 1024 * SUBLANG_GERMAN_SWISS = 7 + 1024 * 2 = 2055.

So why would a program create a directory named after a language code?

Many Microsoft products support a multilingual user interface. This means that the same program can be used to display its user interface in multiple languages. Office and Windows are the two biggest examples. Language-specific resources need to be broken out into their own directories so they won't conflict with resources corresponding to some other language.

沒有留言: