Sunday 24 January 2016

Translating drupal's yaml and po files on freetm.com


I am trying to find a solution to translate Drupal's .po and .yml files with a computer assisted translation (CAT) tool. Recently I had to use freetm.com, which I found quite useful, but it still has its own problems. For example you can only upload 10 files at a time. With drupal core's .po file it is not a problem, but as there are many .yml files, they have to be translated in batches of 10. Freetm.com supports the translation of XLIFF files, and the translation memory can be exported in the industry standard TMX format. I used the okapi framework to convert yml to xliff. As I remember, I have used it earlier to convert po files to xliff too.

To convert yaml files to xliff, run a command like:

tikal -x hu/user.delete.yml -seg -sl EN -tl HU -oe utf8

The -sl parameter specifies the source language, -tl specifies the target language with its 2 letter code.
After finishing the translation of .xlf files with freetm.com, copy the xlf files into the same directory as the original yml files, then run a command similar to the following:

tikal -m temp/*.xlf -sl EN -tl HU -oe utf8

Don't forget to add the output encoding (-oe), without it I have received ANSI encoded files.

1 comment:

  1. Hello! You can try https://poeditor.com/ to easily handle manage translation projects.

    ReplyDelete