.. _config:

Configuration
=============

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

.. note::

    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.

.. seealso:: 
   
    Please check also `Django's documentation`_ for parameters which configure
    Django itself.

.. _`Django's documentation`: https://docs.djangoproject.com/en/1.4/ref/settings/

.. setting:: ACCOUNT_ACTIVATION_DAYS

ACCOUNT_ACTIVATION_DAYS
-----------------------

This is the number of days users will have to activate their accounts after
registering. Failing to activate during that period will leave the account
inactive (and possibly subject to deletion). This setting is required, and must
be an integer.

.. note::

    This is actually django-registration settings.

.. setting:: AUTO_LOCK

AUTO_LOCK
---------

Enables automatic locking of translation when somebody is working on it.

.. seealso:: :ref:`locking`

.. setting:: AUTO_LOCK_TIME

AUTO_LOCK_TIME
--------------

Time in seconds for how long the automatic lock for translation will be active.

.. seealso:: :ref:`locking`

.. setting:: BACKGROUND_HOOKS

BACKGROUND_HOOKS
----------------

Whether to run hooks in background. This is generally recommended unless you
are debugging.

.. setting:: CHECK_LIST

CHECK_LIST
----------

List of quality checks to perform on translation.

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

For example you can enable only few of them:

.. code-block:: python

    CHECK_LIST = (
        'trans.checks.same.SameCheck',
        'trans.checks.format.CFormatCheck',
        'trans.checks.chars.ZeroWidthSpaceCheck',
    )

.. seealso:: :ref:`checks`, :ref:`custom-checks`

.. setting:: ENABLE_HOOKS

ENABLE_HOOKS
------------

Whether to enable anonymous remote hooks.

.. seealso:: :ref:`hooks`

.. setting:: GIT_ROOT

GIT_ROOT
--------

Path where Weblate will store cloned Git repositories. Defaults to
:file:`repos` subdirectory.

.. setting:: LAZY_COMMITS

LAZY_COMMITS
------------

Delay creating Git commits until this is 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.

.. seealso:: :ref:`lazy-commit`

.. setting:: LOCK_TIME

LOCK_TIME
---------

Time in seconds for how long the translation will be locked for single
translator when locked manually.

.. seealso:: :ref:`locking`

.. setting:: LOGIN_REQUIRED_URLS

LOGIN_REQUIRED_URLS
-------------------

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

.. code-block:: python

    LOGIN_REQUIRED_URLS = (
        r'/(.*)$',
    )

.. setting:: LOGIN_REQUIRED_URLS_EXCEPTIONS

LOGIN_REQUIRED_URLS_EXCEPTIONS
------------------------------

List of exceptions for :setting:`LOGIN_REQUIRED_URLS`, in case you won't
specify this list, the default value will be used, which allows users to access
login page.

Some of exceptions you might want to include:

.. code-block:: python

    LOGIN_REQUIRED_URLS_EXCEPTIONS = (
        r'/accounts/(.*)$', # Required for login
        r'/media/(.*)$',    # 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
    )

.. setting:: MACHINE_TRANSLATION_SERVICES

MACHINE_TRANSLATION_SERVICES
----------------------------

List of enabled machine translation services to use.

.. note::

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

.. code-block:: python

    MACHINE_TRANSLATION_SERVICES = (
        'trans.machine.apertium.ApertiumTranslation',
        'trans.machine.glosbe.GlosbeTranslation',
        'trans.machine.google.GoogleTranslation',
        'trans.machine.microsoft.MicrosoftTranslation',
        'trans.machine.mymemory.MyMemoryTranslation',
        'trans.machine.opentran.OpenTranTranslation',
        'trans.machine.tmserver.TMServerTranslation',
        'trans.machine.weblatetm.WeblateSimilarTranslation',
        'trans.machine.weblatetm.WeblateTranslation',
    )

.. seealso:: :ref:`machine-translation-setup`, :ref:`machine-translation`

.. setting:: MT_APERTIUM_KEY

MT_APERTIUM_KEY
---------------

API key for Apertium Web Service, you can register at http://api.apertium.org/register.jsp

.. seealso:: :ref:`machine-translation-setup`, :ref:`machine-translation`

.. setting:: MT_MICROSOFT_ID

MT_MICROSOFT_ID
---------------

Cliend ID for Microsoft Translator service.

.. seealso:: :ref:`machine-translation-setup`, :ref:`machine-translation`, https://datamarket.azure.com/developer/applications/

.. setting:: MT_MICROSOFT_SECRET

MT_MICROSOFT_SECRET
-------------------

Client secret for Microsoft Translator service.

.. seealso:: :ref:`machine-translation-setup`, :ref:`machine-translation`, https://datamarket.azure.com/developer/applications/

.. setting:: MT_TMSERVER

MT_TMSERVER
-----------

URL where tmserver is running.

.. seealso:: :ref:`machine-translation-setup`, :ref:`machine-translation`, http://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/tmserver.html

.. setting:: NEARBY_MESSAGES

NEARBY_MESSAGES
---------------

How many messages around current one to show during translating.

.. setting:: OFFLOAD_INDEXING

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 
:djadmin:`update_index` in cron or similar tool.

This is recommended setup for production use.

.. seealso:: :ref:`fulltext`

.. setting:: PRE_COMMIT_SCRIPTS

PRE_COMMIT_SCRIPTS
------------------

List of scripts which are allowed as pre commit scripts. The script needs to be
later enabled in subproject configuration.

For example you can allow script which does some cleanup:

.. code-block:: python

    PRE_COMMIT_SCRIPTS = (
        '/usr/local/bin/cleanup-translation',
    )

.. note:: 
   
    The hook is executed using system() call, so it is evaluated in a shell.

.. seealso:: :ref:`processing`

.. setting:: REGISTRATION_OPEN

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.

.. note::

    This is actually django-registration settings.

.. setting:: SITE_TITLE

SITE_TITLE
----------

Site title to be used in website and emails as well.

.. setting:: WHOOSH_INDEX

WHOOSH_INDEX
------------

Directory where Whoosh fulltext indices will be stored. Defaults to :file:`whoosh-index` subdirectory.
