#### Previous topic

Developers’ Guide

# Localisation¶

## Translating GUI¶

To translate the GUI one needs to alter the translation files of the BladeDesigner. Translation files are not equal to language packs. Thanks to Qt and the chosen program structure these files are almost independent from development itself.

### Editing available translation files¶

Already existing translation files are stored in the BladeDesigner-directory ./src/GUI They share the extension .ts and are called GUI_.ts*. The tag in * determines the language the translation file contains (de = german, en = english and so on ...).

To add a translation or change an existing one, load the translation file of the language into QT Linguist via File -> Open.... Qt Linguist can load more than one file at a time, to translate a text into several languages simultaneously. Hold down Strg-Key to select more than one file.

How to use Qt Linguist as a translator is described here: Qt Linguist for Translators.

### Updating GUI text¶

After editing the translation files the new changes must be added to the GUI sources. In the direction ./src/GUI there is a CreateGUI.sh script, which needs to be run:

$./CreateGUI.sh It creates the language pack files and puts it in the language pack directory ./src/GUI/Sprachpakete. Also it recreates the resource file, which contains the languages. After launching the BladeDesigner the translations can directly be checked in action. ## Adding a new language pack¶ Adding a new language pack is very easy. Therefore only a new translation file must be created from the existing strings. After turning into a language pack it can be loaded dynamically, when stored in the directory ./src/GUI/Sprachpakete. The creation script will put it there automatically. However the new language packs can then be shipped individually or with the whole distribution. The following steps have to be taken to create a new language pack: 1. Creating a new translation file 2. Translating the translation file 3. Converting into language pack ### Creating a new translation file¶ Which translation files to update and to create is stored in the GUI.pro in the ./src/GUI directory of BladeDesigner. In fact this is a project file of the BladeDesignerGUI-Qt project. Important for translation purpose is the last row of this file: TRANSLATIONS = GUI_de.ts GUI_en.ts To add a new translation file, add a GUI_.ts*, where * is a valid ISO 639 language code . For example for a Japanese language pack: TRANSLATIONS = GUI_de.ts GUI_en.ts GUI_jpn.ts Afterwards the translation file needs to be created with a call to: $ pylupdate4 GUI.pro

This updates all translation files and creates missing ones. Now a corresponding translation file should be created.

### Translating and Converting¶

After creating a new translation file, it can be translated and converted like described in section Translating GUI.

The new created translation file must be written to the base resource file of BladeDesigner, so it can be compiled into the resource file and used on launch. Therefore the following line needs to be added to the resource base file ./src/GUI/UI/BladeDesignerGui.qrc at the bottom of the existing translation file declarations:

<file alias="GUI_*.qm">../Sprachpakete/GUI_*.qm</file>

The * is to be replaced by the ISO 639 language code of the created translation file.

## “What’s this?” messages¶

What’s this? messages are displayed when first clicked on the little question mark in the upper right corner and then on a widget of BladeDesigner. It displays a specific help text or gives a link explaining the use and intention of the widget.

### Editing “What’s this” messages¶

“What’s this?” messages can be edited using Qt Linguist. Therefore open an existing translation file like described in section Editing available translation files. In some categories, mostly the UI ones not starting with Q, there are tags starting with WhatsThis, which indicate that the content of this string is the displayed “What’s this?” message. The translation of the so tagged statements are the shown “What’s this?” message.

link <type> <url>

The type parameter is important for the help window to determine the source of the link. Type may be one of the following parameter:

 d the link leads to the doxygen, the base source is ./doc/Doxygen/html/ h the link leads to the handbook, the base source is ./doc/Handbook/html/ o the link leads to an other source like the Internet or a file, there is no base source

Here are some examples:

link h BladeDesignerch2.html#x4-140002.3

link o http://www.google.de

link d class_q_blade_designer_1_1_q_blade_designer.html

There are some examples in BladeDesigner and its corresponding transaltion files to see the effect of the different statements and how to implement them directly. For a certain example try out the following entries in BladeDesigner using the WhatsThis-Button or by looking it up in the translation files:

• Use of Handbook: In profile the Comboboxes for the Camberline, Thickness Distribution and Weight Condition.
• Use of Wiki: The Debug ComboBox in Profile, BladeRow, Turbomachine and Meshing-Mode.
WhatsThis <Widgetname>
\$ pylupdate4 GUI.pro