Переводческие проекты

Translation organization

Weblate organizes translatable VCS content of project/components into a tree-like structure.

Weblate supports a wide range of translation formats (both bilingual and monolingual ones) supported by Translate Toolkit, see Поддерживаемые форматы файлов.

Примечание

You can share cloned VCS repositories using Внутренние URL-адреса Weblate. Using this feature is highly recommended when you have many components sharing the same VCS. It improves performance and decreases required disk space.

Adding translation projects and components

Изменено в версии 3.2: An interface for adding projects and components is included, and you no longer have to use The Django admin interface.

Изменено в версии 3.4: The process of adding components is now multi staged, with automated discovery of most parameters.

Based on your permissions, new translation projects and components can be created. It is always permitted for superusers, and if your instance uses billing (e.g. like https://hosted.weblate.org/ see Биллинг), you can also create those based on your plans allowance from the user account that manages billing.

Вы можете просмотреть свой текущий тарифный план на отдельной странице:

../_images/user-billing.png

The project creation can be initiated from there, or using the menu in the navigation bar, filling in basic info about the translation project to complete addition of it:

../_images/user-add-project.png

После создания проекта вы попадаете непосредственно на страницу проекта:

../_images/user-add-project-done.png

Создание нового компонента перевода можно инициировать одним щелчком мыши. Процесс создания компонента многоступенчатый, большинство параметров перевода он определяет автоматически. Существует несколько подходов к созданию компонента:

Из системы контроля версий

Создать компонент из удалённого репозитория системы контроля версий.

Из уже существующего компонента

Создать дополнительный компонент на основе уже существующего, только с другими файлами.

Дополнительная ветка

Создать дополнительный компонент на основе уже существующего, только для другой ветки.

Загрузить файлы перевода

Загрузить файлы перевода в Weblate в случае, если у вас нет системы контроля версий или вы не хотите интегрировать её с Weblate. Позже вы сможете обновить содержимое через веб-интерфейс или API.

Перевести документ

Загрузить одиночный документ и перевести его.

Начать с нуля

Создать пустой проект перевода и добавить строки вручную.

Имея существующие компоненты перевода, вы также можете легко добавлять новые для дополнительных файлов или веток из того же репозитория.

Сначала вам нужно указать наименование и расположение репозитория:

../_images/user-add-component-init.png

На следующей странице вам будет представлен список обнаруженных переводимых ресурсов:

../_images/user-add-component-discovery.png

На последнем этапе просмотрите информацию о компоненте перевода и укажите дополнительные сведения:

../_images/user-add-component.png

Настройка проекта

Create a translation project and then add a new component for translation in it. The project is like a shelf, in which real translations are stacked. All components in the same project share suggestions and their dictionary; the translations are also automatically propagated through all components in a single project (unless turned off in the component configuration), see Memory Management.

These basic attributes set up and inform translators of a project:

Название проекта

Подробное наименование проекта, используемое для его отображения.

Плашка проекта

Название проекта, подходящее для указания его в URL-адресе.

Веб-сайт проекта

URL-адрес, по которому переводчики могут найти дополнительную информацию о проекте.

Список рассылки

Список рассылки, в котором переводчики могут обсуждать или комментировать переводы.

Инструкции для переводчиков

URL to more site with more detailed instructions for translators.

Set Language-Team header

Whether Weblate should manage the Language-Team header (this is a GNU gettext only feature right now).

Использовать совместную память переводов

Использовать ли совместно используемую память переводов, см. подробнее Совместная память переводов.

Вносить вклад в совместную память переводов

Whether to contribute to shared translation memory, see Совместная память переводов for more details.

Управление доступом

Configure per project access control, see По-проектный контроль доступа for more details.

Значение по умолчанию можно изменить установкой параметра DEFAULT_ACCESS_CONTROL.

Включить рецензии

Enable review workflow for translations, see Выделенные рецензенты.

Включить рецензии исходных строк

Enable review workflow for source strings, see Рецензирование исходных строк.

Включить обработчики

Whether unauthenticated Обработчики уведомлений are to be used for this repository.

Исходный язык

Language used for source strings in all components. Change this if you are translating from something else than English.

Подсказка

In case you are translating bilingual files from English, but want to be able to do fixes in the English translation as well, you might want to choose English (Developer) as a source language. To avoid conflict between name of the source language and existing translation.

For monolingual translations, you can use intermediate translation in this case, see Файл промежуточного языка.

Псевдонимы языка

Define language codes mapping when importing translations into Weblate. Use this when language codes are inconsistent in your repositories and you want to get a consistent view in Weblate.

The typical use case might be mapping American English to English: en_US:en

Multiple mappings to be separated by comma: en_GB:en,en_US:en

Подсказка

The language codes are mapped when matching the translation files and the matches are case sensitive, so make sure you use the source language codes in same form as used in the filenames.

Конфигурация компонента

A component is a grouping of something for translation. You enter a VCS repository location and file mask for which files you want translated, and Weblate automatically fetches from this VCS, and finds all matching translatable files.

You can find some examples of typical configurations in the Поддерживаемые форматы файлов.

Примечание

It is recommended to keep translation components to a reasonable size - split the translation by anything that makes sense in your case (individual apps or addons, book chapters or websites).

Weblate easily handles translations with 10000s of strings, but it is harder to split work and coordinate among translators with such large translation components.

Should the language definition for a translation be missing, an empty definition is created and named as «cs_CZ (generated)». You should adjust the definition and report this back to the Weblate authors, so that the missing languages can be included in next release.

The component contains all important parameters for working with the VCS, and for getting translations out of it:

Название компонента

Verbose component name, used to display the component name.

Плашка компонента

Название компонента, подходящее для указания его в URL-адресе.

Проект компонента

Настройка проекта, которому принадлежит компонент.

Система контроля версий

Используемая система контроля версий, подробнее смотрите в разделе Интеграция с системой контроля версий.

Репозиторий исходного кода

VCS repository used to pull changes.

См.также

See Доступ к репозиториям for more details on specifying URLs.

Подсказка

This can either be a real VCS URL or weblate://project/component indicating that the repository should be shared with another component. See Внутренние URL-адреса Weblate for more details.

URL для отправки в репозиторий

Repository URL used for pushing. This setting is used only for Git and Mercurial and push support is turned off for these when this is empty.

См.также

See Доступ к репозиториям for more details on how to specify a repository URL and Pushing changes from Weblate for more details on pushing changes from Weblate.

Просмотрщик репозитория

URL of repository browser used to display source files (location of used messages). When empty, no such links will be generated. You can use Template markup.

For example on GitHub, use something like: https://github.com/WeblateOrg/hello/blob/{{branch}}/{{filename}}#L{{line}}

In case your paths are relative to different folder, you might want to strip leading directory by parentdir filter (see Template markup): https://github.com/WeblateOrg/hello/blob/{{branch}}/{{filename|parentdir}}#L{{line}}

URL экспортированного репозитория

URL where changes made by Weblate are exported. This is important when Непрерывная локализация is not used, or when there is a need to manually merge changes. You can use Git exporter to automate this for Git repositories.

Ветка репозитория

Which branch to checkout from the VCS, and where to look for translations.

Ветка для отправки

Branch for pushing changes, leave empty to use Ветка репозитория.

Примечание

This is currently only supported for Git and GitHub, it is ignored for other VCS integrations.

Маска файла

Mask of files to translate, including path. It should include one «*» replacing language code (see Определения языка for info on how this is processed). In case your repository contains more than one translation file (e.g. more gettext domains), you need to create a component for each of them.

For example po/*.po or locale/*/LC_MESSAGES/django.po.

In case your filename contains special characters such as [, ], these need to be escaped as [[] or []].

Правка базового файла

Whether to allow editing the base file for Одноязычные компоненты.

Файл промежуточного языка

Intermediate language file for Одноязычные компоненты. In most cases this is a translation file provided by developers and is used when creating actual source strings.

When set, the source translation is based on this file, but all others are based on Одноязычный базовый файл. In case the string is not translated in source translation, translating to other languages is prohibited. This provides Шлюз качества для исходных строк.

Шаблон для новых переводов

Base file used to generate new translations, e.g. .pot file with gettext.

Подсказка

In many monolingual formats Weblate starts with blank file by default. Use this in case you want to have all strings present with empty value when creating new translation.

Формат файла

Translation file format, see also Поддерживаемые форматы файлов.

Source string bug report address

Email address used for reporting upstream bugs. This address will also receive notification about any source string comments made in Weblate.

Разрешить распространение перевода

Вы можете отключить распространение переводов на этот компонент из других компонентов этого же проекта. Это сильно зависит от того, что вы переводите, иногда желательно использовать разные переводы для одинаковых строк.

It’s usually a good idea to turn this off for monolingual translations, unless you are using the same IDs across the whole project.

Значение по умолчанию может быть изменено параметром DEFAULT_TRANSLATION_PROPAGATION.

Включить предложения

Whether translation suggestions are accepted for this component.

Голосование по предложению

Turns on votecasting for suggestions, see Голосование по предложению.

Автоматическое принятие предложений

Automatically accept voted suggestions, see Голосование по предложению.

Флаги перевода

Customization of quality checks and other Weblate behavior, see Настройка поведения.

Принудительные проверки

List of checks which can not be ignored, see Enforcing checks.

Лицензия перевода

License of the translation (does not need to be the same as the source code license).

Соглашение участника

Пользовательское соглашение, которое должно быть одобрено, прежде чем пользователь сможет переводить этот компонент.

Добавление нового перевода

How to handle requests for creation of new languages. Available options:

Связаться с сопровождающими

User can select desired language and the project maintainers will receive a notification about this. It is up to them to add (or not) the language to the repository.

Указать URL на инструкции по переводу

User is presented a link to page which describes process of starting new translations. Use this in case more formal process is desired (for example forming a team of people before starting actual translation).

Создать новый язык

Пользователь может выбрать язык и Weblate автоматически создаст для него файл, так что можно сразу начинать переводить.

Запретить добавление новых переводов

There will be no option for user to start new translation.

Стиль кода языка

Customize language code used to generate the filename for translations created by Weblate, see Добавление новых переводов for more details.

Стиль слияния

You can configure how updates from the upstream repository are handled. This might not be supported for some VCSs. See Merge or rebase for more details.

Default value can be changed by DEFAULT_MERGE_STYLE.

Commit, add, delete, merge and addon messages

Message used when committing a translation, see Template markup.

Default value can be changed by DEFAULT_ADD_MESSAGE, DEFAULT_ADDON_MESSAGE, DEFAULT_COMMIT_MESSAGE, DEFAULT_DELETE_MESSAGE, DEFAULT_MERGE_MESSAGE.

Имя произведшего коммит

Name of the committer used for Weblate commits, the author will always be the real translator. On some VCSs this might be not supported.

Default value can be changed by DEFAULT_COMMITER_NAME.

E-mail делающего коммит

Email of committer used for Weblate commits, the author will always be the real translator. On some VCSs this might be not supported. The default value can be changed in DEFAULT_COMMITER_EMAIL.

Отправлять при коммите

Whether committed changes should be automatically pushed to the upstream repository. When enabled, the push is initiated once Weblate commits changes to its internal repository (see Lazy commits). To actually enable pushing Repository push URL has to be configured as well.

Возраст изменений для коммита

Sets how old changes (in hours) are to get before they are committed by background task or commit_pending management command. All changes in a component are committed once there is at least one older than this period.

Default value can be changed by COMMIT_PENDING_HOURS.

Блокировать при ошибке

Enables locking the component on repository error (failed pull, push or merge). Locking in this situation avoids adding another conflict which would have to be resolved manually.

The component will be automatically unlocked once there are no repository errors left.

Языковой фильтр

Regular expression used to filter the translation when scanning for filemask. This can be used to limit the list of languages managed by Weblate.

Примечание

You need to list language codes as they appear in the filename.

Some examples of filtering:

Filter description

Регулярное выражение

Selected languages only

^(cs|de|es)$

Exclude languages

^(?!(it|fr)$).+$

Exclude non language files

^(?!(blank)$).+$

Include all files (default)

^[^.]+$

Регулярное выражение вариантов

Regular expression used to determine the variants of a string, see Варианты строк.

Примечание

Most of the fields can be edited by project owners or managers, in the Weblate interface.

Приоритет

Переводчикам вначале предлагаются компоненты с большим приоритетом.

Restricted access

By default the component is visible to anybody who has access to the project, even if the person can not perform any changes in the component. This makes it easier to keep translation consistency within the project.

Enable this in case you want to grant access to this component explicitly - the project level permissions will not apply and you will have to specify component or component list level permission in order to grant access.

Default value can be changed by DEFAULT_RESTRICTED_COMPONENT.

Подсказка

This applies to project managers as well - please make sure you will not loose access to the component after toggling the status.

Template markup

Weblate uses simple markup language in several places where text rendering is needed. It is based on The Django template language, so it can be quite powerful.

Currently it is used in:

There following variables are available in the component templates:

{{ language_code }}

Код языка

{{ language_name }}

Название языка

{{ component_name }}

Название компонента

{{ component_slug }}

Плашка компонента

{{ project_name }}

Название проекта

{{ project_slug }}

Плашка проекта

{{ url }}

Translation URL

{{ filename }}

Имя файла перевода

{{ stats }}

Translation stats, this has further attributes, examples below.

{{ stats.all }}

Total strings count

{{ stats.fuzzy }}

Count of strings needing review

{{ stats.fuzzy_percent }}

Percent of strings needing review

{{ stats.translated }}

Translated strings count

{{ stats.translated_percent }}

Translated strings percent

{{ stats.allchecks }}

Number of strings with failing checks

{{ stats.allchecks_percent }}

Percent of strings with failing checks

{{ author }}

Author of current commit, available only in the commit scope.

{{ addon_name }}

Name of currently executed addon, available only in the addon commit message.

The following variables are available in the repository browser or editor templates:

{{branch}}

current branch

{{line}}

line in file

{{filename}}

filename, you can also strip leading parts using the parentdir filter, for example {{filename|parentdir}}

You can combine them with filters:

{{ component|title }}

You can use conditions:

{% if stats.translated_percent > 80 %}Well translated!{% endif %}

There is additional tag available for replacing characters:

{% replace component "-" " " %}

You can combine it with filters:

{% replace component|capfirst "-" " " %}

There are also additional filter to manipulate with filenames:

Directory of a file: {{ filename|dirname }}
File without extension: {{ filename|stripext }}
File in parent dir: {{ filename|parentdir }}
It can be used multiple times:  {{ filename|parentdir|parentdir }}

…and other Django template features.

Importing speed

Fetching VCS repository and importing translations to Weblate can be a lengthy process, depending on size of your translations. Here are some tips:

Optimize configuration

Конфигурация по умолчанию полезна для тестирования и отладки Weblate, в то же время для установки в рабочую среду в неё необходимо внести некоторые коррективы. Многие из параметров довольно сильно влияют на производительность. Для получения более подробной информации обратитесь к разделу Рабочая среда, особенно обратите внимание на следующие темы:

Check resource limits

If you are importing huge translations or repositories, you might be hit by resource limitations of your server.

  • Check the amount of free memory, having translation files cached by the operating system will greatly improve performance.

  • Disk operations might be bottleneck if there is a lot of strings to process—the disk is pushed by both Weblate and the database.

  • Additional CPU cores might help improve performance of background tasks (see Фоновые задачи с использованием Celery).

Disable unneeded checks

Some quality checks can be quite expensive, and if not needed, can save you some time during import if omitted. See CHECK_LIST for info on configuration.

Automatic creation of components

In case your project has dozen of translation files (e.g. for different gettext domains, or parts of Android apps), you might want to import them automatically. This can either be achieved from the command line by using import_project or import_json, or by installing the Обнаружение компонента addon.

To use the addon, you first need to create a component for one translation file (choose the one that is the least likely to be renamed or removed in future), and install the addon on this component.

For the management commands, you need to create a project which will contain all components and then run import_project or import_json.