Tag Archives: i18n

Anything related to internationalization work

Detecting keyboard layout used on Windows

[code lang=”c”]//Pseudo C/C# code:

int localeId = GetKeyboardLayout(0);

// The low word contains a Language Identifier for the input language
// and the high word contains a device handle to the physical layout
// of the keyboard.
localeId &= 0xffff; // mask off high word to get the locale
// identifier

switch (localeId) {
0x040c:
0x080c:
0x1009:
useAzertyMapping();
default:
useQwertyMapping();
}
[/code]

Relevant links:
GetKeyboardLayout()
Default Input Locales
Locale IDs assigned by Microsoft

On the topic of sensible date and temperature defaults in applications and websites

Something that can always get me a bit frustrated is the choice of defaults used in applications.

Dates: Aside from Belize, Canada, the Federated States of Micronesia, Palau, the Philippines, and the United States are the only countries using a date format where the month is the first entry, followed by day, and lastly year (mm/dd/yyyy). To put to numbers that’s about 436 million people who use this versus 6.35 billion that don’t (ratio of about 14:1). Of that 6.35 billion about 3.8 billion use a date format where day is first, followed by month, and lastly year (dd/mm/yyyy — ratio of about 9:1 to the month first users). About 1.81 billion use a form where the year is first, followed by month, and lastly day (yyyy/mm/dd, roughly equivalent to ISO 8601 — ratio of about 4:1 to the month first users). (Note: these 1.81 billion have a slight overlap with the 3.8 billion due to some countries having two date formatting forms in use or due to two or more distinct scripts with different date formatting styles.) So using a format where the month is first is only confusing for the majority of the world’s population. If you need a default date, use the ISO 8601 format — not only is it less ambiguous, it also allows for much better chronological sorting.

Temperature: Aside from Belize and the United States (I so far managed to find), the worldwide standard for temperature is Celcius, not Fahrenheit. If you are using Fahrenheit you are putting 6.48 billion people at a disadvantage solely against something like 313 million people. That’s a ratio of about 22:1, meaning you put 22 people at a disadvantage for every one person you are trying to please.

Disclaimer: do note that this of course only makes sense if you are appealing to an international audience. If you are just targetting a specific country you will of course default to what they use. On the other hand, properly fixing your code to be i18n-ready is the way to go anyway.

Why using ‘lorem ipsum’ is bad for web site testing

The typesetting and webdesign industry has apparently been using the ‘lorem ipsum’ text for a while to provide a dummy text in order to test print and layout.

Aside from the fact that the text is a cut off section of Cicero’s de finibus bonorum et malorum, it also fails in one huge aspect, namely globalisation.

The text is Latin, latin is the simplest of all characters we have available to us on the world-wide web. If your website is English only then, yes, you are quite done. However for a lot of us we also have to support languages other than English, the easiest of which are Latin-derived scripts.

Latin, and subsequently English, are both written left-to-right. Hebrew and Arabic, to take two prime examples, are written right-to-left (leaving numerals aside for the moment). Of course, this is very important to also test since it means a lot of change is needed for your lay out.

Especially when testing your design for sites that need to display multiple languages on the same page it is pertinent to test with multilingual text. One of the things that should quickly become clear is whether or not a sufficient encoding has been chosen.

Microsoft IME 2007 on Windows x64

So I was updating my input method editors (IME) from the default in Windows x64 (IME 2002) to the ones provided by Office 2007’s language packs. As explained in a previous post of mine you can install the proofing tools and input by passing LAUNCHEDBYSETUPEXE=1 to the execution of the MSI. Now, on my Windows x64 I installed the IME by installing the IME64.MSI with this added variable. The weird thing was that some applications worked flawlessly and yet others showed me the wrong number of icons or no icons at all! It turns out that these applications are 32-bits applications and need to have the 32-bits IME installed as well. So next to installing IME64.MSI of the language you want to install, you will also have to install IME32.MSI. Only after doing this will you notice the applications working as you want them.

Thinking back on it, it makes perfect sense, but while you are in the middle of working with it you keep wondering: “why?”

Office 2007 Proofing and Input Method Editors (IME)

So I have been toying with the proofing tools and input method editors (IME) from Office 2007. The issue with the single language packs is that you cannot just group the entire stuff together.

Also trying to run the MSIs from the individual directories for the proofing tools or the IMEs greets you with an ‘Error 1713′. On the other hand, if you run the MSI from the command prompt and passing along LAUNCHEDBYSETUPEXE=1 as an argument it will install. Curious.