使用 Weblate 进行翻译工作

Thank you for interest in translating using Weblate. Projects can either be set up for direct translation, or by way of accepting suggestions made by users without accounts.

Overall, there are two modes of translation:

  • The project accepts direct translations

  • The project only accepts suggestions, which are automatically validated once a defined number of votes is reached

有关翻译工作流的更多信息,请见 翻译工作流

Options for translation project visibility:

  • 公开可见

  • 仅指定的翻译员群组可见

翻译项目

Translation projects hold related components; resources for the same software, book, or project.

../_images/project-overview.png

建议

备注

Actual permissions might vary depending on your Weblate configuration.

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

The suggestions are scanned on a daily basis to remove duplicates and suggestions matching the current translation.

评论

Three types of comments can be posted: for translations, source strings, or to report source string bugs when this functionality is turned on using 启用原文复查. Choose the one suitable to 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 语法,并使用 @mention 提及其他用户。

变体

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

标签

Labels are used to categorize strings within a project to further customize the localization workflow (for example to define categories of strings).

Weblate 使用以下标签:

自动翻译

字符串是使用 自动化翻译 翻译的。

原文需要复查

字符串是使用 源字符串复查 标记为需要复查的。

翻译

On the translation page, the source string and an editing area for its translation are shown. Should the translation be plural, multiple source strings and editing areas are shown, each described and labeled in the amount of plural forms the translated language has.

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

Various bits of extra info can be shown on this page, most of which coming from the project source code (like context, comments or where the message is being used). Translation fields for any secondary languages translators select in the preferences will be shown (see 第二语言) above the source string.

Below the translation, translators will find suggestion made by others, to be accepted (✓), accepted with changes (✏️), or deleted (🗑).

复数形式

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

Weblate has full support for each of these forms, in each respective language (by translating every plural separately). The number of fields and how it is in turn used in the translated application or project depends on the configured plural formula. Weblate shows the basic info, and the Language Plural Rules by the Unicode Consortium is a more detailed description.

参见

复数公式

Alternative translations

4.13 新版功能.

备注

This is currently only supported with Multivalue CSV file.

With some formats, it is possible to have more translations for a single string. You can add more alternative translations using the Tools menu. Any blank alternative translations will be automatically removed upon saving.

../_images/plurals.png

键盘快捷键

在 2.18 版更改: The keyboard shortcuts have been revamped in 2.18 to less likely collide with browser or system defaults.

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

键盘快捷键

说明

Alt+Home

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

Alt+End

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

Alt+PageUp

Ctrl+

Alt+

Cmd+

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

Alt+PageDown

Ctrl+

Alt+

Cmd+

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

Alt+Enter

Ctrl+Enter

Cmd+Enter

Submit current form; this is same as pressing Save and continue while editing translation.

Ctrl+Shift+Enter

Cmd+Shift+Enter

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

Ctrl+E

Cmd+E

Focus translation editor.

Ctrl+U

Cmd+U

Focus comment editor.

Ctrl+M

Cmd+M

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

Ctrl+1Ctrl+9

Cmd+1Cmd+9

Copies placeable of given number from source string.

Ctrl+M+19

Cmd+M+19

Copy the machine translation of given number to current translation.

Ctrl+I+19

Cmd+I+19

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

Ctrl+J

Cmd+J

显示 附近字符串 选项卡。

Ctrl+S

Cmd+S

定位到搜索框。

Ctrl+O

Cmd+O

复制源字符串。

Ctrl+Y

Cmd+Y

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

虚拟键盘

A small visual keyboard row is shown just above the translation field. This can be useful to keep local punctuation in mind (as the row is local to each language), or have characters otherwise hard to type handy.

The shown symbols factor into three categories:

../_images/visual-keyboard.png

翻译上下文

This contextual description provides related info about the current string.

字符串属性

Things like message ID, context (msgctxt) or location in source code.

截图

Screenshots can be uploaded to Weblate to better inform translators of where and how the string is used, see 字符串的可视化上下文.

附近字符串

显示翻译文件中相邻信息。这些信息通常是类似的上下文,并保证翻译的一致性。

其它的出现位置

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

翻译记忆库

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

术语表

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

近期变更

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

项目

Project info like instructions for translators, or a directory or link to the string in the version control system repository the project uses.

If you want direct links, the translation format has to support it.

翻译历史记录

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

Translated string length

Weblate can limit the length of a translation in several ways to ensure the translated string is not too long:

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

  • Maximal length in characters defined by translation file or flag, see 译文最大长度.

  • Maximal rendered size in pixels defined by flags, see 最大翻译大小.

自动建议

Based on configuration and your translated language, Weblate provides suggestions from several machine translation tools and 翻译记忆库. All machine translations are available in a single tab of each translation page.

参见

You can find the list of supported tools in 配置自动建议.

自动化翻译

You can use automatic translation to bootstrap translation based on external sources. This tool is called Automatic translation accessible in the Tools menu, once you have selected a component and a language:

../_images/automatic-translation.png

Two modes of operation are possible:

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

  • Using selected machine translation services with translations above a certain quality threshold.

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

警告

Be mindful that this will overwrite existing translations if employed with wide filters such as All strings.

Useful in several situations like consolidating translation between different components (for example the application and its website) or when bootstrapping a translation for a new component using existing translations (translation memory).

自动翻译的字符串会被打上 :guilabel:`Automatically translated`标签。

频次限制

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.

Default limits and fine-tuning is described in the administrative manual, see 频次限制.

搜索并替换

Change terminology effectively or perform bulk fixing of the strings using Search and replace in the Tools menu.

提示

不用担心会弄乱字符串。这是一个两步的过程,会在确认实际更改之前显示要编辑字符串的预览。

批量编辑

Bulk editing allows performing one operation on number of strings. You define strings by searching for them and set up something to be done for matching ones. The following operations are supported:

提示

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

矩阵视图

To compare different languages efficiently you can use the matrix view. It is available on every component page under the Tools menu. First select all languages you want to compare and confirm your selection, after that you can click on any translation to open and edit it quickly.

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

禅模式

The Zen editor can be enabled by clicking the Zen button on the top right while translating a component. It simplifies the layout and removes additional UI elements such as Nearby strings or the Glossary.

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