The problem is with the template - perhaps the shell has expanded it for you.
In general, it is useful to avoid path separators (or / or \) in the template.
If you need to always pass certain parameters to the makemessages
, you can consider your own wrapper, such as this, which I use myself:
from django.conf import settings from django.core.management.base import BaseCommand from django.core.management import call_command class Command(BaseCommand): help = "Scan i18n messages without going into externals." def handle(self, *args, **options): call_command('makemessages', all=True, extensions=['html', 'inc'], ignore_patterns=['externals*'])
This saves your writing and provides a common entry point for scanning messages on the project (your translation colleague will not destroy translations without specifying any parameter).
Do not delete the old .po
file as soon as you have cleaned it of completely unwanted ones (that is, from the django directory). This allows gettext to process old unused messages as soon as they are used again (or similar, which will be marked as #, fuzzy
.
Change - as mt4x noted - the above shell does not allow passing parameters to the wrapped command. This is easy to fix:
from django.conf import settings from django.core.management.base import BaseCommand from django.core.management import call_command from django.core.management.commands.makemessages import Command as MakeMessagesCommand class Command(BaseCommand): help = "Scan i18n messages without going into externals." option_list = MakeMessagesCommand.option_list def handle(self, *args, **options): options['all'] = True options['extensions'] = ['html', 'inc'] options['ignore_patterns'] = ['externals*'] call_command('makemessages', **options)
That way - you can fix what needs to be fixed and bend the rest. And this should not be blind, as described above, but also conditional editing of the parameters passed to the command - adding something to the list or adding it only if it is absent.