The Locale Editor - Translating the Keyman Desktop User Interface
Localization of the user interface is possible via editing a single XML file called
locale.xml. The default
locale.xml file is in the folder
[Program Files]\Tavultesoft\Keyman Desktop 9.0\xml\.
The recommended method for editing a locale file is to use the Online Editor, available on the Tavultesoft Website.
Find the language code for your translation
Create a folder for the translated locale.xml file and copy the default locale.xml into it
The folder should be called:
[Program Files]\Tavultesoft\Keyman Desktop 9.0\locale\
The file is an XML file, with a few different elements:
Entity declarations: these are at the start of the file and define commonly repeated strings within the locale.xml file itself, for example, the name of the product.
Dialog elements: these define the size of a dialog box and, for some dialogs, the elements within the dialog.
String elements: every translatable string in the file.
Nearly all strings have identifiers (e.g. SKButtonOK for thebutton). We have three different types of strings in the file - plain, HTML and format strings:
Format strings often include %#:s or %#:d markers that are placeholders for parameters, and should be included in a translated string. The order of the markers in the translated string is not important.
<String Type="FormatString" Id="SKPackageAlreadyInstalled">A package with the name %0:s is already installed. Do you want to uninstall it and install the new one?</String>
Plain strings must be just that - plain text. These are all referenced by the XSL templates that make up the bulk of the Keyman Desktop user interface. You should not place any HTML tags in these entries as they will be stripped before display.
<String Type="PlainText" Id="S_ShortProductName">Keyman Desktop</String<
HTML strings can include tags - there are only a few of these, and they are flagged in the
locale.xmlfile. The most obvious of these is in the Welcome screen text.
<String Type="HTML" Id="S_Splash_Button_Buy" AccessKey="B"><u>B</u>uy</String>
There is one exception to these formats - the strings on the tray menu do not have identifiers, but instead use the following format (note that the Caption attribute should not include the & entity). You can even use these strings to translate the name of keyboard layouts in the tray menu!
<String Type="PlainText" Caption="Keyman Configuration...">localized &text...</String>
The & entity is used to mark hotkeys in menu items, labels and buttons. It can be used only with strings identified as formatted messages (these mostly start with SK) and with the Menu strings.
First, edit the file's language information - SKUILanguageName, SKUILanguageNameWithEnglish, and SKLanguageCode. The SKLanguageCode should be the same as the language code you chose earlier. You will also see a String with id SKDefaultLanguageCode. For Keyman Desktop, this should remain "en" for all translations. When developing a custom product using the Keyman Developer Branding Kit, you may change your product's default language, and this would then entail changing SKDefaultLanguageCode.
Any entries missing from the translated locale.xml will be retrieved from the default file.
If you find that you need to do more work on the user interface, you can always copy the other files from the default xml folder into your locale folder, and edit them directly. Note that the XSL file for each dialog (e.g. activate.xsl, or keyman.xsl) references other files - these other files must also be copied to the locale folder:
[Program Files]\Tavultesoft\Keyman Desktop Professional 7.0\locale\
The format and organisation of these files is complex. More details are available in the Keyman Developer Branding Kit and the Keyman Developer help files.