# Howto: Translate LameXP

If you are willing to contribute a new LameXP v4.xx translation or improve an existing translation, then this guide will help you to do so :-)

### Introduction:

LameXP v4.xx is a complete re-write of LameXP. This time LameXP is developed in C++ and it is based on the Qt cross-platform application framework. The good news for translators is that Qt provides full Unicode support, which was also one of the main reasons for the re-write. Consequently there will be no more headache with different Codepages! Furthermore the Qt framework provides a sophisticated translation system, which allows for easy internationalization and localization. There even is an easy-to-use graphical tool for translating Qt application, which is called Qt Linguist. Consequently, before you start translating, you should make yourself familiar with the Qt Linguist application. As a translator, having a quick look at the Qt Linguist manual for translators should be sufficient.

### Prerequisites:

You can obtain the Qt Linguist application as a part of the Qt cross-platform application framework, which is available as a free download from the Qt Project web-site. We recommend choosing the "Qt libraries 4.8.6 for Windows (VS 2010)" download. Note that, in order to find the desired download link, you may need to click on the "Show Downloads" button first and then scroll down. In any case, the free "OpenSource" edition of Qt is perfectly sufficient, i.e. you do not need to buy the commercial edition of Qt offered by Digia Inc.

Alternatively, if you do not want to download and install the complete Qt framework, you can download Qt Linguist (and some other Qt-related tools) as a stand-alone package at this location. This stand-alone version will work "out of the box" without installation.

### Editing the language file:

LameXP v4.xx translations are created as TS (translation) files, which can be edited using the Qt Linguist application. For new translations an empty TS file ("Blank.ts") is provided in the LameXP Git repository. When you open the empty TS file for the first time, Qt Linguist will ask for some basic settings. Here you must keep the "Source language" options at "English" and "Any Country". Change the "Target language" options to whatever language (region) you are going to translate to. Once you have edited all (or some) text strings, you can save your work to a TS file again. It is recommended to save your work to "LameXP_XX.ts", where XX should be replaced with the suitable upper-case ISO 639-1 Code for the representation of names of languages (for example the German translation is saved as "LameXP_DE.ts", because the corresponding ISO 639-1 code is DE). You can re-open your TS file at any time in order to continue with your work. In case you want to improve an existing LameXP translation, simply download the corresponding TS file from the LameXP Git repository and edit it using the Qt Linguist tool.

The latest translation (TS) files can always be found in the LameXP Git repository at:

- https://github.com/lordmulder/LameXP/tree/master/etc/Translation
- https://bitbucket.org/lord_mulder/lamexp/src/master/etc/Translation

After you have chosen a file from the directory tree, by left-click, you can download the file by right-clicking on Raw button/link (in the upper right corner) an then choosing "Save Link As..." from the context menu.

(As many people seem to have problems here: Please be sure to download the actual file content, by using the "Raw" button. Please do not save the page as shown in the browser, as that would only save the HTML preview of the file rather than the file itself! Also, in the directory tree view, do not right-click + "Save Link As..." on one of the TS files, as that would only save the HTML preview. Instead, left-click on the link to open the TS file in the browser. Then use the "Raw" button as described above!)

IMPORTANT: Before you start to create a new translation, always make sure you downloaded the latest "Blank.ts" file from the LameXP Git repository. Also, before you start editing or updating an existing translation, make sure you downloaded the latest TS file from the LameXP Git repository. Never do any translations based on some working copies that you kept on your local system! The translation files (TS) in the Git repository will be updated continuously, as the development proceeds. We can not accept translations based on an outdated TS file!

### Language file editing rules:

Only language files that have been edited according to the following rules can be accepted:

- The translated string should not be significant longer (or shorter) than the original string, so the layout isn't destroyed.
- Strings don't have to be translated literally, as long as the original meaning is retained.
- Do not use any HTML-style tags, like `<b>…</b>`, `<i>…</i>` or `<u>…</u>` in your translated text, except when such tags are already present in the original string.
- Take care of the C-style printf() syntax: All the `%s` and `%d` placeholders must remain in the translated strings, at the appropriate position.
- All Qt-style place markers, like `%1`, `%2` and so on, must remain in the translated strings, at the appropriate position.
- Strings containing plurals need two translations: One for the "singular" form and one for the "plural" form. The `%n` number place marker must remain, at the appropriate position.
- Once the translation for a string is finished, please click the 'mark item as done' button, so the item (string) gets a green ✔ icon.
- Note that the red ! icon and the yellow ✔ icon indicate that there is some problem with your translation, which needs to be resolved!

### Examples:

Here are a few examples of properly translated strings:

- Example #1

  • Original: |  | `Executable '%1' was built for Qt '%2', but found Qt '%3'.`
  • Translated: |  | `Programm '%1' wurde für Qt '%2' erzeugt, aber Qt '%3' gefunden.`

- Example #2

  • Original: |  | `LameXP will <i>not</i> check for Beta (pre-release) updates from now on.`
  • Translated: |  | `LameXP wird fortan <i>nicht</i> nach Beta (Entwickler) Updates suchen.`

- Example #3

  • Original: |  | `%n minute(s)`
  • Translated (Singular): |  | `%n Minute`
  • Translated (Plural): |  | `%n Minuten`

### Testing your translation:

LameXP v4.xx needs to be re-built from the sources in order to integrate a new translation or to update one of the "built-in" translations. However there is an easy method to test your translation file without re-building LameXP: Open your current translation (TS) file in the Qt Linguist application and go to "File" ⇒ "Release As...", which allows you to save your translation as a "release" (QM) file. Once saved as a QM file, you can load your translation in LameXP. This is not possible with the TS file. In LameXP, just goto "View" ⇒ "Language" ⇒ "From File..." and choose the QM file that you have saved in Linguist before. Your translation should be in effect immediately. If you notice that your translation needs further modifications, please go back to the TS file for editing (don't try to edit the QM file!), in the Qt Linguist application. Then, for your next test run, create a new QM file from the updated TS file. Also note that, in newer versions of LameXP, you can press `CTRL+F5` to re-load your current QM file (works only in the "Main" window!).

### Submitting your translation:

Once you are done with your translation (i.e. all items and all contexts have a green ✔ icon), you can submit it, so it can be integrated into the next LameXP release. You can contact me by e-mail:
mulder2[at]gmx[dot]de

Please do not submit translations that have any items/context with ✔, ?, ? or even ! icon left. Also do not submit QM files, do not compress the submitted file (ZIP, RAR, etc) and do not attach a flag icon file. It is perfectly sufficient to submit only the translation (TS) file.

Legal notice:
By submitting LameXP translations, all translators agree that their work will be incorporated into the LameXP software. All translations will be published and redistributed under the terms of the GNU General Public License. If you do not agree, please do not submit!

(Advanced translators can get write-access to the Git repository, so they can keep their translations up-to-date easily. If you need Git access, just drop me a note!)

IMPORTANT: Before you start to create a new translation, always make sure you downloaded the latest "Blank.ts" file from the LameXP Git repository. Also, before you start editing or updating an existing translation, make sure you downloaded the latest TS file from the LameXP Git repository. Never do any translations based on some working copies that you kept on your local system! The translation files (TS) in the Git repository will be updated continuously, as the development proceeds. We can not accept translations based on an outdated TS file!

### Personalization:

Usually all translators will be mentioned in the "About..." dialogue of LameXP. If you don't want your (nick)name and/or e-mail address to appear there, please tell us that you wish to stay anonymous!

Thanks in advance !!!