Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Translations

Virus edited this page Oct 4, 2015 · 12 revisions

Translating liri-browser

Prerequisites

Add support for a new language

Once you have the application installed, you can start adding support for a new language. Just skip this section if you just want to improve existing translations.

Qt comes with the tool lupdate that allows adding new translation files. It should be located at <path to qt>/<version>/<architecture>/bin.

You can use this tool to add new translation files (*.ts):

$ <path to qt>/<version>/<architecture>/bin/lupdate liri-browser.pro -ts translations/<filename>.ts

As filename choose the name of the locale, with the language and country separated by underbars. Language is always lower case, and country is always upper case (e.g. "en_US").

Now you need to create a reference to that file in liri-browser.pro:

TRANSLATIONS += translations/de_DE.ts \
                translations/ru_RU.ts \
                translations/<filename>.ts

Translate

In the "bin"-directory of your Qt-Installation you will find a tool called "linguist". Run it and open the translation (*.ts) file of your choice.

Create binaries

The tool lrelease is used to create the translation binary files that will be shipped with the application:

$ <path to qt>/<version>/<architecture>/bin/lrelease translations/*

Release your work

If you want to publish your work you can either create a pull request or drop us a line in our Gitter chatroom (https://gitter.im/liri-browser/liri-browser). Contributions are greatly appreciated!

More information

More information about Qt's internationalization system can be found here: http://doc.qt.io/qt-5/internationalization.html