XLIFF, version upgrade or translation process (Diff Leverage step)

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> 
+4
source share
1 answer

There is an answer for this: http://tech.groups.yahoo.com/group/okapitools/message/2494


EDIT: content of the linked message

Hi Paul

I am trying to figure out how to use the diff lever to improve the translation experience and get to update the xliff file when merging / using existing translations with a new version of the document with added / changed / deleted lines.

As Jim noted, with XLIFF files you can use ID-based steps.

But the Diff leverage step will work too. Here's how to do it:

I assumed that you have XLIFF files and just want to update them. You can create pipelines that perform additional functions, such as creating a translation, etc., but this will keep things simple.

First you need to put the new source file in input list 1 and the translated file in input list 2.

Then you can create the following pipeline:

  • Raw document for filtering events
  • Diff leveraging
  • Filter events in a raw document

In the parameters for the Diff Leverage stage: make sure the option "Copy to / above target" is set.

Then run the conveyor.

I attached a comparison (compare_out.html) between the original new file and the output file. As you can see all the text that can now be used in the output. Your 'AdminTitleResource' entry is not translated, because the source in the translated file is different, and your two new entries are also not translated.

You will also notice that the new attributes = 'yes' are approved, which is indicate the translation. This additional flag can be used to differentiate records that require translation from were used.

For some reason, two of the loan records do not have this: I will have to look at it and report back. It may be a mistake or some condition I don’t remember (maybe Jim does).

A step based on Id-Based Copy could be almost better. He would copy the translated text by matching the resname entries. I say almost because it does not currently look at the source, so you get the translation even if the new source is different (this is not "use"). But we could add the ability to do this additionally check, and this would make the step work like a step using a lever. Sick try to find the time to do this.

Hope this helps, -yves

+3
source

Source: https://habr.com/ru/post/1386358/


All Articles