MSKLC keyboard layout names in your own language

by Michael S. Kaplan, published on 2007/08/25 17:31 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2007/08/25/4564548.aspx


When I wrote Getting the language (and more!) of an LCID-less keyboard, which admittedly covered a lot of ground, I realized there were a lot of other points that would have to be clarified.

Like how MUI (Multilingual User Interface) fits in.

I mean, it is clear from looking at the registry that something is going on:

That bit with the Custom Language Display Name and the Layout Display Name and their SHLoadIndirectString style strings is fairly obvious.

(I still have to talk more about SHLoadIndirectString; I'll do that another day)

And it leads people like regular reader Ivan Petrov to wonder and even ask:

Hi Michael :-)

I've the following question:

How can someone USE, let's say something like the MUI technology, for the Description text when the custom Keyboard Layout is installed?

I mean when some user is using English User interface (MUI) to see the English Description text and if some user (on the same machine) is using a Bulgarian User interface, to see a Bulgarian Description text. All this at the Language bar and in the Text Services and Input Languages window in the Installed services under the Keyboard tree as localized node!

Regards,

Ivan.

Now of those two MUI-friendly strings, the Layout Display Name actually was added in Windows XP and is used to support localized keyboard layout names in every user interface language in Windows. All of the strings are in input.dll and the localizers can get to them.

But for custom keyboard layouts, obviously one cannot add strings to the input.dll file that ships in Windows. So we talked about it an decided that the resources of the layout DLL itself would work just fine. Starting with MSKLC 1.4, we automatically add the language name at string resource 1100 and the layout name at string resource 1000.

Of course there is no user interface within MSKLC to let you specify the various translations of those two strings, which would seem to defeat the purpose.

But let's take a closer look at the .KLC file from those adventures the other day, near the bottom of the file:

DESCRIPTIONS
0409    Like Totally Fer Shure

LANGUAGENAMES
0409    Valley Girl (California)

And there you have it. For any language you wish to add a translation for, and this is for either or both strings, you can add them here. MSKLC will not let you edit the name directly but if they are there then it will build the keyboard layout DLL containing them. Quite happily, in fact....

You are LCID (technically LANGID) bound since all of the resources are contained in the one DLL and there is no way to do multilingual resource tagging in one file. Perhaps in a future version this would change to including the various .mui files in the language name directories. And then custom languages might fare better (of course for the time being MUI does not work well with custom locales so MSKLC has some time before anyone needs to worry about getting that bit right. :-)

It is funny, the feature idea within MSKLC has been suggested for years but it never really got very far, as people struggled over what to make that UI look like -- some big grid where you choose the target language and put in the translation? Or would you give the DLL to some localization company and have them translate? Probably once they are separate DLLs, sure. But for now many some UI would have been nice? :-)

Ah well, no worries. If you want to put in some different translations of the custom language name (ignored unless it is in fact a custom language) and/or the keyboard layout name, adding them to the file is easy enough by just putting in the LANGID and the name, one line to each you add.

 

This post brought to you by (U+0fcf, a.k.a. TIBETAN SIGN RDEL NAG GSUM)


# Mike on 25 Aug 2007 9:00 PM:

Slightly off-topic request. For some months, the \ key on my Acer Tablet's UK-keyboard has not worked (it's between left shift and z, as expected). At first I thought the keypad was broken, but I had that replaced. It still doesn't work. So I tried to remap the keyboard using tools like MSKLC or KeyTweak. Interestingly when I test that key in these apps, it works perfectly.

I loaded the UK-Extended Keyboard layout into MSKLC, noting the following:

1. even though the \ registers when I tap it without a layout loaded, it fails when I do have a UK layout loaded

2. if I "Test Keyboard Layout" with UK-Extended then the key works (in both shift states)

3. The Validate Layout log says : "    WARNING: '\' defined on OEM_5 (Base) but not defined elsewhere. This key may not be present on all keyboards."

I'm stumped. Why isn't Windows (XP SP2) paying attention to this key?

# Michael S. Kaplan on 25 Aug 2007 9:22 PM:

Seems like something for the Suggestion Box?

# Ivan Petrov on 26 Aug 2007 4:45 PM:

Ahaaa,

Thank you for the post Michael :-)

Regards,

Ivan.

DilanR on 8 Apr 2013 2:03 PM:

Mike, in this case what will be displayed language on the language bar? I have issue with getting a custom keyboard for Kurdish to appear under the name Kurdish?

DilanR on 8 Apr 2013 2:40 PM:

I think in the .KLC file there are some information that can not be changed, they appear right at the top such as

LOCALENAME

LOCALID

msdn.microsoft.com/.../bb895996.aspx

and there is no way to allocate a custom keyboard under a non represented language in above list.


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/05/17 That 'keyboard culture list' you may have heard so much about

2008/02/25 What the #$!*& is a KeyboardLayoutId, anyway?

2008/01/28 Behold the Table Driven Text Service, Part 5 (All about the language, baby!)

2007/09/02 When the NLS keyboard's notions about LCIDs aren't the same as in NLS, part #1

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