How to Translate Transifex Projects with OmegaT

From Okapi Framework
Jump to: navigation, search
This article shows how you can translate the files of a Transifex project using OmegaT.
Editing a Transifex project from OmegaT (Windows XP)
  • Transifex is a free and open-source translation collaborative platform. A Transifex project is a place where one party can upload files for translation, and another party can access these files to translate them online or locally.
  • OmegaT is a free and open-source translation tool that offers support for many file formats. It also provides a plugin mechanism to use addition filters.

Pre-requisites

For this example, we will assume there is a project called "My Project" in a Transifex server located at http://www.myserver.net that you want to translate from English into Spanish.

We assume you do have an account in the server, and you do have the proper rights to modify the Spanish translations (e.g. by belonging to the Spanish translation team for that project).

In addition you also need to know the identifier for the project. It is the last part of the URL that points to the project.
For example if the URL is https://www.myserver.net/projects/p/myproject/, the identifier is myproject.

You need to have OmegaT installed.

You need to have the Okapi Filters Plugin for OmegaT installed.

Note: The plugin with this functionality is beta and currently only available in the snapshots distributions (http://okapiframework.org/snapshots).

Creating the project file

1. On you machine, create an empty text file named myproject.txp. It can have any name, but must use the .txp extension.

2. Open the file in a text editor and enter the following:

host=http://www.myserver.net
user=theUsername
password=thePassword
projectId=myproject

3. Save the file (in UTF-8 if there are extended characters).

Creating the OmegaT project

1. Start OmegaT.

2. Create a new project. In our example the source is English (en) and the target Spanish (es).

Make sure the source and target languages codes of the OmegaT project match the source and target language codes of the Transifex project. For example English is en, not en-us. The case can be different and you can use either - or _ to separate country and region.

3. Once the project is created, simply add the file myproject.txp as a source file, using the Import Source Files button or command.

When you are importing the source file, the Transifex Filter fetches the list of all resources in the given project and loads them one by one into your OmegaT project.

The content of all the resources will appear as a single source file that is myproject.txp.

Note: This may not be the safest way to work, see below how to work with a specified sub-set of the resources of a project.

Pushing your translations into Transifex

Any time you want to update the Transifex project with your translations, simply use the Create Translated Documents command from the File menu of OmegaT. This will merge all the segments into the Transifex repository.

Warning: Currently, if a segment has not been translated, OmegaT saves a copy of the source segment in its place. This means once you create the translated documents from OmegaT, all strings in the Transifex will be populated, either by real translations or by copies of the source. And Transifex will mark the project as 100% completed.

Working with selected resources only

If your project file contains no resources, the filter fetches automatically all the resources available for the given project. This may be an issue if new resources are added at the middle of your work.

So it is highly recommended to work on a specified set of resources only.

You can do this by listing the identifiers of the resources you want to work with in the project file. For example:

host=http://www.myserver.net
user=theUsername
password=thePassword
projectId=myproject
resource1po
resource2po
resource13po

In the project above only the resources with the identifiers resource1po, resource2po and resource13po will be read and written back.

The resource identifier is the last part of the URL that points to the resource. For example, in http://www.myserver.net/projects/p/myproject/resource/resource13po/, the resource identifier is resource13po.

Limitations

  • Currently the Transifex does not provide a way to lock a resource using the API, so the plugin has no way to set a lock when fetching a resource from the Transifex server and putting it in your OmegaT project. You can lock and unlock the resources manually from the interface of Transifex.