使用 Weblate 进行翻译工作

Thank you for your interest in translating with Weblate!

Generally, there are two most used modes of translation: * Project accepts direct translations * Project accepts the suggestions made by users. Sometimes, anonymous suggestions are accepted as well.

There are more translation workflows detailed in 翻译工作流.

Projects, or the components in them are either visible to everyone, or only to a certain group of translators.

翻译项目

翻译项目包含相关组件;同一软件、书籍或项目的资源。

../_images/project-overview.webp

建议

备注

实际权限可能因 Weblate 配置而异。

Anonymous users (by default) can only forward suggestions. Doing so is still available to signed-in users, in cases where uncertainty about a translation arises, prompting other translators to review it.

All suggestions are scanned on a daily basis to remove duplicates and those matching current translations.

评论

Three types of comments can be posted: * for translations * for source strings * for reporting source string bugs when this functionality is turned on using 启用原文审校.

Choose the suitable type for the topic you want to discuss. Source string comments are in any event good for providing feedback on the original string, for example that it should be rephrased, or to ask questions about it.

Markdown syntax can be used in all comments, as well as mentioning other users by using``@username``.

变体

Variants are used to group different-length variants of a string. The frontend of your project can then utilize different strings depending on the size of a screen or window.

标签

标签用于对项目中的字符串进行分类,以进一步自定义本地化工作流程(例如定义字符串的类别)。

Weblate 使用以下标签:

自动翻译

String translated using 自动翻译.

原文需要审校

String marked for review using 源字符串复查.

翻译

在翻译页面上,将显示源字符串及其译文的编辑区域。如果译文是复数的,则会显示多个源字符串和编辑区域,每个源字符串和编辑区域都以翻译语言具有的复数形式的数量进行描述和标记。

所有特殊空白字符都会添加红色下划线,并用灰色符号表示。多个接续的空格也会添加红色下划线,以提醒译者潜在的格式问题。

此页面上可以显示各种额外信息,其中大部分来自项目源代码(如上下文、注释或消息的使用位置)。译者在首选项中选择的任何第二语言的翻译字段都将显示在源字符串上方(参见 第二语言)。

在译文下方,译者可以看到其他人提出的建议,可以接受(✓),也可以接受修改(✏️),或者删除(🗑)。

复数形式

Words changing form to account for their numeric designation are called plurals. Each language has its own definition of them. English, for example, supports one. In the singular definition of an example “car”, implicitly one car is referenced, in the plural definition of “cars”, two or more cars are referenced (or the concept of cars as a noun). Languages like, for example, Czech or Arabic have more forms of plurals, and their rules for plurals are different as well.

Weblate has full support for each of these forms, in each respective language. Each grammatical number is translated in a separate field for a pre-defined set of cardinal numbers specific to the translation language. The number of fields and how they are in turn used in the translated application or project, depends on the configured plural formula. Weblate shows the basic information and the Language Plural Rules by the Unicode Consortium is a more detailed description.

参见

复数定义

../_images/plurals.webp

备选翻译

Added in version 4.13.

备注

目前只有 多值 CSV 文件 支持。

对于某些格式,单条字符串可以有多种翻译。您可以使用 工具 菜单添加更多替代翻译。保存后将自动删除任何空白的替代翻译。

键盘快捷键

以下键盘快捷键可以在翻译中使用:

键盘快捷键

说明

Alt+Home

导航到当前搜索中的第一个翻译。

Alt+End

导航到当前搜索中的最后一个翻译。

Alt+PageUp

Ctrl+

Alt+

Cmd+

导航到当前搜索中的前一处翻译。

Alt+PageDown

Ctrl+

Alt+

Cmd+

导航到当前搜索中的下一处翻译。

Ctrl+Enter

Cmd+Enter

提交当前表格;这与在编辑翻译时按 保存并继续 相同。

Ctrl+Shift+Enter

Cmd+Shift+Enter

取消标记翻译为“需要编辑”并提交它。

Alt+Enter

Option+Enter

将字符串提交为建议;这等同于在编辑译文时按下 建议

Ctrl+E

Cmd+E

焦点翻译编辑器。

Ctrl+U

Cmd+U

焦点评论编辑器。

Ctrl+M

Cmd+M

显示 自动建议 选项卡,请参见 自动建议

Ctrl+1Ctrl+9

Cmd+1Cmd+9

从源字符串复制给定数字的可放置。

Ctrl+M 后接 19

Cmd+M 后接 19

将给定数字的机器翻译复制到当前翻译。

Ctrl+I 后接 19

Cmd+I 后接 19

忽略未通过的检查列表中的一项。

Ctrl+J

Cmd+J

显示 附近字符串 选项卡。

Ctrl+S

Cmd+S

定位到搜索框。

Ctrl+O

Cmd+O

复制源字符串。

Ctrl+Y

Cmd+Y

勾选/取消勾选 需要编辑 复选框。

and

Browse the next translation strings.

Browse the previous translation strings.

虚拟键盘

A small visual keyboard row is shown just above the translation field. Its rows are specific to each language; it can be useful for local punctuation or characters that are hard to type by hand.

显示的符号分为三类:

../_images/visual-keyboard.webp

翻译上下文

此上下文说明提供有关当前字符串的相关信息。

字符串属性

诸如消息 ID、上下文(msgctxt)或源代码中的位置之类的东西。

截屏

可以将屏幕截图上传到 Weblate,以便更好地告知翻译人员该字符串的使用位置和方式,请参阅 字符串的可视化上下文

附近字符串

Displays neighbouring strings from the translation file. These are usually also used in a similar context and prove useful in keeping the translation consistent.

其它的出现位置

如果一条信息出现在多个地方(例如多个部件),若发现它们不一致,这个选项卡会显示所有的信息(参见 不一致的)。你可以选择使用其中之一。

翻译记忆库

查找过去翻译过的相似字符串,参见 翻译记忆库

术语表

显示当前信息中用到的项目术语表中的术语。

近期变化

显示最近通过Weblate更改了此信息的人员列表。

项目

项目信息,如翻译人员的说明,或项目使用的版本控制系统仓库中字符串的目录或链接。

如果你想要直接链接,翻译格式必须支持它。

翻译历史记录

Every change is by default (unless turned-off in component settings) saved in the database, and can be reverted. Optionally, translations can also be reverted in the underlying version control system.

已翻译的字符串长度

Weblate 可以通过多种方式限制翻译的长度,以确保翻译后的字符串不会太长:

  • The default limitation for translation is ten times longer than the source string. This can be modified with LIMIT_TRANSLATION_LENGTH_BY_SOURCE_LENGTH. If you are hitting this, it can also be caused by a monolingual translation being wrongly set up as a bilingual one, making Weblate mistaking the translation key for the actual source string. See 双语和单语格式 for more info.

  • Maximum length in characters defined by the translation file or flag, as per 译文最大长度.

  • Maximal rendered size in pixels as defined by flags; see 译文最大尺寸.

自动建议

根据配置和您的翻译语言,Weblate 提供来自多个机器翻译工具和 翻译记忆库 的建议。所有机器翻译都在每个翻译页面的一个选项卡中提供。

你也可以在 :ref:`translation-memory`执行词语索引搜索。

参见

您可以在 自动建议 中找到支持的工具列表。

自动翻译

你可以使用自动翻译来引导基于外部资源的翻译。这个工具叫做 自动翻译,一旦你选择了一个部件和一种语言,就可以在 工具 菜单中访问:

../_images/automatic-translation.webp

有两种操作模式可供选择:

  • 使用其他 Weblate 部件作为翻译的来源。

  • 使用选定的机器翻译服务,翻译高于特定质量阈值。

您还可以选择要自动翻译的字符串。

警告

请注意,如果使用诸如 所有字符串 之类的宽过滤器,这将覆盖现有的翻译。

在以下几种情况下非常有用,例如在不同组件之间合并翻译(例如应用程序及其网站),或者使用现有翻译(翻译记忆库)为新组件引导翻译。

自动翻译的字符串会被打上 自动翻译 标签。

频次限制

To avoid abuse of the interface, rate limiting is applied to several operations like searching, sending contact forms, or translating. If affected by it, you are blocked for a certain period, until you can perform the operation again.

默认限制和微调在管理手册中有描述,参见 频次限制

搜索并替换

使用 工具 菜单中的 搜索并替换 有效地更改术语或执行字符串的批量修复。

提示

Don’t worry about messing up the strings, as it is a two-step process. A preview of edited strings is shown before confirming the change.

批量编辑

Bulk editing allows performing one operation for multiple strings. Define strings by searching for them and actions to perform on matching ones. Supported operations:

提示

This tool is called Bulk edit, accessible in the Tools menu of each project, component or translation.

矩阵视图

You can compare different languages efficiently using this view It is available on every component page, from the Tools menu. First select all languages you want to compare, confirm your selection, then click on any translation to open and edit it.

The matrix view is also a very good starting point to find missing translations in different languages, and quickly add them from one view.

禅模式

This mode simplifies the layout and removes additional UI elements such as Nearby strings or the Glossary. It is available by clicking the Zen button on the top-right of the regular editor (translation of a string).

You can select the Zen editor as your default editor using the 首选项 tab on your 用户个人资料. You can also choose there between having translations listed Top to bottom or Side by side, depending on your personal preference.