Translation

From RetroShare
Jump to: navigation, search

Contents


If you want to translate the wiki, look here

This article explains how to translate RetroShare (GUI) into your language, or correct existing translations. The main method is Transifex, but you can also learn how to set up the minimal environment you need for translating under Windows.

Use Transifex (recommended)

Since August 2012, it is possible to translate RetroShare on the Transifex translation platform:

This is now the recommended method for contributing to the translations. It is the best for coordination.

You can request to join a language team or request the creation of a new language.

The English source file will be periodically updated by the project maintainers followed by an announcement. No other language files need to be uploaded, everything is synced to the English file. The maintainers are able to grab all the translated files at once using a command-line interface.

Please read the Transifex editing interface documentation before jumping in the actual work.

When translating, you can see possible developer comments related to a particular string by clicking the Details tab (appears while overing over the source string).

After you have translated a significant amount of strings, you might benefit from the Translation Memory feature in the case of duplicate or very similar strings. The feature will also come in handy, when source strings get changed very slightly or are moved around. Keep an eye on the Suggestions tab in the Transifex editor for matches in the TM.

A reviewer in a language team is superior to a regular member. A regular member will not be able to change reviewed strings.

If you want to see what strings a particular team member has touched, use the search field in the editor and select Translator as the filter.

Microsoft Translator is available for machine translations. The free service offers 2 000 000 Characters/month.

Translating Offline

Due to limited bandwidth or Internet zones in your country you might be more comfortable translating locally on your computer and uploading the .ts file to Transifex when you are done. For this you will probably want to use an advanced translating application like Virtaal instead of Qt Linguist. You still have to use Qt Linguist to save .qm-files, if you want to check your work. If your language team has other members, you must coordinate your offline efforts with them so you don't do double work. You might also want to keep an eye on the SVN commits to see, if new English language files have been committed as these will be automatically updated to Transifex.

Be sure to read the Virtaal keyboard shortcut cheatsheet before starting to use it. Virtaal fetches translation suggestions from general online translation memory banks. Use TAB with autocompletion.

Using Qt Linguist

You can also translate the translation files directly in the source code. To prepare a translation, you need Qt Linguist, a program used in Qt to manage translations. Download and install it from here:

Download RetroShare sources (including language files)

Language files are part of RetroShare sources. It is recommended that you use the latest development version from SVN, that guarantees you have the latest language files: How to get the RetroShare sources.

Edit files in Qt Linguist

Qt Linguist allows you to "walk" through all texts and messages of RetroShare and submit your own translations. In order to use it:

  • If you are using the SVN repository, change into the retroshare-gui directory:
$ cd src/retroshare/retroshare-gui/src/ 
  • You need to update the .ts file with the latest strings:
$ lupdate RetroShare.pro
  • Open Qt Linguist
  • Open translation file: File-->Open, go to retroshare/retroshare-gui/src/lang
  • Select a ts file matching your language, for example retroshare_de.ts contains German translation

Here is an example of Qt Linguist doing German translation:
Qt-linguist.png

If your language isn't in the list

If after issuing the lupdate command you do not see a .ts file with your language, you need to modify the RetroShare.pro file:

  • Open RetroShare.pro in your favourite editor
  • Look for the following section:
unfinishedtranslations {

       TRANSLATIONS +=  \
            lang/retroshare_bg.ts \
            lang/retroshare_es.ts \
            ...
  • Add your language to the list, for instance with Thai:
unfinishedtranslations {

       TRANSLATIONS +=  \
            lang/retroshare_th.ts \
            lang/retroshare_bg.ts \
            lang/retroshare_es.ts \
            ...

You can now go back to the Edit files in Qt Linguist section

Check your changes

If you already are running RetroShare's SVN version, you can check the result of your work before submitting it. Modifying the .ts file won't update the binary automatically, so you need to perform the following steps:

  • Change into the retroshare-gui directory:
$ cd src/retroshare/retroshare-gui/src/ 
  • Update the .qm file corresponding to your language:
$ lrelease RetroShare.pro
  • Now recompile RetroShare, your changes should be effective

Checking without compiling

Since RetroShare build 5682, it is possible to see your changes without compiling. In Qt Linguist, simply select File - Release as.. and save the .qm file in the RetroShare translations subfolder. If you are checking a German translation for example, the name of the file would have to be retroshare_de.qm. Replace the "de" with your corresponding language code.

Submit edited files

Go to RetroShare Patch Tracker, create a new patch and attach your TS files. Inform developers to make sure your TS files are actually integrated.

Troubleshooting

Working with SVN

If you update the sources to the latest version available on the SVN repository, you will need to use lupdate again to refresh the .ts files. If you fail to do so, you might notice that some of your translations are mysteriously ignored.

Also, you will eventually run into conflicts during the SVN update. This happens because lupdate modifies every .ts file available, even though you don't necessarily work on them. It makes them out-of-sync regarding the SVN system, and if a new version of a .ts file is made available on the SVN repository, it is going to create a conflict. To resolve these conflicts just select the version from the SVN repository (how to do that depends on the SVN client you are using).

If you face a conflict on your .ts file when updating the sources from the SVN repository, always keep your modifications. Contact a developer on the forum to tell him about this problem which should not occur if you're the only one working on this .ts file.

Removing old entries

By default, lupdate doesn't remove strings in the .ts file. This means that even if they are removed from the source files, they continue to show up in Qt Linguist. It can be useful to keep them because code can sometimes be reverted, and it helps Qt Linguist to make better guesses on other strings. If you consider that the amount of "junk" strings is becoming too large, you can clean up the .ts file by appending the option -no-obsolete to lupdate, for instance:

$ lupdate -no-obsolete RetroShare.pro
Personal tools
Namespaces

Variants
Actions
Navigation
External websites
Wiki
Toolbox