Commit 01f1fca2 authored by Michal Čihař's avatar Michal Čihař

Make --lang filtering work on component level as well

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 92043290
......@@ -163,14 +163,14 @@ class WeblateLangCommand(WeblateCommand):
'''
Returns list of units matching parameters.
'''
if options['all']:
if options['lang'] is not None:
return Unit.objects.filter(
translation__language__code=options['lang']
)
return Unit.objects.all()
units = super(WeblateLangCommand, self).get_units(*args, **options)
if options['lang'] is not None:
units = units.filter(
translation__language__code=options['lang']
)
return super(WeblateLangCommand, self).get_units(*args, **options)
return units
def get_translations(self, *args, **options):
'''
......
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