Coverage for app/venv/lib/python3.14/site-packages/weblate/utils/management/commands/makemessages.py: 0%

13 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 07:15 +0000

1# Copyright © Michal Čihař <michal@weblate.org> 

2# 

3# SPDX-License-Identifier: GPL-3.0-or-later 

4 

5from django.conf import settings 

6from django.core.management.commands.makemessages import Command as BaseCommand 

7 

8from weblate.utils.files import should_skip 

9 

10 

11class Command(BaseCommand): 

12 def find_files(self, root): 

13 result = super().find_files(root) 

14 if not settings.LOCALE_FILTER_FILES: 

15 # Used in wlhosted 

16 return result 

17 return [ 

18 obj 

19 for obj in result 

20 if not should_skip(obj.path) # type: ignore[attr-defined] 

21 ] 

22 

23 def build_potfiles(self): 

24 if self.domain == "django": 

25 self.xgettext_options = [ 

26 *self.xgettext_options, 

27 "--keyword=pgettext_noop:1c,2", 

28 ] 

29 return super().build_potfiles()