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.
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 acccount 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.
См.также
AUTH_MAX_ATTEMPTS¶
Добавлено в версии 2.14.
Maximum number of authentication attempts before rate limiting applies.
Defaults to 5.
См.также
AUTH_CHECK_WINDOW¶
Добавлено в версии 2.14.
Length of authentication window for rate limiting in seconds.
Defaults to 300 (5 minutes).
См.также
AUTH_LOCKOUT_TIME¶
Добавлено в версии 2.14.
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 3600 (1 hour).
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.
AUTO_LOCK¶
Не рекомендуется, начиная с версии 2.18.
Enables automatic locking of translation when somebody is working on it.
См.также
AUTO_LOCK_TIME¶
Не рекомендуется, начиная с версии 2.18.
Time in seconds for how long the automatic lock for translation will be active. Defaults to 60 seconds.
См.также
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.
For example you can enable only few of them:
AUTOFIX_LIST = (
'weblate.trans.autofixes.whitespace.SameBookendingWhitespace',
'weblate.trans.autofixes.chars.ReplaceTrailingDotsWithEllipsis',
)
См.также
BACKGROUND_HOOKS¶
Whether to run hooks in background. This is generally recommended unless you are debugging.
BASE_DIR¶
Base directory where Weblate sources are located. This is used to derive several other paths by defalt:
Default value: Toplevel directory of Weblate sources.
CHECK_LIST¶
List of quality checks to perform on translation.
You need to provide afully-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.
For example you can enable only few of them:
CHECK_LIST = (
'weblate.trans.checks.same.SameCheck',
'weblate.trans.checks.chars.BeginNewlineCheck',
'weblate.trans.checks.chars.EndNewlineCheck',
'weblate.trans.checks.chars.BeginSpaceCheck',
'weblate.trans.checks.chars.EndSpaceCheck',
'weblate.trans.checks.chars.EndStopCheck',
'weblate.trans.checks.chars.EndColonCheck',
'weblate.trans.checks.chars.EndQuestionCheck',
'weblate.trans.checks.chars.EndExclamationCheck',
'weblate.trans.checks.chars.EndEllipsisCheck',
'weblate.trans.checks.chars.EndSemicolonCheck',
'weblate.trans.checks.chars.MaxLengthCheck',
'weblate.trans.checks.format.PythonFormatCheck',
'weblate.trans.checks.format.PythonBraceFormatCheck',
'weblate.trans.checks.format.PHPFormatCheck',
'weblate.trans.checks.format.CFormatCheck',
'weblate.trans.checks.format.PerlFormatCheck',
'weblate.trans.checks.format.JavascriptFormatCheck',
'weblate.trans.checks.consistency.SamePluralsCheck',
'weblate.trans.checks.consistency.PluralsCheck',
'weblate.trans.checks.consistency.ConsistencyCheck',
'weblate.trans.checks.consistency.TranslatedCheck',
'weblate.trans.checks.chars.NewlineCountingCheck',
'weblate.trans.checks.markup.BBCodeCheck',
'weblate.trans.checks.chars.ZeroWidthSpaceCheck',
'weblate.trans.checks.markup.XMLTagsCheck',
'weblate.trans.checks.source.OptionalPluralCheck',
'weblate.trans.checks.source.EllipsisCheck',
'weblate.trans.checks.source.MultipleFailingCheck',
)
Примечание
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
.
См.также
COMMIT_PENDING_HOURS¶
Добавлено в версии 2.10.
Default interval for commiting pending changes using commit_pending
.
См.также
DATA_DIR¶
Добавлено в версии 2.1: In previous versions the directories were configured separately as
GIT_ROOT
and WHOOSH_INDEX
.
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 uwing Whoosh engine (see Translation Memory).
vcs
- Version control repositories.
whoosh
- Fulltext search index using Whoosh engine.
Defaults to $BASE_DIR/data
.
См.также
DEFAULT_COMMITER_EMAIL¶
Добавлено в версии 2.4.
Default committer email 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_TRANSLATION_PROPAGATION¶
Добавлено в версии 2.5.
Default setting for translation propagation (see Component configuration),
defaults to True
.
См.также
ENABLE_AVATARS¶
Whether to enable libravatar/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_HTTPS¶
Whether to send links to Weblate as https or http. This setting affects sent mails and generated absolute URLs.
См.также
ENABLE_SHARING¶
Whether to show links to share translation progress on social networks.
GIT_ROOT¶
Не рекомендуется, начиная с версии 2.1: This setting is no longer used, use DATA_DIR
instead.
Path where Weblate will store the cloned VCS repositories. Defaults to
repos
subdirectory.
GITHUB_USERNAME¶
GitHub username that will be used to send pull 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
.
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.
Defaults to 0.
См.также
LAZY_COMMITS¶
Не рекомендуется, начиная с версии 2.20: This setting can no longer be configured and is enabled permanently.
Delay creating VCS commits until necessary. This heavily reduces number of commits generated by Weblate at expense of temporarily not being able to merge some changes as they are not yet committed.
См.также
LOCK_TIME¶
Не рекомендуется, начиная с версии 2.18.
Time in seconds for how long the translation will be locked for single translator when locked manually.
См.также
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'/(.*)$',
)
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
)
MACHINE_TRANSLATION_SERVICES¶
List of enabled machine translation services to use.
Примечание
Many of services need additional configuration like API keys, please check their documentation for more details.
MACHINE_TRANSLATION_SERVICES = (
'weblate.trans.machine.apertium.ApertiumAPYTranslation',
'weblate.trans.machine.deepl.DeepLTranslation',
'weblate.trans.machine.glosbe.GlosbeTranslation',
'weblate.trans.machine.google.GoogleTranslation',
'weblate.trans.machine.microsoft.MicrosoftCognitiveTranslation',
'weblate.trans.machine.mymemory.MyMemoryTranslation',
'weblate.trans.machine.tmserver.AmagamaTranslation',
'weblate.trans.machine.tmserver.TMServerTranslation',
'weblate.trans.machine.yandex.YandexTranslation',
'weblate.trans.machine.weblatetm.WeblateTranslation',
'weblate.trans.machine.saptranslationhub.SAPTranslationHub',
'weblate.memory.machine.WeblateMemory',
)
См.также
MT_APERTIUM_APY¶
URL of the Apertium APy server, see http://wiki.apertium.org/wiki/Apertium-apy
См.также
MT_APERTIUM_KEY¶
API key for Apertium Web Service, currently not used.
Not needed at all when running your own Apertium APy server.
См.также
MT_GOOGLE_KEY¶
API key for Google Translate API, you can register at https://cloud.google.com/translate/docs
MT_MICROSOFT_ID¶
Client ID for Microsoft Translator service.
MT_MICROSOFT_SECRET¶
Client secret for Microsoft Translator service.
MT_MICROSOFT_COGNITIVE_KEY¶
Client key for Microsoft Cognitive Services Translator API.
MT_MYMEMORY_EMAIL¶
MyMemory identification email, 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_TMSERVER¶
URL where tmserver is running.
См.также
tmserver, Machine translation, Machine translation, tmserver
MT_YANDEX_KEY¶
API key for Yandex Translate API, you can register at https://tech.yandex.com/translate/
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.
OFFLOAD_INDEXING¶
Offload updating of fulltext index to separate process. This heavily improves responsiveness of online operation on expense of slightly outdated index, which might still point to older content.
While enabling this, don’t forget scheduling runs of
update_index
in cron or similar tool.
This is the recommended setup for production use.
См.также
PIWIK_URL¶
URL of a Matomo installation you want to use to track Weblate users. For more information about Matomo see <https://matomo.org/>.
См.также
POST_ADD_SCRIPTS¶
Добавлено в версии 2.4.
List of scripts which are allowed as post add scripts. The script needs to be later enabled in the Component configuration.
См.также
POST_UPDATE_SCRIPTS¶
Добавлено в версии 2.3.
List of scripts which are allowed as post update scripts. The script needs to be later enabled in the Component configuration.
См.также
PRE_COMMIT_SCRIPTS¶
List of scripts which are allowed as pre commit scripts. The script needs to be later enabled in the Component configuration.
For example you can allow script which does some cleanup:
PRE_COMMIT_SCRIPTS = (
'/usr/local/bin/cleanup-translation',
)
См.также
POST_COMMIT_SCRIPTS¶
Добавлено в версии 2.4.
List of scripts which are allowed as post commit scripts. The script needs to be later enabled in the Component configuration.
См.также
POST_PUSH_SCRIPTS¶
Добавлено в версии 2.4.
List of scripts which are allowed as post push scripts. The script needs to be later enabled in the Component configuration.
См.также
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 email address:
- New account registration.
- Password recovery.
- Adding email to an account.
- Contact form for users who are not logged in.
REGISTRATION_EMAIL_MATCH¶
Добавлено в версии 2.17.
Allows you to filter email addresses which can register.
Defaults to .*
which allows any address to register.
You can use it to restrict registration to a single email 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.
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 emails as well.
SPECIAL_CHARS¶
Additional chars to show in the visual keyboard, see Visual keyboard.
The default value is:
SPECIAL_CHARS = ('\t', '\n', '…')
STATUS_URL¶
URL where your Weblate instance reports it’s status.
TTF_PATH¶
Path to Droid fonts used for widgets and charts.
Defaults to $BASE_DIR/weblate/ttf
.
См.также
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
.
Примечание
This setting does not work with Django’s builtin server, you would have to
adjust urls.py
to contain this prefix.
WEBLATE_ADDONS¶
List of addons available for use. To use them, they have to be enabled for given translation component.
См.также