Translation Files

From PsiWiki

Contents

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".

The psi_xx.qm file

If you want that Psi is 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 are with the translation. If there is no file provided you have to search for an incomplete start of an 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 I think) and when you are finished then provide both your psi_xx.ts file and your psi_xx.qm file as described in [7]. When you are apparent the first who wants to translate Psi into 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 [9] what to do.

Two Facilities

1. If you do not know if you have to translate strings like (sp) or (new line), which appear in blue in linguist, then you should read that [http://www.virtualbox.org/wiki/Translating ] and under "Translation hints" point five is explained how to handle this strings.
2. When you have stings like "psi/addContact" then this is no "real" sting, must not translate it. Is stands for an icon and you can mark it as translated so others (if you translate not alone) know that these kinds of strings must not be translated. Every "psi/" string is such an icon.

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 [10] and they are e.g. in QT packages, e.g. from [11]. After extracting the archive in the folder "translations" are many files but also qt_xx.qm. If you are lucky the file for your translation is there too, you can copy it and put it in the right folder (see below or in the instructions that are with the translation for your language). If there is not such a file available for your language you unfortunately have to create one when you want a complete translation of Psi. In that case take the blank qt_untranslated.ts file, open it with linguist [12] and translate. You do not have to translate every string, look what you need and what not to avoid not necessary work. After the translation save the file with the correct name (qt_languagecode.ts) click "release" and linguist will make you a .qm file, that are compiled files which contain the translation. *.qm files cannot be modified anymore so it is very important to give the .ts file away, too.


To make sure that your work (-> translation of psi_xx.qm or/and qt_xx.qm) was not for nothing you should make them public in the internet so that other users can take profit of it and improve this translation when you have not anything to do anymore with Psi.

Mac OS X distinctive features

On MAC OS X is QT unable to control the complete application menu (and "Open File" dialogs) [13], it is a bit tricky to translate this: In this case you should read at first 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 later copy it in that folder. Notice, that you have to make Textedit if you use it to create textfiles, not formattable texts in the options (.txt instead of .rtf). Write in that file the content described in [14] 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 in your language.

Instructions how to place the translation files

In [15] is explained how to place the psi_xx.qm file for GNU/Linux and Windows (except Vista) and Mac OS X. I will try to give instructions for those last cases and when somebody can convert them to good English someone could add them to the link above.

Mac OS X

In Applications folder click with the right mouse key (or ctrl-click) on Psi and then click on "Show Package Contents", go into the folder "Contents" then into "Resources" and place in that folder your psi_xx.qm and your qt_xx.qm file.

Windows Vista

I think you can put the psi_xx.qm in the folder where Psi is installed or without admin access in the folder that halr9000 wrotes here: [16] "I don't have Vista handy but I know the answer. It's <systemdrive>:\<localized string for "users">\<username> e.g. c:\users\halr9000 "

So put your *.qm files into that folder and your Psi should be translated after a restart.


When someone can confirm that it works in that ways and put it into good english we can publish it in post #1 in the first link. Please note on this page if it works or what is wrong.

(If you not already have a PsiWiki account then ask someone to create an account for you, everyone who already has an account can create other accounts. This is done to avoid spam. For example you can ask me [17] to create an account for you :).


Here my first try of improving the instructions of [18] (feel free to improve, too!):

Example psi_en.html

Language Pack: English<br>
Author: <a href="mailto:justin@affinix.com">Justin Karneges</a><br>
License: GPL<br>
<h3>Installation guide for the English language pack</h3>
1)  Download the language pack by clicking the  "Psi translation - Lang" link at the top of this page
<br><br>
2)  Place the file in the directory appropriate for your operating system:
<br><br>
<b>GNU/Linux</b> - Copy <i>psi_en.qm</i> to $HOME/.psi/
<br><br>
<b>Mac OS X</b> - Copy <i>psi_en.qm</i> to Applications/Psi.app/Contents/Resources/<br>
<p>To do that right click on Psi in the application folder and then click on "Show Package Contents". Go into the folder "Contents" and then into "Resources" and now you should place your psi_en.qm there.</p>
<br><br>
<b>Windows 95/98/Me</b> - Copy <i>psi_en.qm</i> to C:\Program Files\Psi\psidata (if you installed Psi
somewhere else, be sure to adjust that path).
<br><br>
<b>Windows 2000/XP</b> - There are two methods:
<br>
<p class="sidebox">
<b>a)</b> Copy </i>psi_en.qm</i> to C:\Program Files\Psi   (if you installed Psi
somewhere else, be sure to adjust that path).
<br>
<b>b)</b> If you don't have administrator access on your system, copy <i>psi_en.qm</i> to 
C:\Documents and Settings\USERNAME\psidata   (be sure to put your real username in there).
</p>
<br>
<b>Windows Vista</b> - There are also two methods:
<br>
<p class="sidebox">
<b>a)</b> Copy </i>psi_en.qm</i> to C:\Program Files\Psi   (if you installed Psi
somewhere else, be sure to adjust that path).
<br>
<b>b)</b> If you don't have administrator access on your system, copy <i>psi_en.qm</i> to 
<systemdrive>:\<localized string for "users">\<username>\psidata  (be sure to put your real username in there).
<br>
The language is set automatically because Psi looks for your system variable for your language. If you want (or must) change Psi to your language by hand you do that in "Profiles".
</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


So that was my suggestion. But I may repeat me: I am not sure if these methods work in that way. It would be great if someone could test if it works in that way works and notice it here (and of course improve those sentences, I think my English grammar could be better). Thanks!

Linux: works
Mac OS X: works
Win 95/98:
Win 2000/XP method 1: works
Win 2000/XP method 2:
Win Vista method 1:
Win Vista method 2:

See also

Updating Translations with lupdate