Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Workflow / best practices for XLIFF

Tags:

xliff

I am using a command line tool (ng-xi18n) to extract the i18n strings from an angular 2 app I wrote. The output of this command is a messages.xlf file. Coming from a .po background, and being not familiar with .xlf, I assumed that this file is the equivalent to the .pot file (correct me if I am wrong).

I then assumed that if I want to translate my app, I had to cp messages.xlf messages.de.xlf to have a copy (messages.de.xlf) of the template file (messages.xlf) where I can translate each message into German (hence the .de.xlf).

After translating some dummy texts and running the app, I saw that it worked as expected, so I quit translating and continued developing the app. After some time, I added more i18n strings, and eventually thought that I had to update my template. And this is where things got hardly maintainable. I updated the template messages.xlf file, and quickly was wondering how I could update the new strings to my already translated messages.de.xlf file without loosing my progress.

When I was developing using .po files, this was no problem thanks to good tools like poEdit, but I didn't find anything comparable for .xlf. After trying some tools, I thought that the best choice would be Lokalize, but I didn't find a possibility to merge the template file to already translated (but outdated) files either.


Up to now, this was rather an essay than a question, so here's a quick summary:

  • Is the workflow of dealing with .xlf files really comparable to .po as I initially thought (described above), or is it completely different?
  • How am I suppose to update my already translated files?
  • What are the best practices dealing with .xlf files?
  • What are proof of concept tools to work with .xlf?

Sidenotes:

  • The Lokalize handbook was not helpful at all. I see a lot of functions that sound promising, like:
    • "File" > "Update file from template". I did not find anything in the handbook to explain this function. If I click on this, nothing happens.
    • "Sync" > "Open file for sync/merge". This seems to be a function to merge two similar files (by multiple translators) rather than a tool to update the translation file from a template. Even though there is a tooltip in Lokalize's primary sync tab, notifying me about "x unmatched entries", I just couldn't find anything to append those unmatched entries to my .de.xlf file.
    • [Update] Turns out, I had similar issues as in this question. After downgrading my version of Lokalize to the suggested one, many issues (including the ones mentioned in the question) disappeared. However, now the "Update file from template" option is greyed out, and I don't know why.
  • I also tried OmegaT, which does not work at all on my platform (Ubuntu 16.04).
  • [Update] Virtaal works great for merging new strings from a template, but the UI in general is very poorly designed...
  • Googling did not help, as every hit seems to be related to XCode or something.

Thanks for any help in advance, I really appreciate it

like image 305
CharlyDelta Avatar asked Sep 06 '16 13:09

CharlyDelta


People also ask

How do XLIFF files work?

The idea behind XLIFF is simple: only give translators what they really need, nothing else. Basically, content that needs to be translated is extracted from the original text and written to a XLIFF file, while the original document's structure is kept in a 'skeleton file'.

How do I merge XLIFF files?

Select the Open Translated File/Folder After Merging checkbox if you want to automatically open the translated document or folder after a successful merge operation. Click the Merge XLIFF button. XLIFF Manager merges the indicated file.

What is XLIFF in XML?

XLIFF (XML Localisation Interchange File Format) is an XML-based format created to standardize the way localizable data are passed between tools during translation and localization. It's also common format for translation tools. XLIFF files are bilingual or multilingual. XLIFF is not a source document format.

What can open an XLIFF?

To open XLIFF files, you can use any text editor that supports the format (such as Notepad, Sublime Text, or Notepad++), use online services, or Localazy - the online translation management system explicitly made for working with translation file formats.


1 Answers

I wrote a small npm command line tool called xliffmerge. In principle it does the same, that Roland Oldengarm does with his gulp tasks described in his blog article. It is free and you can have a look at it at https://github.com/martinroob/ngx-i18nsupport#readme

like image 132
Martin Roob Avatar answered Sep 28 '22 11:09

Martin Roob