Commit 9b50d9a1 authored by Michal Čihař's avatar Michal Čihař

Allow to define default value for translation propagation

Fixes #940
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 1cc2f7d3
...@@ -173,6 +173,18 @@ Default commiter name when creating translation component (see ...@@ -173,6 +173,18 @@ Default commiter name when creating translation component (see
.. seealso:: :setting:`DEFAULT_COMMITER_EMAIL`, :ref:`component` .. seealso:: :setting:`DEFAULT_COMMITER_EMAIL`, :ref:`component`
.. setting:: DEFAULT_TRANSLATION_PROPAGATION
DEFAULT_TRANSLATION_PROPAGATION
-------------------------------
.. versionadded:: 2.5
Default setting for translation propagation (see :ref:`component`),
defaults to ``True``.
.. seealso:: :ref:`component`
.. setting:: ENABLE_AVATARS .. setting:: ENABLE_AVATARS
ENABLE_AVATARS ENABLE_AVATARS
......
...@@ -232,6 +232,9 @@ DEFAULT_COMMITER_EMAIL = getvalue( ...@@ -232,6 +232,9 @@ DEFAULT_COMMITER_EMAIL = getvalue(
DEFAULT_COMMITER_NAME = getvalue( DEFAULT_COMMITER_NAME = getvalue(
'DEFAULT_COMMITER_NAME', 'Weblate' 'DEFAULT_COMMITER_NAME', 'Weblate'
) )
DEFAULT_TRANSLATION_PROPAGATION = getvalue(
'DEFAULT_TRANSLATION_PROPAGATION', True
)
# Obsolete configs, needed for data migration # Obsolete configs, needed for data migration
GIT_ROOT = getvalue('GIT_ROOT', os.path.join(BASE_DIR, 'repos')) GIT_ROOT = getvalue('GIT_ROOT', os.path.join(BASE_DIR, 'repos'))
......
...@@ -58,6 +58,7 @@ from weblate.appsettings import ( ...@@ -58,6 +58,7 @@ from weblate.appsettings import (
POST_ADD_SCRIPT_CHOICES, POST_ADD_SCRIPT_CHOICES,
HIDE_REPO_CREDENTIALS, HIDE_REPO_CREDENTIALS,
DEFAULT_COMMITER_EMAIL, DEFAULT_COMMITER_NAME, DEFAULT_COMMITER_EMAIL, DEFAULT_COMMITER_NAME,
DEFAULT_TRANSLATION_PROPAGATION,
) )
from weblate.accounts.models import notify_merge_failure, get_author_name from weblate.accounts.models import notify_merge_failure, get_author_name
from weblate.trans.models.changes import Change from weblate.trans.models.changes import Change
...@@ -290,7 +291,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin): ...@@ -290,7 +291,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
) )
allow_translation_propagation = models.BooleanField( allow_translation_propagation = models.BooleanField(
verbose_name=ugettext_lazy('Allow translation propagation'), verbose_name=ugettext_lazy('Allow translation propagation'),
default=True, default=DEFAULT_TRANSLATION_PROPAGATION,
db_index=True, db_index=True,
help_text=ugettext_lazy( help_text=ugettext_lazy(
'Whether translation updates in other components ' 'Whether translation updates in other components '
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment