Personal tools

Difference between revisions of "Translations"

From Rivendell Wiki

Jump to: navigation, search
(Created page with "== Tools needed to Translate == === Qt-Linguist === Preparing or updating a translation for Rivendell is done by editing a set of phrase dictionaries, using a tool called 'Qt...")
 
(No difference)

Latest revision as of 10:40, 13 March 2018

Tools needed to Translate

Qt-Linguist

Preparing or updating a translation for Rivendell is done by editing a set of phrase dictionaries, using a tool called 'Qt-Linguist'. Qt-Linguist is part of Qt, and should be included with most Linux distributions (try installing the 'qt-tools' package or something similar)(On Ubuntu install qt4-dev-tools). The Windows and Mac OS X versions will work fine for the purpose too. You can find these (as well as sources for Linux) on TrollTech's site.

Current Source Code

You will need a copy of the current source code. You have two options.

The first is to use the source code archive files from the Rivendell website website, however using them you will always be a bit behind in your translation as when a new version of Rivendell is released your translation of NEW items will not be included until the next release. Any new phrases will in the original English.

The second way is to use what is called CVS(Concurrent Versioning System). This allows you to download a copy of the source that the developer is working on and then translate for any new phrases that have been added to the program before the new versions of Rivendell are released.

Source Code Archive Files

The Source Code for Rivendell an be downloaded from the Rivendell website downloads page. It is near the bottom of the page. Either the Tar Archive of Rivendell Base Source Distribution or the ZIP Archive of Rivendell Base Source Distribution will work.

NOTE: Do not translate for the 1.7.2 version of Rivendell as development of it has stopped and only bug releases will be issued. Download the 2.* BETA version source code to translate from.

Source Code from CVS for Translating

CVS(Concurrent Versioning System) will create a folder called rivendell and download the the source code into it. For this tutorial I will use rduser as the Linux user name. I will assume that your terminal starts in your home folder /home/rduser. We can download the source and update it with read-only access. The Rivendell cvs is set-up so that we must login and logout after we finish. The following will login, then download (checkout) the source code and finally logout. The password needed for the login is cvs.

cvs -d:pserver:cvs@cvs.rivendellaudio.org:/home/cvs/cvsroot login
cvs -d:pserver:cvs@cvs.rivendellaudio.org:/home/cvs/cvsroot checkout rivendell
cvs -d:pserver:cvs@cvs.rivendellaudio.org:/home/cvs/cvsroot logout

Later to update your source code to the latest that is available you can run the following:

cvs -d:pserver:cvs@cvs.rivendellaudio.org:/home/cvs/cvsroot login
cvs -d:pserver:cvs@cvs.rivendellaudio.org:/home/cvs/cvsroot update 
cvs -d:pserver:cvs@cvs.rivendellaudio.org:/home/cvs/cvsroot logout

Setting up your Translation Environment

If you downloaded a source code archive then un-archive the source code. For this tutorial I we will assume that your Linux user is rduser and you are un-archiving it in your home directory. You should end up with a directory like:

/home/rduser/rivendell-1.7.2

However for this tutorial since people could be using the archive or checking out of cvs, I will use the following folder location for both as the location of the source code.

/home/rduser/rivendell

Open a terminal and make a folder to put your translation files in. I will assume you are in you will start in your home directory. Something like: /home/rduser

mkdir rdlanguages

Now change to the helpers directory inside your source code folders:

cd /rivendell/helpers

Setting up to translate using the Command line

When it is not possible to run the scripts below on your computer you can also use a terminal to setup your computer to do translation. See the wiki page on setting up for translation using the command line.

You will need zenity or kdialog to run these new scripts the way outlined below. If you have the Gnome or KDE desktops installed on your computer one or the other should be installed. The new rdtrans.sh can be run with bash and the setenvvar.sh can also be run with bash 4 or higher. If you are not sure if you have these installed try running them they will give you a message if the needed programs are not installed.

Translation Helper Scripts

The current rdtrans.sh will only do a few things and a patch has been submitted that will make it much easier to do translation. Until it is included with the current packages you can download it and two other translation helper scripts as well and save them in the /rivendell/helpers folder of your Rivendell source code folder. To download and make the new scripts executable run the commands below.

cd /home/rduser/rivendell/helpers 
mv rdtrans.sh rdtrans.sh.old
wget http://ubuntuone.com/p/S2G/rdtrans.sh
wget http://ubuntuone.com/p/S2H/rdtransgui.sh
wget http://ubuntuone.com/p/S2I/setenvvar.sh
chmod +x rdtrans.sh rdtransgui.sh setenvvar.sh

Rivendell Translation Utility

Start the GUI (graphical User interface by opening a terminal and typing:

./rdtransgui.sh

Set Environmental Variables

The first thing you will see is a dialog informing you about setting some environmental variables.

Rdtransgui.sh Need to set environmental variable first.png

The environmental variables tell the scripts where to find or put files as it does its work. At the end it will also offer to add some lines to a configuration file (.profile) so these will be loaded each time you log in and you will not need to answer these questions each time you run the script. The folder chooser boxes will suggest the best options for you. The three environmental variables you need to set are:

1) RD_SOURCE - The path to the top of the Rivendell source tree. The folder (called rivendell in our tutorial) where you unpack your archive or checkout (downloaded) the source code.

Setenvvar.sh Enter directory for the RD SOURCE variable info.png

Setenvvar.sh Enter directory for the RD SOURCE variable folder chooser.png

2) RD_LANGUAGES - The path to the top of the languages tree (/home/rduser/rdlanguages in our tutorial). This a working folder for your translation files.

Setenvvar.sh Enter directory for the RD LANGUAGES variable info.png

Setenvvar.sh Enter directory for the RD LANGUAGES variable folder chooser.png

3) RD_SHAREDDIR - The path to Rivendell's shared data directory /usr/local/share/rivendell by default /usr/share/rivendell on Ubuntu. You will find a number of .qm files it this folder whose name consists of a Rivendell application name and a language code.

Setenvvar.sh Enter directory for the RD SHAREDDIR variable info.png

Setenvvar.sh Enter directory for the RD SHAREDDIR variable folder chooser.png

Then you are asked if you would like lines added your .proile configuration file so that the environmental variables are loaded when you login. Then you will not need to answer these questions each time you run this script.

Setenvvar.sh Would you like me to add info.png]

Set Language Code

After you finish with setting the environmental variables you need to set on more thing. The language code of the translation you will be working on.

Rdtransgui.sh Enter Language Code.png

If you will be working on multiple translations you can change this from the menu to work with another language codes. The currently set language code will appear in the title of the Translation Utility menu.

Rivendell Translation Utility Menu

Rdtransgui.sh Menu.png

Here is a basic guide to the items in the menu:

Add Language

Adds the needed lines to the .pro files in the source package. This in effect adds the language to Rivendell. You should run this first and then later if new programs are added to Rivendell that you can translate for. An example of the line for German (de) for Switzerland (CH) would be:

TRANSLATIONS += rdairplay_de_CH
Remove Language

Removes the line from the .pro files in the source package. This is here in case you make a mistake an need to remove a language code.

Update Language

Updates or creates the .ts translation files in the source tree. You will need to run this to create the .ts files for each program. Later when new phrases or programs have been added to Rivendell you can run this again so that they will be added to your translation files (.ts). The translation files are named so: <name of the rivendell program>_<Language Code>.ts So for German for Switzerland (language code de_CH) for RDAirplay the language file would be named:

rdairplay_de_CH.ts
Read Language

Copies the translation files to your RD_LANGUAGES folder to be translated. You will need to run this each time after you run Update Language to get the translation files into your working folder.

Write Language

Copies the translation files to the source tree from the RD_LANGUAGES folder it preparation for testing. You will want to do this when you want to see what your translations look like in Rivendell or to pack them up and send them off to the developer for inclusion in the distributed source code.

This command along with the Test Language can also be used to install language files on currently installed systems.

Test Language

Creates the .qm files and installs them in the Rivendell shared data directory for testing. This makes the files need to run Rivendell with the translations you have created. It can also be used to install a language on a currently installed system with the write language command.

Pack Language

Makes an archive of the completed translations to send to the developer to be added to the source code. You will run this when you have completed your translation and it is ready to be included with Rivendell. Please email the archive that is created to the email address given in the dialog that pops up.

Set Environmental Variables

See the section above for a walk through with screen shots. This menu item is here in case you need to change these after starting.

Set Language Code

See the Translations#Set_Language_Codesection above for a explanation and screen shot.

Exit

This of course exits the menu.

Setting up a new language

To setup a new language with rdtransgui.sh is very simple. Once at the main menu having set your environmental variables and language code, select first Add Language, then Update Language, then Read Language.


Using Qt Linguist to Translate

Getting starting with Qt Linguist

After setting up your translation environment you are ready to translate with Qt Linguist. After installing Qt Linguist you can find it under the Programming menu.

Qt 4 Linguist menu.png


After starting it you will want to open a translation file from one of the Rivendell programs to begin translating.

Qt 4 Linguist open .png


Go to your translation folder. /home/rduser/rdlanguages for our tutorial.

Qt 4 Linguist Open Translation Files.png


Then open the the folder for the language you are translating and select the file for the program you want to translate for. It our screen shot this is for RDAirplay for German for Switzerland.

Qt 4 Linguist Open Translation Files de CH.png


After opening you will want to set the languages for the file you are opening. For the Source language, Language - English, Country/Region - Any Country. For the Target language fill in the appropriate settings.

Qt 4 Linguist-Settings for rdairplay de CH.png


Now you are ready to translate!

Qt 4 Linguist Ready to translate.png

More information on using Qt Linguist

For more information on translating see the online manual for translator for Qt Linguist or in Qt Linguist>Help>Manual> then select the link for translators. See the screen shots below.

Qt 4 Linguist-Help-Manual-menu.png


Then click on the the link in blue, Translators in the text to go to the section for Translators.


Qt 4 Linguist-Help-Section for Translators link.png

Start by read the section titled "The One Minute Guide to Using QT Linguist"


Qt 4 Linguist-Help-Section for Translators Outline.png

Translating from Multiple Languages

Maybe English is not your strong language and you understand another language that a translation already exists for Rivendell. You can open this other language read-only to help you translate.

Run the Rivendell Translation Utility and then for the additional language you want to use:

  1. Enter the language code
  2. Read Language

Then in Qt Linguist go to the File menu and select Open Read-Only...

Qt 4 Linguist open Read Only .png


Go to your translations folder. (/home/rduser/rdlanguages for our tutorial)

Qt 4 Linguist Open Translation Files de.png


After opening you will want to set the languages for the file you are opening. For the Source language, Language - English, Country/Region - Any Country. For the Target language fill in the appropriate settings.

Qt 4 Linguist-Settings for rdairplay de.png

Below you see a screen shot with all available translations in Rivendell at the time I created this tutorial plus my test translation of German for Switzerland. I hope that this tutorial will help Rivendell to be translated into many other languages.

Qt 4 Linguist Ready to translate multiple languages.png

Status of Current Translations

Note: This chart is a work in progress. To make it easier for the translators to edit, the language code has be inserted into each cell so it can be easily replaced with the current status of the whole translation and for each Rivendell program

Translators please update this table with current information.

Please give a over all status in the status row for the complete translation: In Progress, Incomplete, Maintained, Unmaintained.

Please give a status for each program: In Progress, Incomplete, Completed.


Status of Rivendell Translations
German

de

Spanish

es

Norwegian nynorsk

nn_NO

Norwegian bokmål

nb_NO

Portuguese-Brazil

pt-BR

Added v1.5.1 v1.7.0 v1.7.0 v1.7.0 rivendell-2.0.0beta0
Translator(s) Michael Papsdorf Luigino Bracci Eivind Ødegård ? Daniel Roviriego
Status Maintained es Maintained Questionable * pt_BR
Up to date as of: 09-Dec-2010 es 09-Dec-2010 pt_BR
LibRD Completed es Completed pt_BR
RDhpi Completed es Completed pt_BR
RDAdmin Completed es Completed pt_BR
RDAirplay Completed es Completed pt_BR
RDPanel Completed es Completed pt_BR
RDCastmanager Completed es Completed pt_BR
RDCatch Completed es Completed pt_BR
RDLibrary Completed es Completed pt_BR
RDLogEdit Completed es Completed pt_BR
RDLogin Completed es Completed pt_BR
RDLogmanager Completed es Completed pt_BR
RDgpimon Completed es Completed pt_BR
RMLsend Completed es Completed pt_BR
RDchunk Completed es Completed pt_BR
* Only a copy of the nn_NO


Template:Languages