From a3eb7db6274e240bcf27451290e68069d5e0c6ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 17 Jun 2022 19:13:11 +0200 Subject: [PATCH] misc: make makemessages remove obsolete strings by default (#66289) --- lingo/manager/management/commands/makemessages.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lingo/manager/management/commands/makemessages.py b/lingo/manager/management/commands/makemessages.py index ec1cd02..73f474e 100644 --- a/lingo/manager/management/commands/makemessages.py +++ b/lingo/manager/management/commands/makemessages.py @@ -20,7 +20,12 @@ from django.core.management.commands import makemessages class Command(makemessages.Command): xgettext_options = makemessages.Command.xgettext_options + ['--keyword=N_'] + def add_arguments(self, parser): + super().add_arguments(parser) + parser.add_argument('--keep-obsolete', action='store_true', help='Keep obsolete message strings.') + def handle(self, *args, **options): if not options.get('add_location') and self.gettext_version >= (0, 19): options['add_location'] = 'file' + options['no_obsolete'] = not (options.get('keep_obsolete')) return super().handle(*args, **options)