Using OmegaT for guides translation
OmegaT is an open source Computer Aided Translation tool. It is written in Java, translated in numerous languages and has a large community around it. We only describe here the necessary steps to use the tool with .odt files. Please read OmegaT documentation to know how to use it in your translation process.
Miloš Šrámek has made a presentation about his workflow (thanks a lot!), this wiki page describes the process based on the development he shared.
Download the software from the official site here: http://www.omegat.org/. Even if you are on Linux, the packages offered via the distro repository are often outdated, so it is better to install the version from the site. Also, the Java version required may not be the one offered by your distro, so choose the version with the Java installer.
To install it, follow the usual way on Windows. On Linux, there is a script that will place the package in /opt and install Java at a user level in case of another system installation, so just run linux-install.sh and you are done.
Now, download the guide you want to translate in .odt format. Launch OmegaT and follow these steps:
- Create a new project named GuideTrans for example. This will create a new directory in your home directory.
- In the Project creation window, set the languages for the source and the target, let the segmentation checked.
- Select the location of the guide you downloaded in the File for source language
- Let the other paths as they are, the corresponding directory will be created in the GuideTrans directory.
- Click OK, you are now ready to translate the guide.
When you have finished your translation, create an .odt document that will be placed in the GuideTrans/target directory by selecting Create translated files under the Project menu.
Remember that under the project directory (GuideTrans in our case) you have several sub-directories that you can access: dictionary, glossary, source and target and translation memory. There is also several .tmx files (translation memory files) under the omegat directory. Again, do not hesitate to read the OmegaT documentation to go further with this helpful tool.
Adding UI.po file
The translation for the LibreOffice interface and help is maintained by the l10n teams via Pootle. The format of the files there are .po files. The problem to work with those .po files is that they are puzzled in multiple directories. But, by using a tool named 'Translate toolkit' we can modify this structure to get a big .csv file. This .csv file can be added to OmegaT to serve as a glossary. There is a major interest in this glossary: while translating, you will be proposed the exact terms used in the menus and the dialog boxes, which is very important for consistency and the quality of the guides.
So, how to get all this in place [those explanations are on Debian, if you know how to do it on Windows, please add them :)]:
- First, download the UI.po file in your language from here: https://translations.documentfoundation.org/XX/libo_ui/ where XX is the code of your language.
- Download and install the Translate Toolkit from here: http://toolkit.translatehouse.org/index.html, there is an installer for Windows. On Linux, if you already had an old version installed, it is recommended to remove it before installing a new one.
- Create a directory (podir in our example) where you unzip the downloaded UI files
- Then, use the command line to convert po files to csv files from podir to csvdir (where the csv files will be placed)
po2csv -i podir -o csvdir
- We will now create the big csv file
cat `find csvdir -name \*.csv` > lo.csv
- Now navigate to csvdir directory and open the lo.csv file with LibreOffice, remove the first column that contains comments and save the file as text csv using tab as column separators.
- Copy the file to the GuideTrans/glossary directory.
Suggestions will appear on the Glossary area of the OmegaT window and on the contextual menu. You can also activate them using Options > Transtips > Unable Transtips.
Adding a 3rd file
The idea here is to add a third file that will serve as translation memory for the current translation. Imagine you have an old guide already translated that you want to update to the newest English version but based on the old one in your language. We will then transform an existing .odt old file in a .tmx file. Before the transformation, make sure that your file is clean of direct formatting to avoid extra tags to be created. Then:
- Create a new project in OmegaT called Aux
- Set the segment displaying so that it shows text only
- Copy the old translated guide to the Aux/source directory
- Now, using the mouse, copy all text for both files and paste it to a new file.
- Save the new file as a txt file, check the alignment of the segment and correct it using this tool http://sourceforge.net/projects/aligner/ and then export it as .tmx file.
Manage a Team Project
This part explains how to use the Team Project functionality of OmegaT. The Team Project feature in OmegaT makes it possible for multiple translators to work on the same translation project, over the internet, using a synchronized project memory and a synchronized project glossary. You need to have OmegaT 2.6.1_2 or newer to get it (I used version 3.1.7 for this guide).
There is two parts in this guide, the first part that will set the repository on GitHub to have the project synchronized, the second part on how to set the project on OmegaT. The team leader will set the OmegaT part, or ask Sophie on the Documentation project to set it for him, while the translators will only have to give the URL of the repository to OmegaT and translate as usual without taking care of anything else.
The first thing is to create a directory for your project on GitHub under the OmegaT repository. Well you need to be added to the OmegaT group too.
1. To be added to the project
- create an account on GitHub
- ask Sophie to be added to the LO/OmegaT group
2. Adding your language directory
- you need to have svn installed on your computer
- check out the repository using subversion to create a local repository:
svn co https://github.com/LibreOffice/OmegaT
- enter OmegaT/trunk and create the xx directory where xx is your language code
- download and unzip lo-guides-lang-template.zip, this template has been prepared by Milos and will create what is needed in your repository, which you can get from
<target_lang>XX</target_lang>in the LOGuides/omegat.project file, where XX is your language code
- copy the LOGuides and LOGuides-graphic into the OmegaT/trunk/xx directory
cp -r /source directory/LOGuides LOGuides-graphic OmegaT/trunk/xx
- add your language (xx is your language code) repository to svn
svn add xx
(if you do not want the odg files with screenshots, either delete LOGuides-graphics or do not add it to svn. They however may help, since except for screenshots there are also some drawings)
- you may try to open the project in OmegaT now (do not do that prior to 'svn add', since OmegaT will create a few files, which should not be stored in the repository)
- commit your language project (xx is your language code) with all the content inside
svn commit -m "xx project added"
1. Open the project from Omegat, replace xx by your language code in the URL:
- use Project -> Download team project
- enter "https://github.com/LibreOffice/OmegaT/trunk/xx/LOGuides" in the Repository URL Box and hit tab - if OK, OmegaT will detect repository type and confirm that it is a subersion repository just below the field.
- enter the name of the local work folder (or create it - do not use the original which you have used to check out by subversion)
- Hit 'OK'. OmegaT in its lower left corner shows progress
2. Start translating.
Any time you will save the project, it will be synchronized on GitHub, the glossary and the translation will be updated.
If there is other translators who want to work on the same project, they will need to create a account on GitHub, we will add them to the team, then they will have to follow the steps in #OmegaT part, they will never have to visit GitHub, everything will be handled by OmegaT.
The next steps are, as explain above:
- create glossary with GUI translation using the .po files on Pootle
- create tmx files from old translations to reuse them as a third file
- have everything translated by "google translate" to save a lot of typing