XLIFF,版本控制或翻译更新过程(“差异杠杆"步骤) [英] XLIFF, versioning or translation updates process (Diff Leverage step)

查看:64
本文介绍了XLIFF,版本控制或翻译更新过程(“差异杠杆"步骤)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑使用 XLIFF 来标准化企业内部的本地化工作. 我对xliff并不陌生,并且做了一些研究之后,发现使用它的一般过程如下:

I am considering using XLIFF to standardize localization efforts within the enterprise. I am very new to xliff and having done some research I figured the following general process to use it:

  1. 从开发项目资源中提取字符串(.net的.resx, .properties for Java)-我发现的最好方法是使用 Okapi本地化工具箱中的Rainbow-并使用实用程序=> 翻译工具包创建"命令
  2. 然后翻译提取的文件,如上所述 http://www.opentag.com/okapi/wiki/index.php ?title = How_to_Translate_XLIFF_Documents 例如使用Virtaal应用程序
  3. 最后将翻译的xliff转换回原始格式(resx/properties)-这与Rainbow以及"Utilities => Translation Kit Post-Processing"都可以实现
  1. Extract strings from development project resources (.resx for .Net, .properties for Java) - the good way to do it as I found is to use Rainbow from Okapi Localization Toolbox - and use "Utilities => Translation Kit Creation" command
  2. Then translate the extracted file, like it is described at http://www.opentag.com/okapi/wiki/index.php?title=How_to_Translate_XLIFF_Documents for example using Virtaal application
  3. And finally convert the translated xliff back into original format (resx/properties) - which is possible to do with Rainbow as well "Utilities => Translation Kit Post-Processing"

到目前为止,一切都还很清楚,但是我想知道在添加或修改字符串资源时最佳做法是什么?我不希望每次有新的字符串以原始格式(resx/properties)添加到字符串资源中时,都不要重新翻译所有资源

So far everything is clear, however I would like to know what are the best practices when adding or modifying the string resources? I would prefer not to have all resources to be re-translated every time there is a new string added to the string resources in original format (resx/properties)

如果对翻译提供版本支持,那也将非常好-如果标记了相同版本的多种语言翻译将被合并(提供相同的字符串集).当添加新字符串或修改现有字符串时,版本也会更新.

That will be also great if there is a versioning support for the translations - so that multiple languages translations will be consolidated (provide the same set of strings) if they are marked with the same version. And version is updated when new string are added or existing strings are modified.

是否有可以立即使用的解决方案?还是我们必须自己建立一些东西?

Is there a ready to use solution for this? Or is it something we will have to build on our own?

我在Okapi Rainbow的Pipeline库中找到了 Diff Leverage 步骤,但是我很难使它正常工作.这是两个xliff文件.第一个是翻译成法语的资源的第一个版本,第二个是从资源的新版本生成的文件,并进行了以下更改:

I found the Diff Leverage step in Okapi Rainbow's Pipeline library, but I have a difficulty to get it working. Here are two xliff files. First one was the first version of the resources that was translated in French, the second one is an file generated from new version of resources with the following changes:

  • 1个字符串已更新(AdminTitleResource现在是管理资源)

  • 1 string updated (AdminTitleResource is now Administration Resource)

已删除1个字符串(HomeLinkResource消失了)

1 string removed (HomeLinkResource is gone)

添加了2个新字符串(项目和公司)

2 new strings added (Project and Company)

但是运行Diff Leverage管道不会产生翻译的智能合并.有什么想法吗?

But running Diff Leverage pipeline doesn't produce a smart merge of the translations. Any ideas why?

先前版本的资源翻译的xliff:

The 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>

如何获取仅包含需要翻译的字符串的XLIFF文件?

How do I get XLIFF file with only strings that need to be translated?

具有上面列出的更改的新文件:

The new file with 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>

推荐答案

在这里有一个答案: http://tech.groups.yahoo.com/group/okapitools/message/2494

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

链接消息的内容

保罗,

我正在尝试找出如何使用差异杠杆 改善翻译体验并获得 合并/利用现有文件时更新xliff文件 用新版本的文档翻译 添加/修改/删除的字符串.

I am trying to figure out how to use the diff leverage to improve the translation experience and get an update xliff file when merging/leveraging existing translation with new version of the document with added/modified/removed strings.

Jim指出,使用XLIFF文件,您也许可以利用 基于ID的步骤.

As Jim noted, with XLIFF files you may be able to take advantage of ID-based steps.

但是Diff杠杆步骤也将起作用.这是操作方法:

But the Diff leverage step would work too. Here is how to do it:

我假设您有XLIFF文件,只想更新它们. 您可以创建执行其他操作的管道,例如创建 翻译套件等,但这将使事情变得简单.

I've assumed you have the XLIFF files and just want to update them. You could create pipelines that do additional things like create a translation kit etc. but this will keep things simple.

首先,您需要将新的源文件放入输入列表1"中,然后 输入列表2中的翻译文件.

First you need to put the new source file in the Input List 1 and the translated file in the Input List 2.

然后您可以创建以下管道:

Then you can create the following pipeline:

  • 用于过滤事件的原始文档
  • 差异杠杆
  • 将事件过滤为原始文档
  • Raw document to Filter Events
  • Diff Leveraging
  • Filter Events to Raw Document

在差异杠杆"步骤的参数中:确保该选项 设置为复制到目标/目标上".

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

然后执行管道.

我附上了原始版本与新版本之间的比较(compare_out.html) 文件和输出文件.如您所见,所有可能的文本 现在已在输出中使用杠杆.您输入的"AdminTitleResource"不是 已翻译,因为它是已翻译文件中的源 不同,并且您的两个新条目也不会翻译.

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

您还将注意到其中存在的新属性"approved ="是" 表示翻译已完成.那个额外的标志可以用来 区分需要翻译的条目和那些需要翻译的条目 被利用.

You'll also note the new attributes approved='yes' that are there to indicate the translation was done. That extra flag can be used to differentiate entries that need translation from the one that have been leveraged.

由于某些原因,其中两个杠杆项目没有: 看看并报告.我可能是错误或某些情况 不要记得(也许吉姆记得).

For some reason two of the leveraged entries do not have it: I'll have to look at that and report back. It may be a bug or some condition I don't recall (maybe Jim does).

基于ID的复制步骤可能会更好.它将复制 通过匹配条目的重新命名来翻译文本.我说 几乎是因为当前它不查看源文本,所以您 即使新来源不同,也要翻译(不是 利用"步骤).但是我们可以添加一个选项来增加额外的费用 检查,这将使该步骤像杠杆步骤一样工作.患病的 尝试找出时间执行此操作.

The Id-Based Copy step could almost be better. It would copy the translated text by matching in the resname of the entries. I say almost because currently it does not look at the source texts, so you get the translation even if the new source is different (it's not a 'leveraging' step). But we could add an option to make that extra check and that would make the step work like a leveraging step. I'll try to find the time do this.

希望这会有所帮助, -伊夫斯

Hope this helps, -yves

这篇关于XLIFF,版本控制或翻译更新过程(“差异杠杆"步骤)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆