Translation Files

From PsiWiki

Jump to: navigation, search

Contents

[edit] Translations files

"xx" stands for your language code [1], e.g. "de" for germany, so the files are called in that case "qt_de.qm" and "psi_de.qm" or "qt_de.ts" and "psi_de.ts".


[edit] The psi_xx.qm file

If you want Psi to be translated you need a translation file. This file is called "psi_xx.qm" and if you are lucky someone has already done the work for you and has made his work available. Preferentially you can find this translation files in the download section [2] on the Psi homepage [3]. Then you only need to download the file and put it into the right folder (see the instructions below or the instructions that come with the translation). If there is no file provided you have to search for an incomplete start of the translation (or an outdated one) for your language (a psi_xx.ts file) in the forums or this wiki or here [4] or ask in the Psi groupchat (Psi Groupchat (MUC)! Room name: psi@conference.psi-im.org). A good person to contact is halr9000 [5], the webmaster of the Psi homepage, and ask if there is a .ts file for your language. Continue this translation with linguist [6] (really good documentation by the way) and when you are finished provide both your psi_xx.ts file and your psi_xx.qm file as described in [7]. When you are the first who wants to translate Psi to your language you have to create a new psi_xx.ts file [8] and start from the beginning. When you are finished (respect!) see again on [9] what to do.

[edit] Two Facilities

1. If you do not know if you have to translate strings like (sp) or (new line), which appear blue in linguist, then you should read [10]. Under "Translation hints" point five it is explained how to handle these strings.
2. Strings like "psi/addContact" are no "real" strings, so you do not have to translate them. They stand for an icon and you can mark it as translated so others (if you do not translate alone) know that these kinds of strings need not be translated. Every "psi/" string is such an icon.

[edit] The qt_xx.qm file

In order to have Psi completely translated (the context menu and "Cancel" buttons and so on) you need a qt_xx.qm file for your language. These files translate all visible widgets of Qt into your language. Qt provides them for many languages [11] and they can be found in Qt packages, downloadable from [12]. After extracting the archive the folder "translations" contains many files including qt_xx.qm. 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 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 Psi. In that case take the blank qt_untranslated.ts file, open it with linguist [13] and translate it. You do not have to translate every string, look what you need to avoid unnecessary work. After the translation save the file with the correct name (qt_languagecode.ts) click "release" and linguist 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, as well.

To make sure your work (-> translation of psi_xx.qm or/and qt_xx.qm) is not wasted, you should make it public so that other users can benefit from it and improve it even if you do not have the time to work on Psi anymore.

[edit] The psi_xx.desktop

This file contains only two strings. The generic app name and a short description. Both are to be displayed in programme menus and such. The original strings are

GenericName=Jabber Client
Comment=Communicate over the Jabber network

If there is a file for you language available. If so, check if it fits your expectations, otherwise create the file and translate it like

GenericName[xx]=Jabber-Programm
Comment[xx]=Im Jabber-Netzwerk kommunizieren


[edit] The INFO file

This file is for your names and copyright notice. These information are important for Linux distro packagers who have to give proper copyright info for all files.

If the archive for your language does not contain the INFO file, just create it and put in your language code, the english name of your language, the license you want to have your translation under and your names with the years you contributed. Example:

de (German): GPL2+
Frederik Schwarzer <email@address>, 2009, 2010.

[edit] The xx.html file

This file contains the download instruction for users who download you language pack.

If the archive for your language does not contain the html file, fetch the sample file from below and create it.

[edit] Example psi_en.html

<!-- Please do NOT translate this first part. Just state the information in a non-localised way. -->
Language Pack: English<br />
Author: <a href="mailto:justin@affinix.com">Justin Karneges</a><br />
License: GPL<br />
<hr />

<!-- Start translating here. -->
Language Pack: English<br />
Author: <a href="mailto:justin@affinix.com">Justin Karneges</a><br />
License: GPL<br />
<h2>Installation guide for the English language pack</h2>
<p>
<h3>General Notes</h3>
Download the language pack by clicking the "Psi translation - Lang" link at the top of this page.
<br />
Place the file in the directory appropriate for your operating system as described in the instructions below.
<br />
The language is set automatically using your system's language settings. If you want to change the language in <em>Psi</em> by hand, you can do so in "Profiles".
</p>
<p>
<h3>GNU/Linux</h3>
<h4>Installation as User</h4>
Copy <tt>psi_en.qm</tt> to <tt><em>$HOME</em>/.psi/</tt>.
</p>
<p>
<h3>Mac OS X</h3>
<h4>System-wide Installation</h4>
Copy <tt>psi_en.qm</tt> to <tt>Applications/Psi.app/Contents/Resources/</tt>.
<br />
To do that right-click on <em>Psi</em> in the application folder and then click on "Show Package Contents". Go into the folder "Contents" and then "Resources". Now place your <tt>psi_en.qm</tt> here.
</p>
<p>
<h3>Windows 2000/XP/Vista</h3>
<h4>Installation as User</h4>
Copy <tt>psi_en.qm</tt> to <tt><em>%USERPROFILE%</em>\psidata</tt>.
<h4>System-wide Installation</h4>
Copy <tt>psi_en.qm</tt> to <tt>C:\Program Files\Psi</tt>. (If you installed <em>Psi</em> somewhere else, be sure to adjust that path.)
</p>

Note: The install html file should be converted to UTF-8 format using the iconv program before sending it to the Psi team for inclusion on the download page


[edit] Mac OS X distinctive features (TODO: is this still the case?)

On MAC OS X Qt is unable to control the complete application menu (and "Open File" dialogs) [14], so it is a bit tricky to translate it. In this case you first should read the link above and then a create a folder in your /Applications/Psi.app/Contents/Resources/ called "xx.lproj". (xx is you language code, de.lproj for german, see on top of the page and how you go to "Contents" is described below under "MAC OS X" in "Instructions how to place the translation files".) In this folder you create a textfile called "localisation.plist" (you can do that by creating it first on the desktop and then copy it into that folder. Notice, that you have to tell Textedit (in case you use it) to create textfiles instead of formattable texts (.txt instead of .rtf). Write the content described in [15] to that file and change the

[...]
<key>LprojLocale</key>
         <string>no</string>
[...]

to

[...]
<key>LprojLocale</key>
         <string>xx</string>
[...]

(xx = your language code)

After a restart of Psi the application menu and the file dialogs should be translated.

Personal tools