Andy Huang Home Page

Overview

To translate the user interfaces of KP Typing Tutor series, you need these tools:

  • Text editor, such as Notepad, Notepad++, Jedi Editor or UltraEdit etc.
  • PO file editor like PoEdit.

It is assumed that you will use PoEdit.

 

Download

PoEdit: http://www.poedit.org

Get Text: http://dybdahl.dk/dxgettext/

Mostly you will need only PoEdit. If you want advanced features of Get Text for translation, you may download dxgettext which a set of command-line tools and Windows Shell applications.

Schema of PO

The basic format of a po file is text, the schema of the text is described by GNU GetText manual. When you open a po file with a text editor, you will see things like the following:


As you might notice, "msgid" represents the original content, and "msgstr" is the translation. Meta data like "X-Poedit-Language: Chinese\n" is the language setting of the pofile.
 

When you open a po file with PoEdit, you will have the following view

With PoEdit, you need no worry about the schema of the po file. PoEdit will maintain the schema for you.

After translating the po file, you need to convert the po file into a mo file that will be used by KP Typing Tutor. When you save a po file using PoEdit, PoEdit will create/update the mo file stored in the same folder. If you used a text editor to edit the po file, you might need other command-line utilities to convert the po file into a mo file.

Unless you are a programmer, it is better just to use PoEdit.

Folder Structures of KP TT

As you might notice, the translation of each language is stored in a relevant folder. For example, the translation in Spanish is in "default.mo" under "\locale\es\LC_MESSAGES". If your computer run Windows in Spanish, KP TT will pick up the Spanish translation.

Steps of Translation

General steps

  1. Get a copy of a po file with empty translation, and save it to folder "\locale\YourLanguageId\LC_MESSAGES".
  2. Change the settings of the pofile, and update with your translation.
  3. Save the po file to create the mo file as well.
  4. Run KP TT to test the translation.

What to translate

Not every items in the po file need to be translated. You may refer to existing po files with translation to find out. During the translation, you may find texts like:

%s: The practice time is %d h %d m %d s, total practice time is %d h %d m %d s.

 Accuracy: %d%% WPM: %d Expected WPM: %d

%s is a bookmark for KP TT to replace with string, and %d is to replace with number. Please leave them as they are. Though you may change the locations of these bookmarks, but you need to keep the total number and the order of the bookmarks.

Step 1

The copy of the po file with empty translation is "c:\Program Files\kp\tutor\locale\EmptyTranslation.po", if you installed KP TT in "c:\Program Files\kp\tutor\".

Assuming you are going to translate into German, you need to create a sub folder under "\locale\" called "de", then create "LC_MESSAGES" under "de".

Copy the EmptyTranslation.po into "\locale\de\LC_MESSAGES" and rename it to "default.po".

Step 2

Open "default.po" in "\locale\de\LC_MESSAGES". Click on [Main menu -> Catalog -> Settings], and define settings.

Then you may translate the texts line by line.

Step 3

After saving the po file, PoEdit will create a mo file under the same folder. This file will be used by KP TT if your computer is running Windows in German.

Step 4

Run KP TT to see the effects of translation. You might need to test the translation a few times.

Advanced Topics 

To find out more settings of languages and countries, please refere to ISO 639 language codes and ISO 3166 country codes.

After you have made a translation file, you may send either the po file or the mo file to the author of KP TT.

Alternatively you may make an installation program with translation and courses in only your language, similar to the English only editor of KP Typing Tutor. The author of KP TT might provide you tools and scripts to make such installation program.

Although KP TT only need mo files for translation, it is better to keep the po file in the same folders.