From 6473428e9bb54287c3e1efe60b516f8c13086f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 15 Jun 2022 23:49:47 +0200 Subject: [PATCH] misc: make makemessages remove obsolete strings by default (#66289) --- chrono/manager/management/commands/makemessages.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chrono/manager/management/commands/makemessages.py b/chrono/manager/management/commands/makemessages.py index 79bba539..f764dd91 100644 --- a/chrono/manager/management/commands/makemessages.py +++ b/chrono/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)