管理翻译

添加新的翻译

新的字符串当出现在基础文件中式可以用于翻译,被称为 Template for new translations`(请参见 :ref:`component)。如果您的文件格式不需要这个的文件,如在多数单语言翻译流程的情况下,可以用空白文件来开始。

在 Weblate 中,当用户要求时新的语言可以立刻加入,或者新的通知会发送给项目管理员来同一或手动添加。这可以使用 组件配置 中的:ref:component-new_lang 来实现。

注解

If you add a language file in connected remote repository, respective translation will be added to the component when Weblate updates local repository.

More info on the repository update settings can be found on the 更新仓库.

移除现有译文

Languages, components, or the projects they are in, can be removed (deleted from Weblate and remote repository if used) from the menu ManageRemoval of each project, component, or language.

Initiating the Removal action shows the list of components to be removed. You have to enter the object’s slug to confirm the removal. The slug is the project’s, language’s, or component’s pathname as it can be seen in the URL.

If you want to remove just some specific strings, there are following ways:

  • Manually in the source file. They will be removed from the translation project as well upon Weblate’s repository update.

4.5 新版功能.

  • In Weblate’s UI via button ToolsRemove while editing the string. This has differences between file formats, see: 管理字符串

注解

If you delete a language file in connected remote repository, respective translation will be removed from the component when Weblate updates local repository.

More info on the repository update settings can be found on the 更新仓库.

字符串变体

变体可以将几个字符串组合在一起,这样翻译人员就可以在一个地方看到字符串的所有变体。

提示

Abbreviations (shortened forms, contractions) are a good example of variants.

将基于变体的键自动化

3.11 新版功能.

可以定义正则表达式,基于 组件配置 的单语言翻译的键将字符串分组:

../_images/variants-settings.png

如果 Key 匹配表达式,那么匹配部分被删除以生成变体的根键。然后,具有相同根键的所有字符串将成为单个变体组的一部分,也包括具有与根键完全匹配的键的字符串。

后面的表格列出了一些使用示例:

用例

正则表达式变量

匹配的翻译键

后缀识别

(Short|Min)$

monthShortmonthMinmonth

内联识别

#[SML]

dial#S.keydial#M.keydial.key

手动变体

4.5 新版功能.

可以使用 variant:SOURCE 标记手动连接特定字符串。这对没有键将字符串自动分组,或者需要将键不匹配但在翻译时应一起考虑的字符串进行分组的双语翻译很有用。

The additional variant for a string can also be added using the Tools while translating (when 管理字符串 is turned on):

../_images/glossary-tools.png

注解

各种字符串必须最长 768 个字符。这是由于 MySQL 数据库的兼容而导致的技术限制。

翻译时的变体

当翻译时变量在后面分组:

../_images/variants-translate.png

字符串标签

在项目配置中通过文本和颜色将组件翻译字符串分类。

../_images/labels.png

提示

标签可以通过批量编辑或使用 批量编辑 附加组件分配给 源字符串另外的信息 中的单元。