schmittjoh/JMSTranslationBundle — pull request #150 by peetersdiet (2013-09-14 17:26:46+00:00)
Title: Fixed I/O between Xliff/Xlf formats.

I added the ability for the extractor to keep (certain) information from existing xliff-files. The passthrough of xliff-data is currently limited to note-elements (children of trans-unit), and attributes trans-unit['approved'] and target['state'].

The main change I had to make was in the Updater where I reversed the merge-operation between existing and scanned message. This way the existing message is used as the basis instead of the scanned message. The resulting message should be the same as before, except that extra information from the existing message is not discarded, so the dumper can recreate the source read by the loader. I only added an XliffMessage, but the reversal of the merge-operation between scanned and existing messages makes it feasible to support data-retention for other formats.

On the side, I also added the service-definition for the xlf-loader, so it is the same as the xliff-loader.

In short:
- Configured loader for xlf to be the same as for xliff.
- Added XliffMessage to store:
* note-elements (children of trans-unit)
* attribute trans-unit('approved')
* attribute target('state').
- Added I/O passthrough of existing input, e.g. XliffMessage, in Updater.php.
- Modifications to XliffLoader and XliffDumper to use XliffMessage.
- Added tests.

This should fix issue #147.