The Keyman Desktop 7.0 Beta 2 UI is now both customizable and localizable.  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]TavultesoftKeyman Desktop Professional 7.0xml

First steps to creating a translation

  1. Find the language code for your translation

    Use the ISO 639-2 or ISO 639-3 language code (we recommend using the ISO 639-3 codes as many Keyman keyboards support languages not included in ISO 639-2!).

  2. Create a folder for the translated locale.xml file and copy the default locale.xml into it

    The folder should be called:

      [Program Files]TavultesoftKeyman Desktop Professional 7.0localelangcode

File Format

The file format is straightforward – most strings have identifiers (e.g. SKButtonOK for the OK button).  The identifier of the string is the XML tag name.  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.
  • Plain strings must be just that – plain text.
  • HTML strings can include tags – there are only a few of these, and they are flagged in the locale.xml file.  The most obvious of these is in the Welcome screen text.

The only exception is the strings on the tray menu, which do not have identifiers, but instead use the following format (note that the Caption attribute should not include the & entity):

    <Menu Caption="Keyman Configuration…">localized &amp;text…</Menu>

The &amp; 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.

Editing the File

First, edit the file’s language information – SKUILanguageName, SKUILanguageNameWithEnglish, and SKLanguageCode.

<!–   The name of the UI language, localized –>
<SKUILanguageName>
English</SKUILanguageName>

<!–   Show the name of the UI language, localised, with English name in parentheses (this message is used when the user gets stuck in a strange UI language) –>
<SKUILanguageNameWithEnglish>English</SKUILanguageNameWithEnglish>

<!–   The language code for the current translation –>
<SKLanguageCode>en</SKLanguageCode>

Note that any entries missing from the translated locale.xml will be retrieved from the default file.

Editing other Files

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 an xml subfolder of 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 xml folder:

  [Program Files]TavultesoftKeyman Desktop Professional 7.0localelangcodexml

The format of these files is somewhat more complex; I may talk about them in the future.  But feel free to play around and edit!

Finally…

The Keyman Developer user interface is also localizable (not 100% ready yet), but it primarily uses gettext, with a small amount of translatable XSLT.  We will include the gettext .pot template in the release of Keyman Developer.

The usual beta warning applies – these file formats are not necessarily 100% stable, and some changes may occur.  However, we expect only that more strings will be added to the final locale.xml, and we don’t expect structural changes.

Categories: Developing Keyman

0 thoughts on “Translating the Keyman Desktop UI”

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Developing Keyman

Keyman is now free and open source

SIL International is very pleased to announce that Keyman is now completely free and open source! Today, 23 August 2017, we released free versions of the existing Keyman products on the Keyman website, and have Read more…

Developing Keyboards

Using Keyman Engine for Android to create a custom keyboard app

Note: You must have a license for Keyman Engine for Android in order to access the resources documented in this blog. (Purchase a license) Keyman Engine for Android allows you to use any Keyman touch Read more…

Developing Keyman

An improved experience with deadkeys on European hardware keyboards

For many years, Keyman Desktop has adapted layouts to work more accurately with European hardware keyboards. For example, a US English keyboard has a top alphabetic row of QWERTYUIOP, but a French keyboard has instead AZERTYUIOP. Read more…