GNS3 makes use of the very powerful Qt framework for its graphical interface and translation management system. This is why you need to download an application called Qt Linguist in order to make a Qt compatible translation. Qt Linguist is available on several operating systems:
Qt Linguist on Microsoft Windows
On Windows you could download the complete Qt SDK but more than 300 MB is maybe a bit too heavy just for making a translation. This is why we provide a standalone version of Qt Linguist (about 7 MB).
Qt Linguist Mac OS X
Download the Qt SDK or a standalone version.
Qt Linguist on Linux (Debian/Ubuntu)
Install the Qt4 development tools to get Qt Linguist (e.g. sudo apt-get install libqt4-dev qt4-dev-tools)
Creating a new translation
GNS3 has not been translated into your language (please check on the Team page), then this section is for you.
First download the latest skeleton translation source (based on English) and open it with Qt Linguist.
Then set your language and optionally your country under “Translation File Settings” available from the Edit menu.
Finally, save the translation source as Lang_CODE.ts where CODE is replaced by the language and country codes.
The language code is a two-letter code (ISO 639-1) that you can find here.
A country code only needs to be specified if the translation is only for one country’s dialect of a language that is not the default dialect. The country codes are specified in ISO 3166-1. For instance Brazilian Portuguese language and country codes gives pt_br to replace CODE, for Portuguese in Portugal only the language code is required (pt).
Other examples:
- French language for France: Lang_fr.ts
- French language for Canada: Lang_fr_ca.ts
- Serbian language for Serbia and Montenegro: Lang_sr.ts
- Ukrainian language for Ukraine: Lang_uk.ts
At this point you are ready to start translating, go to the translating section.
Updating an existing translation
To update an existing translation, you need to download the latest translation source (TS file) corresponding to your language. This file can been found on GNS3 code repository by using the following link with CODE replaced by the language/country code. Current codes can be found on the Team page.
http://code.gns3.net/gns3-devel/raw-file/tip/src/GNS3/Langs/Lang_CODE.ts
Translating
If you wish to learn how to use Qt linguist, please read this One Minute guide. Other than that translating strings should be very intuitive.
Note: the “English” string in the MainWindow context must be translated into your language name like you spell it in your language because it is displayed in GNS3 Preferences. For instance for the French translation, this string is translated to “Français”.
Translating Qt strings
In order to have GNS3 completely translated (the context menu and “Cancel” buttons and so on) you need a qt_xx.ts file for your language. These files translate all visible widgets of Qt into your language.
Qt provides them for many languages and they can be found in Qt packages. After extracting the archive the folder “translations” contains many files including qt_xx.ts. If you are lucky the file for your language is there too and you can copy it and put it into the right folder (see below or in the instructions that come with the translation for your language). If you don’t want to download a Qt package, here is the content of the translations directory as of Qt 4.7.1:
If there is no such a file available for your language you unfortunately have to create one if you want to have a complete translation of GNS3. In that case take the blank qt_untranslated.ts file, open it with Qt Linguist and translate it. You do not have to translate every string, only the following Qt classes used in GNS3:
QAbstractSpinBox, QApplication, QCheckBox, QComboBox, QDialog, QDialogButtonBox, QDockWidget, QFileDialog, QLineEdit, QMenu, QMenuBar, QMessageBox, QProgressDialog, QPushButton, QScrollBar, QSpinBox, QToolButton.
However if you are in a good mood and want to translate everything then I think the Qt guys could be interested in it.
Just for your curiosity, here is what you need to do if you want to generate qt_untranslated.ts yourself.
Compile and test your translation
After the translation, use File -> Release As option in Qt Linguist, this will create a .qm file, which is the compiled file containing the translation. *.qm files cannot be modified anymore so it is very important to hand out the .ts file(s), as well. You can also compiled your qt_xx.ts containing Qt string translation in the same way if needed.
Qt compiled translation file(s) should be put under the Langs directory:
- On Windows: C:\Program Files\gns3\Langs\Lang_CODE.qm
- On Linux or MacOS: ~/.gns3/Langs/Lang_CODE.qm
Start GNS3, go to Edit -> Preferences menu and select your language. If everything is ok, send us your translation sources by email (gns3dev at users.sourceforge.net) they will released with the next language pack or GNS3 version.
