From 2d1ce1e9ca4d8df7945140f83a338cd30eff32b4 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Tue, 27 Jul 2021 10:09:09 +0200 Subject: [PATCH] commands: add custom makemessages command (#55822) Its purpose is to stop including line numbers in .po translation files. --- .../management/commands/makemessages.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/authentic2/management/commands/makemessages.py diff --git a/src/authentic2/management/commands/makemessages.py b/src/authentic2/management/commands/makemessages.py new file mode 100644 index 00000000..97238ec0 --- /dev/null +++ b/src/authentic2/management/commands/makemessages.py @@ -0,0 +1,24 @@ +# authentic2 - versatile identity manager +# Copyright (C) 2010-2021 Entr'ouvert +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +from django.core.management.commands import makemessages + + +class Command(makemessages.Command): + def handle(self, *args, **options): + if not options.get('add_location') and self.gettext_version >= (0, 19): + options['add_location'] = 'file' + return super().handle(*args, **options) -- 2.20.1