I am considering using XLIFF to standardize localization efforts within the enterprise. I am very new to xliff, and after doing some research, I figured out the following general process to use it:
- Extracting strings from development project resources (.resx for .Net, .properties for Java) is a good way to do this, as I found, use the Rainbow from the Okapi Localization Toolbox - and use the "Utilities => Translation Kit Creation"
- Then translate the extracted file as described in http://www.opentag.com/okapi/wiki/index.php?title=How_to_Translate_XLIFF_Documents for example using the Virtaal application
- And finally, convert the translated xliff to the original format (resx / properties) - which is also possible to do with Rainbow "Utilities => Postprocess translation set"
Everything is clear so far, however I would like to know what are the best practices when adding or modifying string resources ? I would prefer that all resources are not translated every time a new line is added to the original format (resx / properties)
This is also great if there is support for version support for translations , so translations of several languages will be merged (provide the same set of strings) if they are marked with the same version. And the version is updated when a new line is added or existing lines are changed.
Is there a ready-to-use solution for this? Or is it something we will need to build on our own?
EDIT:
I found the Diff Leverage step in the Okapi Rainbow Pipeline library, but it's hard for me to get it working. Here are two xliff files. The first was the first version of the resources, which was translated into French, the second is a file created from a new version of the resources with the following changes:
1 row updated (AdminTitleResource is now an administration resource)
1 row deleted (HomeLinkResource missing)
Two new lines added (project and company)
But a working Diff Leverage pipeline does not create an intelligent merge of transfers. Any ideas why?
Translated xliff for previous version of resources:
<?xml version="1.0" encoding="windows-1252"?><xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:okp="okapi-framework:xliff-extensions" version="1.2"> <file original="/Messages.resx" source-language="en-us" target-language="fr-fr" datatype="xml"> <body> <trans-unit id="1" resname="AccessDenied" xml:space="preserve" approved="yes"> <source xml:lang="en-us">Access denied</source> <target xml:lang="fr-fr" state="translated">Accès refusé </target> <note>Error message</note> </trans-unit> <trans-unit id="2" resname="AdminTitleResource" xml:space="preserve" approved="yes"> <source xml:lang="en-us">Administration</source> <target xml:lang="fr-fr" state="translated">Administration</target> <note></note> </trans-unit> <trans-unit id="3" resname="HomeLinkResource" xml:space="preserve" approved="yes"> <source xml:lang="en-us">Main page</source> <target xml:lang="fr-fr" state="translated">Page web principale</target> <note></note> </trans-unit> <trans-unit id="4" resname="SelectCategoriesResource" xml:space="preserve" approved="yes"> <source xml:lang="en-us">Categories</source> <target xml:lang="fr-fr" state="translated">Catégories</target> <note></note> </trans-unit> <trans-unit id="5" resname="SelectConfigResource" xml:space="preserve"> <source xml:lang="en-us">Configuration</source> <target xml:lang="fr-fr" state="needs-review-translation">Paramètres</target> <note></note> </trans-unit> <trans-unit id="6" resname="SelectGroupsResource" xml:space="preserve"> <source xml:lang="en-us">User groups</source> <target xml:lang="fr-fr" state="needs-review-translation">Utiliser le groupe</target> <note></note> </trans-unit> </body> </file> </xliff>
How to get XLIFF file with only strings to be translated?
New file with the changes listed above:
<?xml version="1.0" encoding="windows-1252"?><xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:okp="okapi-framework:xliff-extensions" version="1.2"> <file original="/Messages_v2.resx" source-language="en-us" target-language="fr-fr" datatype="xml"> <body> <trans-unit id="1" resname="AccessDenied" xml:space="preserve"> <source xml:lang="en-us">Access denied</source> <target xml:lang="fr-fr">Access denied</target> <note>Error message</note> </trans-unit> <trans-unit id="2" resname="AdminTitleResource" xml:space="preserve"> <source xml:lang="en-us">Administration Resource</source> <target xml:lang="fr-fr">Administration Resource</target> <note></note> </trans-unit> <trans-unit id="3" resname="SelectCategoriesResource" xml:space="preserve"> <source xml:lang="en-us">Categories</source> <target xml:lang="fr-fr">Categories</target> <note></note> </trans-unit> <trans-unit id="4" resname="SelectConfigResource" xml:space="preserve"> <source xml:lang="en-us">Configuration</source> <target xml:lang="fr-fr">Configuration</target> <note></note> </trans-unit> <trans-unit id="5" resname="SelectGroupsResource" xml:space="preserve"> <source xml:lang="en-us">User groups</source> <target xml:lang="fr-fr">User groups</target> <note></note> </trans-unit> <trans-unit id="6" resname="Project" xml:space="preserve"> <source xml:lang="en-us">Project</source> <target xml:lang="fr-fr">Project</target> <note></note> </trans-unit> <trans-unit id="7" resname="Company" xml:space="preserve"> <source xml:lang="en-us">Company</source> <target xml:lang="fr-fr">Company</target> <note></note> </trans-unit> </body> </file> </xliff>
source share