#29797: Allow the makemessages command to accept a directory to operate on like
xgettext does
-------------------------------------+-------------------------------------
     Reporter:  Terence Honles       |                    Owner:  Terence
                                     |  Honles
         Type:  New feature          |                   Status:  new
    Component:  Core (Management     |                  Version:  2.1
  commands)                          |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Terence Honles):

 Replying to [comment:7 Claude Paroz]:
 > Replying to [comment:6 Terence Honles]:
 > > I **am** able to ignore directories properly with `--ignore`, however
 I still don't see what is wrong with being able to set the `root` for
 `find_files`.
 >
 > First I think that `makemessages` has already lots of options, and I
 don't like seeing the list growing version after version.
 > But probably the most compelling reason is that for options that are
 meant to always been set for some project (typically in your case), adding
 options seems not the way to go in my opinion. Options are good for real
 options, that is an optional choice the runner of the command may activate
 or not depending on some preference. Typically, the locale to generate
 messages for (with `--locale`). I'm aware that with this rule, several
 existing options should go away, too!
 >
 > So to come back to your case, I would be open to make the `find_files`
 root more configurable, not through an option, but with a command
 attribute, so you could add your own `makemessages` command subclass in
 your project with something like this:
 >
 > {{{
 > from django.core.management.commands.makemessages import Command as
 MakeMessagesCommand
 >
 > class Command(MakeMessagesCommand):
 >     files_root = 'django_app'
 > }}}
 >
 > Would you find that satisfactory for your use case?

 Well I disagree about this not being a "real option" and I would
 **prefer** not to have to create a custom command just to configure the
 flag, but if it was easier to customize as you are suggesting I probably
 would have just created the custom command rather than creating the PR (so
 this is better than nothing). I still think extensibility should be
 provided by options so things like "make" could hold the flags rather than
 having a bunch of custom commands, but I understand in world without build
 tools you would want to make sure every user used the same options.
 Obviously this is a discussion about where your configuration lives. I
 would prefer it to be in my build tooling and others may prefer to create
 commands so it's "build in" to the `manage.py <subcommand>`. For me the
 preference is my config will live in one file rather than distributed
 across the filesystem.

 I obviously have stated my preference, but thank you for discussing this
 with me.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29797#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.fc28bb2e419fa26f193aa23e58315457%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to