Commit 3614a1fb authored by Michal Čihař's avatar Michal Čihař

Merge remote-tracking branch 'origin/master'

parents 2ec0e10a 5121898c
......@@ -105,7 +105,8 @@ class MergeForm(forms.Form):
merge = forms.IntegerField()
class AutoForm(forms.Form):
overwrite = forms.BooleanField(label = _('Overwrite entries'), required = False, initial = False)
overwrite = forms.BooleanField(label = _('Overwrite strings'), required = False, initial = False)
inconsistent = forms.BooleanField(label = _('Replace inconsistent'), required = False, initial = False)
subproject = forms.ChoiceField(label = _('Subproject to use'), required = False, initial = '')
def __init__(self, obj, *args, **kwargs):
......
......@@ -145,9 +145,12 @@ def auto_translation(request, project, subproject, lang):
autoform = AutoForm(obj, request.POST)
change = None
if autoform.is_valid():
units = obj.unit_set.all()
if not autoform.cleaned_data['overwrite']:
units = units.filter(translated = False)
if autoform.cleaned_data['inconsistent']:
units = obj.unit_set.filter_type('inconsistent')
elif autoform.cleaned_data['overwrite']:
units = obj.unit_set.all()
else:
units = obj.unit_set.filter(translated = False)
sources = Unit.objects.filter(translation__language = obj.language, translated = True)
if autoform.cleaned_data['subproject'] == '':
......
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