# Weblate 基础知识

## 项目和部件架构

在 Weblate 中，翻译被组织成项目和部件。每个项目可以包含多个部件，这些部件又包含各个语言的翻译。部件对应的是一个可翻译的文件（例如 [GNU gettext PO (Portable Object)](https://docs.weblate.org/zh-cn/latest/formats/gettext.md#gettext) 或 [Android 字符串资源](https://docs.weblate.org/zh-cn/latest/formats/android.md#aresource)）。项目可以帮助您将部件组织成逻辑集合（例如，将一个应用中用到的所有翻译集合在一起）。

另外，可使用类别来组织项目内部件。部件可归属于一个类别，且多个类别可被嵌套。

默认情况下，每个项目内都有对跨部件传播的公共字符串的翻译。这减轻了重复和多版本翻译的负担。但假如翻译应当有所不同，可以使用 [允许译文传播](https://docs.weblate.org/zh-cn/latest/admin/projects.md#component-allow-translation-propagation) 通过 [部件配置](https://docs.weblate.org/zh-cn/latest/admin/projects.md#component) 禁用翻译传播。

## 仓库集成

Weblate 被构建为和上游版本控制仓库集成，[持续本地化](https://docs.weblate.org/zh-cn/latest/admin/continuous.md) 描述了构建块以及更改如何在两者间流动。

#### SEE ALSO
[架构概览](https://docs.weblate.org/zh-cn/latest/admin/install.md#architecture) 描述了 Weblate 内部运行方式。

## 用户归因

Weblate 使用名字和电子邮箱在版本控制仓库中保留由译者恰当翻译的译文。将真实电子邮箱附加到提交遵循分布式版本控制精神并允许类似 GitHub 这样的服务将你在 Weblate 中的贡献关联到你的 GitHub 账户。

不过，此功能也会带来风险，公布在版本控制提交中的电子邮件地址可能会被滥用。此外，一旦此类提交公布在公开的代码托管平台（比如 GitHub），实际上将无法撤回。为了避免这种情况，Weblate 允许在 [账户](https://docs.weblate.org/zh-cn/latest/user/profile.md#profile-account) 中选择私密提交邮箱。

因此，管理员在配置 Weblate 时应当考虑到这一点：

* 应在服务条款中对电子邮箱的这种使用进行清晰描述，如果这样的文档是必需的。[法律组件](https://docs.weblate.org/zh-cn/latest/admin/optionals.md#legal) 可以提供帮助。
* [`PRIVATE_COMMIT_EMAIL_OPT_IN`](https://docs.weblate.org/zh-cn/latest/admin/config.md#std-setting-PRIVATE_COMMIT_EMAIL_OPT_IN) 可以将电子邮件地址默认设为私密。

<a id="translator-start"></a>

## 做出首个翻译

You can contribute to a project using your web browser. You do not need to
install Weblate or work with its source code repository.

### 寻找项目和语言

1. Follow the translation link from the project you want to help. Projects
   can use Hosted Weblate or their own Weblate installation; use an account on
   that installation. If you arrive at its dashboard, choose
   Projects > Browse all projects to find the project.
2. Sign in, or follow the site's registration instructions. Access depends on
   the project: you might need to request permission from its maintainers.
   Some projects also accept suggestions without signing in.
3. If you are signed in, open your user menu and choose Settings. Under
   Languages, select your Translated languages and,
   optionally, Secondary languages you understand. Secondary
   languages appear above the source as additional help. Save your settings.
   If you are contributing anonymously, skip this step and choose your language
   directly in the project as described below.

![Language settings with French selected for translation and German as a secondary language.](screenshots/onboarding-languages.webp)

Read the project's translation instructions before starting. These can explain
terminology, style, priorities, and how to contact the language team. If you
cannot find them, ask the maintainers which component to start with.

Choose your language and a component. A component groups related strings, such
as an application's interface or its documentation. Open
Untranslated strings to start with empty translations, or
Unfinished strings to include translations that still need work.
Use All strings or [搜索](https://docs.weblate.org/zh-cn/latest/user/search.md) to find existing translations.
If your language is missing, use the option to start or request a translation
when available, or contact the maintainers.

#### SEE ALSO
* [注册和用户个人资料](https://docs.weblate.org/zh-cn/latest/user/profile.md)
* [翻译链接](https://docs.weblate.org/zh-cn/latest/user/translating.md#strings-to-check)
* [限制翻译语言](https://docs.weblate.org/zh-cn/latest/workflows.md#workflow-language-restrictions)

### 翻译字符串

The editor shows the source text and a field for your translation. Read any
explanation, screenshot, nearby strings, and glossary entries before writing.
Short strings can have several meanings: ask in [评论](https://docs.weblate.org/zh-cn/latest/user/translating.md#user-comments) if the
context is unclear. Other languages can help, but their translations can also
contain mistakes.

Write a natural expression of the intended meaning in your language. Follow
your language's typography and the project's terminology and style. Preserve
technical markers such as placeholders and markup; see
[安全地翻译特殊文本](https://docs.weblate.org/zh-cn/latest/user/translating.md#translating-special-text). When Weblate displays several plural fields,
complete each one according to its label; see [复数形式](https://docs.weblate.org/zh-cn/latest/user/translating.md#plurals).

![French translation editor with plural forms, a missing-placeholder warning, the preferred glossary term for workspace, and a billing banner screenshot.](screenshots/translation-quality.webp)

Choose the action that fits your contribution:

* Save and continue saves your translation and opens the next
  string. Use Save and stay to remain on the current string.
* Mark Needs editing when saving a translation that still needs
  work. Clear it after you have resolved the outstanding issues.
* Suggest proposes a translation for someone to accept. Use this
  when you want another translator to consider your wording, or when the
  project only allows you to suggest changes. A suggestion does not replace
  the current translation until it is accepted.
* Skip moves on without saving your edits. You can return later.

The available actions depend on your permissions and the project's workflow.
For example, an approved translation might only allow you to suggest a change.
Saving in Weblate does not mean the translation is immediately published in the
application: review, repository synchronization, and releases depend on the
project. See [翻译状态](https://docs.weblate.org/zh-cn/latest/workflows.md#states) and [翻译工作流](https://docs.weblate.org/zh-cn/latest/workflows.md#workflows).

### Check your work and ask for help

Read your translation again after saving. If Weblate reports failing
[quality checks](https://docs.weblate.org/zh-cn/latest/user/checks.md), open their explanations and correct the
problem. Ignore a check only when you have confirmed it is a false positive and
your permissions allow it. Passing all checks does not guarantee that the
meaning or tone is correct. Review suggestions from translation memory or
machine translation just as carefully as text you write yourself.

Use a translation comment for questions about your language, or a source
string comment for an unclear or incorrect original. Explain the problem and
include the context you have found. If source editing or source review is
available, follow the project's instructions for proposing a correction;
otherwise use its advertised contact or repository link. See
[评论](https://docs.weblate.org/zh-cn/latest/user/translating.md#user-comments) and [接收源字符串反馈](https://docs.weblate.org/zh-cn/latest/devel/review.md#report-source).

### 持续贡献

Watch projects you want to return to and choose your [通知](https://docs.weblate.org/zh-cn/latest/user/profile.md#notifications).
Your [操作面板](https://docs.weblate.org/zh-cn/latest/user/profile.md#dashboard) helps you find watched translations in your selected
languages. You can also help by reviewing existing translations and suggestions
when your permissions allow it.

As you become familiar with the editor, explore [键盘快捷键](https://docs.weblate.org/zh-cn/latest/user/translating.md#keyboard),
[翻译上下文](https://docs.weblate.org/zh-cn/latest/user/translating.md#source-context), [术语表](https://docs.weblate.org/zh-cn/latest/user/glossary.md), and [搜索](https://docs.weblate.org/zh-cn/latest/user/search.md).
The editor's History tab shows earlier changes to a string.
See [首选项](https://docs.weblate.org/zh-cn/latest/user/profile.md#profile-preferences) for editor preferences and [下载和上传译文](https://docs.weblate.org/zh-cn/latest/user/files.md)
for downloading and uploading translations to work offline.
