Configuration

All settings are stored in settings.py (as usual for Django).

Примечание

After changing any of these settings, you need to restart Weblate. In case it is run as mod_wsgi, you need to restart Apache to reload the configuration.

См.также

Please also check Django’s documentation for parameters which configure Django itself.

AKISMET_API_KEY

Weblate can use Akismet to check incoming anonymous suggestions for spam. Visit akismet.com to purchase an API key and associate it with a site.

ANONYMOUS_USER_NAME

User name of user for defining privileges of not logged in user.

См.также

Access control

AUDITLOG_EXPIRY

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

How long (in days) Weblate should keep audit log containing information about account activity.

Defaults to 180 days.

AUTH_LOCK_ATTEMPTS

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

Maximum number of failed authentication attempts before rate limiting is applied.

This is currently applied in the following locations:

  • On login, the account password is reset. User will not be able to log in after that using password until he asks for password reset.
  • On password reset, the reset mails are no longer sent. This avoids spamming user with too many password reset attempts.

Defaults to 10.

См.также

Rate limiting,

AUTO_UPDATE

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

Изменено в версии 3.11: The originally boolean option was changed to accept more options as strings.

Update all repositories on daily basis. This can be useful if you do not use Notification hooks to update Weblate repositories automatically.

Примечание

There are both boolean options or string due to backwards compatibility.

Options are:

"none"
no daily updates
"remote" also False
update remotes only
"full" also True
update remotes and merge working copy

Примечание

This requires Background tasks using Celery working and you will have to restart celery for this setting to take effect.

AVATAR_URL_PREFIX

Prefix for constructing avatar URLs. The URL will be constructed like: ${AVATAR_URL_PREFIX}/avatar/${MAIL_HASH}?${PARAMS}. Following services are known to work:

Gravatar (default), see https://gravatar.com/
AVATAR_URL_PREFIX = 'https://www.gravatar.com/'
Libravatar, see https://www.libravatar.org/
AVATAR_URL_PREFIX = 'https://seccdn.libravatar.org/'

RATELIMIT_ATTEMPTS

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

Maximum number of authentication attempts before rate limiting applies.

Defaults to 5.

RATELIMIT_WINDOW

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

Length of authentication window for rate limiting in seconds.

Defaults to 300 (5 minutes).

RATELIMIT_LOCKOUT

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

Length of authentication lockout window after rate limit is applied.

Defaults to 600 (10 minutes).

AUTH_TOKEN_VALID

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

Validity of token in activation and password reset mails in seconds.

Defaults to 172800 (2 days).

AUTH_PASSWORD_DAYS

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

Define (in days) how long in past Weblate should reject reusing same password.

Примечание

Password changes done prior to Weblate 2.15 will not be accounted for this policy, it is valid only

Defaults to 180 days.

AUTOFIX_LIST

List of automatic fixups to apply when saving the message.

You need to provide a fully-qualified path to the Python class implementing the autofixer interface.

Available fixes:

weblate.trans.autofixes.whitespace.SameBookendingWhitespace
Fixes up whitespace in beginning and end of the string to match source.
weblate.trans.autofixes.chars.ReplaceTrailingDotsWithEllipsis
Replaces trailing dots with ellipsis if source string has it.
weblate.trans.autofixes.chars.RemoveZeroSpace
Removes zero width space char if source does not contain it.
weblate.trans.autofixes.chars.RemoveControlChars
Removes control characters if source does not contain it.
weblate.trans.autofixes.html.BleachHTML
Removes unsafe HTML markup from string with flag safe-html (see Unsafe HTML).

For example you can enable only few of them:

AUTOFIX_LIST = (
    'weblate.trans.autofixes.whitespace.SameBookendingWhitespace',
    'weblate.trans.autofixes.chars.ReplaceTrailingDotsWithEllipsis',
)

BASE_DIR

Base directory where Weblate sources are located. This is used to derive several other paths by default:

Default value: Top level directory of Weblate sources.

CHECK_LIST

List of quality checks to perform on translation.

You need to provide a fully-qualified path to the Python class implementing the check interface.

Some of the checks are not useful for all projects, so you are welcome to adjust the list list of checks to be performed on your installation.

By default all built in quality checks (see Quality checks) are enabled, you can use this setting to change this. Also the Sample configuration comes with this setting commented out to use default value. This enables you to get new checks automatically enabled on upgrade.

You can disable all checks:

CHECK_LIST = ()

You can enable only few of them:

CHECK_LIST = (
    'weblate.checks.chars.BeginNewlineCheck',
    'weblate.checks.chars.EndNewlineCheck',
    'weblate.checks.chars.MaxLengthCheck',
)

Примечание

Once you change this setting the existing checks will still be stored in the database, only newly changed translations will be affected by the change. To apply the change to the stored translations, you need to run updatechecks.

COMMENT_CLEANUP_DAYS

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

Automatically delete comments after given number of days. Defaults to None what means no deletion at all.

COMMIT_PENDING_HOURS

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

Default interval for committing pending changes using commit_pending.

DATA_DIR

Directory where Weblate stores all data. This consists of VCS repositories, fulltext index and various configuration files for external tools.

The following subdirectories usually exist:

home
Home directory used for invoking scripts.
ssh
SSH keys and configuration.
static
Default location for Django static files, specified by STATIC_ROOT.
media
Default location for Django media files, specified by MEDIA_ROOT.
memory
Translation memory data using Whoosh engine (see Translation Memory).
vcs
Version control repositories.
whoosh
Fulltext search index using Whoosh engine.
backups
Dump of data in daily backups, see Dumped data for backups.

Примечание

This directory has to be writable by Weblate. If you are running Weblate as uwsgi this means that it should be writable by the www-data user.

The easiest way to achieve is to make the user own the directory:

sudo chown www-data:www-data -R $DATA_DIR

Defaults to $BASE_DIR/data.

DEFAULT_ACCESS_CONTROL

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

Choose default access control when creating new project, possible values are currently:

0
Public
1
Protected
100
Private
200
Custom

Use Custom if you are going to manage ACL manually and do not want to rely on Weblate internal management.

DEFAULT_ADD_MESSAGE, DEFAULT_ADDON_MESSAGE, DEFAULT_COMMIT_MESSAGE, DEFAULT_DELETE_MESSAGE, DEFAULT_MERGE_MESSAGE

Default commit messages for different operations, see Component configuration for detailed description.

DEFAULT_COMMITER_EMAIL

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

Default committer e-mail when creating translation component (see Component configuration), defaults to noreply@weblate.org.

DEFAULT_COMMITER_NAME

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

Default committer name when creating translation component (see Component configuration), defaults to Weblate.

DEFAULT_MERGE_STYLE

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

Default merge style for new components (see Component configuration), choose one of:

  • rebase - default
  • merge

DEFAULT_TRANSLATION_PROPAGATION

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

Default setting for translation propagation (see Component configuration), defaults to True.

См.также

Component configuration

DEFAULT_PULL_MESSAGE

Default pull request title, defaults to 'Update from Weblate'.

ENABLE_AVATARS

Whether to enable Gravatar based avatars for users. By default this is enabled.

The avatars are fetched and cached on the server, so there is no risk in leaking private information or slowing down the user experiences with enabling this.

ENABLE_HOOKS

Whether to enable anonymous remote hooks.

См.также

Notification hooks

ENABLE_HTTPS

Whether to send links to Weblate as https or http. This setting affects sent mails and generated absolute URLs.

См.также

Set correct sitename

ENABLE_SHARING

Whether to show links to share translation progress on social networks.

GITHUB_USERNAME

GitHub username that will be used to send pull requests for translation updates.

GITLAB_USERNAME

GitLab username that will be used to send merge requests for translation updates.

GOOGLE_ANALYTICS_ID

Google Analytics ID to enable monitoring of Weblate using Google Analytics.

HIDE_REPO_CREDENTIALS

Hide repository credentials in the web interface. In case you have repository URL with user and password, Weblate will hide it when showing it to the users.

For example instead of https://user:password@git.example.com/repo.git it will show just https://git.example.com/repo.git. It tries to cleanup VCS error messages as well in similar manner.

This is enabled by default.

IP_BEHIND_REVERSE_PROXY

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

Indicates whether Weblate is running behind a reverse proxy.

If set to True, Weblate gets IP address from header defined by IP_BEHIND_REVERSE_PROXY. Ensure that you are actually using reverse proxy and that it sets this header, otherwise users will be able to fake the IP address.

Defaults to False.

IP_PROXY_HEADER

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

Indicates from which header Weblate should obtain the IP address when IP_BEHIND_REVERSE_PROXY is enabled.

Defaults to HTTP_X_FORWARDED_FOR.

IP_PROXY_OFFSET

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

Indicates which part of IP_BEHIND_REVERSE_PROXY is used as client IP address.

Depending on your setup, this header might consist of several IP addresses, (for example X-Forwarded-For: a, b, client-ip) and you can configure here which address from the header is client IP address.

Предупреждение

Setting this affects security of your installation, you should only configure to use trusted proxies for determining IP address.

Defaults to 0.

LICENSE_EXTRA

Additional licenses to include in the license choices. Each license definition should be tuple of short name, long name and an URL.

For example:

LICENSE_EXTRA = [
    (
        "GPL-3.0-only",
        "GNU General Public License v3.0 only",
        "https://www.gnu.org/licenses/gpl-3.0-standalone.html",
    ),
]

LICENSE_FILTER

Optional filter for licenses to show, matches against their short names.

For example:

LICENSE_FILTER = {"GPL-3.0-only", "GPL-3.0-or-later"}

LICENSE_REQUIRED

Defines whethere license attribute in Component configuration is required. Defaults to false.

LIMIT_TRANSLATION_LENGTH_BY_SOURCE_LENGTH

By default the length of a given translation is limited to the length of the source string * 10 characters. Set this option to False to allow longer translations (up to 10.000 characters) irrespective of the source length.

Defaults to True.

LOGIN_REQUIRED_URLS

List of URLs which require login (besides standard rules built into Weblate). This allows you to password protect whole installation using:

LOGIN_REQUIRED_URLS = (
    r'/(.*)$',
)
REST_FRAMEWORK["DEFAULT_PERMISSION_CLASSES"] = [
    "rest_framework.permissions.IsAuthenticated"
]

Подсказка

It is desirable to lock down API access as well as shown in above example.

LOGIN_REQUIRED_URLS_EXCEPTIONS

List of exceptions for LOGIN_REQUIRED_URLS. If you don’t specify this list, the default value will be used, which allows users to access the login page.

Some of exceptions you might want to include:

LOGIN_REQUIRED_URLS_EXCEPTIONS = (
    r'/accounts/(.*)$', # Required for login
    r'/static/(.*)$',   # Required for development mode
    r'/widgets/(.*)$',  # Allowing public access to widgets
    r'/data/(.*)$',     # Allowing public access to data exports
    r'/hooks/(.*)$',    # Allowing public access to notification hooks
    r'/api/(.*)$',      # Allowing access to API
    r'/js/i18n/$',      # JavaScript localization
)

MATOMO_SITE_ID

ID of a site in Matomo (Piwik) you want to track. Please note that this integration does not support Matomo Tag Manager.

См.также

MATOMO_URL

MATOMO_URL

Full URL (including trailing slash) of a Matomo (Piwik) installation you want to use to track Weblate users. For more information about Matomo see <https://matomo.org/>. Please note that this integration does not support Matomo Tag Manager.

For example:

MATOMO_SITE_ID = 1
MATOMO_URL = "https://example.matomo.cloud/"

См.также

MATOMO_SITE_ID

MT_SERVICES

Изменено в версии 3.0: The setting was renamed from MACHINE_TRANSLATION_SERVICES to MT_SERVICES to be consistent with other machine translation settings.

List of enabled machine translation services to use.

Примечание

Many of services need additional configuration like API keys, please check their documentation for more details.

MT_SERVICES = (
    'weblate.machinery.apertium.ApertiumAPYTranslation',
    'weblate.machinery.deepl.DeepLTranslation',
    'weblate.machinery.glosbe.GlosbeTranslation',
    'weblate.machinery.google.GoogleTranslation',
    'weblate.machinery.microsoft.MicrosoftCognitiveTranslation',
    'weblate.machinery.microsoftterminology.MicrosoftTerminologyService',
    'weblate.machinery.mymemory.MyMemoryTranslation',
    'weblate.machinery.tmserver.AmagamaTranslation',
    'weblate.machinery.tmserver.TMServerTranslation',
    'weblate.machinery.yandex.YandexTranslation',
    'weblate.machinery.weblatetm.WeblateTranslation',
    'weblate.machinery.saptranslationhub.SAPTranslationHub',
    'weblate.memory.machine.WeblateMemory',
)

MT_APERTIUM_APY

URL of the Apertium APy server, see http://wiki.apertium.org/wiki/Apertium-apy

MT_AWS_ACCESS_KEY_ID

Access key ID for Amazon Translate.

MT_AWS_SECRET_ACCESS_KEY

API secret key for Amazon Translate.

MT_AWS_REGION

Region name to use for Amazon Translate.

MT_BAIDU_ID

Client ID for Baidu Zhiyun API, you can register at https://api.fanyi.baidu.com/api/trans/product/index

MT_BAIDU_SECRET

Client secret for Baidu Zhiyun API, you can register at https://api.fanyi.baidu.com/api/trans/product/index

MT_DEEPL_KEY

API key for DeepL API, you can register at https://www.deepl.com/pro.html.

MT_GOOGLE_KEY

API key for Google Translate API, you can register at https://cloud.google.com/translate/docs

MT_MICROSOFT_COGNITIVE_KEY

Client key for Microsoft Cognitive Services Translator API.

MT_MYMEMORY_EMAIL

MyMemory identification e-mail, you can get 1000 requests per day with this.

MT_MYMEMORY_KEY

MyMemory access key for private translation memory, use together with MT_MYMEMORY_USER.

MT_MYMEMORY_USER

MyMemory user id for private translation memory, use together with MT_MYMEMORY_KEY.

MT_NETEASE_KEY

App key for Netease Sight API, you can register at https://sight.netease.com/

MT_NETEASE_SECRET

App secret for Netease Sight API, you can register at https://sight.netease.com/

MT_TMSERVER

URL where tmserver is running.

MT_YANDEX_KEY

API key for Yandex Translate API, you can register at https://tech.yandex.com/translate/

MT_YOUDAO_ID

Client ID for Youdao Zhiyun API, you can register at https://ai.youdao.com/product-fanyi.s

MT_YOUDAO_SECRET

Client secret for Youdao Zhiyun API, you can register at https://ai.youdao.com/product-fanyi.s

MT_SAP_BASE_URL

API URL to the SAP Translation Hub service.

MT_SAP_SANDBOX_APIKEY

API key for sandbox API usage

MT_SAP_USERNAME

Your SAP username

MT_SAP_PASSWORD

Your SAP password

MT_SAP_USE_MT

Should the machine translation service also be used? (in addition to the term database). Possible values: True / False

NEARBY_MESSAGES

How many messages around current one to show during translating.

REGISTRATION_CAPTCHA

A boolean (either True or False) indicating whether registration of new accounts is protected by captcha. This setting is optional, and a default of True will be assumed if it is not supplied.

If enabled the captcha is added to all pages where users enter e-mail address:

  • New account registration.
  • Password recovery.
  • Adding e-mail to an account.
  • Contact form for users who are not logged in.

REGISTRATION_EMAIL_MATCH

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

Allows you to filter e-mail addresses which can register.

Defaults to .* which allows any address to register.

You can use it to restrict registration to a single e-mail domain:

REGISTRATION_EMAIL_MATCH = r'^.*@weblate\.org$'

REGISTRATION_OPEN

A boolean (either True or False) indicating whether registration of new accounts is currently permitted. This setting is optional, and a default of True will be assumed if it is not supplied.

Примечание

This setting has effect on built in authentication by email or through Python Social Auth. In case of using third party authentication methods such as LDAP authentication it just hides the registration form, but new users might be still able to log in and create account.

SENTRY_DSN

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

Sentry DSN to use for Collecting error reports.

SIMPLIFY_LANGUAGES

Use simple language codes for default language/country combinations. For example fr_FR translation will use fr language code. This is usually desired behavior as it simplifies listing of the languages for these default combinations.

Disable this if you are having different translations for both variants.

SITE_TITLE

Site title to be used in website and e-mails as well.

SPECIAL_CHARS

Additional characters to show in the visual keyboard, see Visual keyboard.

The default value is:

SPECIAL_CHARS = ('\t', '\n', '…')

SINGLE_PROJECT

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

Redirect user directly to single project or component instead of showing dashboard. You can either set it to True and in this case it only works in case there is actually only single project in Weblate. Alternatively set project slug and it will redirect unconditionally to this project.

Изменено в версии 3.11: The setting now accept project slug as well to force displaying of that single project.

Example:

SINGLE_PROJECT = "test"

STATUS_URL

URL where your Weblate instance reports it’s status.

SUGGESTION_CLEANUP_DAYS

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

Automatically delete suggestions after given number of days. Defaults to None what means no deletion at all.

URL_PREFIX

This settings allows you to run Weblate under some path (otherwise it relies on being executed from webserver root). To use this setting, you also need to configure your server to strip this prefix. For example with WSGI, this can be achieved by setting WSGIScriptAlias. The prefix should start with a /.

Example:

URL_PREFIX = '/translations'

Примечание

This setting does not work with Django’s builtin server, you would have to adjust urls.py to contain this prefix.

VCS_BACKENDS

Configuration of available VCS backends. Weblate tries to use all supported backends for which you have tools available. You can limit choices or add custom VCS backends using this.

VCS_BACKENDS = (
   'weblate.vcs.git.GitRepository',
)

См.также

Version control integration

VCS_CLONE_DEPTH

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

Configures how deep clones of repositories Weblate should do. Currently this is only supported in Git. By default Weblate does shallow clones of the repositories to make cloning faster and save disk space. Depending on your usage (for example when using custom Addons), you might want to increase the depth or disable shallow clones completely by setting this to 0.

In case you get fatal: protocol error: expected old/new/ref, got 'shallow <commit hash>' error when pushing from Weblate, disable shallow clones completely by setting:

VCS_CLONE_DEPTH = 0

WEBLATE_ADDONS

List of addons available for use. To use them, they have to be enabled for given translation component. By default this includes all built in addons, when extending the list you will probably want to keep existing ones enabled, for example:

WEBLATE_ADDONS = (
    # Built in addons
    'weblate.addons.gettext.GenerateMoAddon',
    'weblate.addons.gettext.UpdateLinguasAddon',
    'weblate.addons.gettext.UpdateConfigureAddon',
    'weblate.addons.gettext.MsgmergeAddon',
    'weblate.addons.gettext.GettextCustomizeAddon',
    'weblate.addons.gettext.GettextAuthorComments',
    'weblate.addons.cleanup.CleanupAddon',
    'weblate.addons.consistency.LangaugeConsistencyAddon',
    'weblate.addons.discovery.DiscoveryAddon',
    'weblate.addons.flags.SourceEditAddon',
    'weblate.addons.flags.TargetEditAddon',
    'weblate.addons.flags.SameEditAddon',
    'weblate.addons.flags.BulkEditAddon',
    'weblate.addons.generate.GenerateFileAddon',
    'weblate.addons.json.JSONCustomizeAddon',
    'weblate.addons.properties.PropertiesSortAddon',
    'weblate.addons.git.GitSquashAddon',
    'weblate.addons.removal.RemoveComments',
    'weblate.addons.removal.RemoveSuggestions',
    'weblate.addons.resx.ResxUpdateAddon',
    'weblate.addons.autotranslate.AutoTranslateAddon',
    'weblate.addons.yaml.YAMLCustomizeAddon',

    # Addon you want to include
    'weblate.addons.example.ExampleAddon',
)

См.также

Addons

WEBLATE_FORMATS

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

List of file formats available for use, you can usually keep this on default value.

См.также

Supported file formats

WEBLATE_GPG_IDENTITY

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

Identity which should be used by Weblate to sign Git commits, for example:

WEBLATE_GPG_IDENTITY = 'Weblate <weblate@example.com>'

Предупреждение

If you are going to change value of setting, it is advisable to clean the cache as the key information is cached for seven days. This is not necessary for initial setup as nothing is cached if this feature is not configured.

DATABASE_BACKUP

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

Whether the database backups should be stored as plain text, compressed or skipped. The authorized values are: * plain * compressed * none