Дополнительные модули Weblate

Для вашей установки доступно несколько дополнительных модулей.

Экспортер Git

Добавлено в версии 2.10.

Предоставляет доступ на чтение к нижележащему репозиторию Git через HTTP(S).

Установка

  1. Добавьте weblate.gitexport в установленные приложения в файле settings.py:

INSTALLED_APPS += (
    'weblate.gitexport',
)
  1. Экспортируйте существующие репозитории, перенеся свою базу данных после установки:

weblate migrate

Использование

The module automatically hooks into Weblate and sets the exported repository URL in the Конфигурация компонента. The repositories are accessible under the /git/ part of the Weblate URL, for example https://example.org/git/weblate/master/:

git clone 'https://example.org/git/weblate/master/'

Repositories are available anonymously unless По-проектный контроль доступа is turned on. This requires authenticate using your API token (it can be obtained in your Профиль пользователя):

git clone 'https://user:KEY@example.org/git/weblate/master/'

Тарифный план

Добавлено в версии 2.4.

This is used on Hosted Weblate to define billing plans, track invoices and usage limits.

Установка

Добавьте weblate.billing в установленные приложения в файле settings.py:

INSTALLED_APPS += (
    'weblate.billing',
)
  1. Запустите миграцию базы данных для необязательной установки для модуля дополнительных структур базы данных:

weblate migrate

Использование

После установки вы сможете в интерфейсе администратора управлять тарификацией. У пользователей с включённой функцией тарификации в их профиле появится новая вкладка Тарифный план.

The billing module additionally allows project admins to create new projects and components without being superusers (see Добавление проектов и компонентов перевода). This is possible when following conditions are met:

  • The billing is in its configured limits (any overusage results in blocking of project/component creation) and paid (if its price is non zero)

  • The user is admin of existing project with billing or user is owner of billing (the latter is necessary when creating new billing for users to be able to import new projects).

Upon project creation user is able to choose which billing should be charged for the project in case he has access to more of them.

Аватары

Аватары загружаются и кэшируются на стороне сервера, чтобы уменьшить утечку информации на сайты, обслуживающие их по умолчанию. Встроенную поддержку получения аватаров из настроенных для этого адресов электронной почты можно отключить с помощью параметра ENABLE_AVATARS.

В настоящее время Weblate поддерживает:

Защита от спама

Вы можете защититься от спама в предложениях от неаутентифицированных пользователей, воспользовавшись сервисом akismet.com.

  1. Установите модуль Python akismet

  2. Настройте ключ API Akismet.

Примечание

Защита (среди всего прочего) зависит от IP-адреса клиента, для правильной её настройки, пожалуйста, смотрите раздел Работа за обратным прокси.

Подписание коммитов Git с помощью GnuPG

Добавлено в версии 3.1.

All commits can be signed by the GnuPG key of the Weblate instance.

1. Turn on WEBLATE_GPG_IDENTITY. (Weblate will generate a GnuPG key when needed and will use it to sign all translation commits.)

Эта функция требует установки GnuPG 2.1 или новее.

You can find the key in the DATA_DIR and the public key is shown on the «About» page:

../_images/about-gpg.png

2. Alternatively you can also import existing keys into Weblate, just set HOME=$DATA_DIR/home when invoking gpg.

См.также

WEBLATE_GPG_IDENTITY

Ограничение частоты запросов

Изменено в версии 3.2: The rate limiting now accepts more fine-grained configuration.

Several operations in Weblate are rate limited. At most RATELIMIT_ATTEMPTS attempts are allowed within RATELIMIT_WINDOW seconds. The user is then blocked for RATELIMIT_LOCKOUT. There are also settings specific to scopes, for example RATELIMIT_CONTACT_ATTEMPTS or RATELIMIT_TRANSLATE_ATTEMPTS. The table below is a full list of available scopes.

The following operations are subject to rate limiting:

Имя

Область

Allowed attempts

Ratelimit window

Lockout period

Регистрация

REGISTRATION

5

300

600

Sending message to admins

MESSAGE

5

300

600

Password authentication on login

LOGIN

5

300

600

Sitewide search

SEARCH

6

60

60

Перевод

TRANSLATE

30

60

600

Adding to glossary

GLOSSARY

30

60

600

If a user fails to log in AUTH_LOCK_ATTEMPTS times, password authentication will be turned off on the account until having gone through the process of having its password reset.