Projet

Général

Profil

0001-commands-add-custom-makemessages-command-55822.patch

Valentin Deniaud, 27 juillet 2021 10:57

Télécharger (1,77 ko)

Voir les différences:

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
src/authentic2/management/commands/makemessages.py
1
# authentic2 - versatile identity manager
2
# Copyright (C) 2010-2021 Entr'ouvert
3
#
4
# This program is free software: you can redistribute it and/or modify it
5
# under the terms of the GNU Affero General Public License as published
6
# by the Free Software Foundation, either version 3 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU Affero General Public License for more details.
13
#
14
# You should have received a copy of the GNU Affero General Public License
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16

  
17
from django.core.management.commands import makemessages
18

  
19

  
20
class Command(makemessages.Command):
21
    def handle(self, *args, **options):
22
        if not options.get('add_location') and self.gettext_version >= (0, 19):
23
            options['add_location'] = 'file'
24
        return super().handle(*args, **options)
0
-