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:
.xlf
files really comparable to .po
as I initially thought (described above), or is it completely different?.xlf
files?.xlf
?Sidenotes:
.de.xlf
file.Thanks for any help in advance, I really appreciate it
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'.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With