Opened 8 years ago
Closed 8 years ago
#26940 closed Bug (fixed)
makemessages incorrectly configured as not requiring settings
Reported by: | Jorge Romero | Owned by: | nobody |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Normal | Keywords: | translations |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
django-admin and manage.py are supposed to be interchangeable.
From the docs(https://docs.djangoproject.com/en/1.9/ref/django-admin/):
The command-line examples throughout this document use django-admin to be consistent, but any example can use manage.py or python -m django just as well.
However, this doesn't seem to be true for makemessages.
If I run manage.py makemessages from the top level of the project MEDIA_ROOT and STATIC_ROOT are ignored. This isn't precisely a bug because that's what the code is intended to do (https://github.com/django/django/blob/master/django/core/management/commands/makemessages.py#L448), but I find it strange specially for --domain djangojs because is very common for Javascript files to be put in STATIC_ROOT.
django-admin makemessages doesn't ignore MEDIA_ROOT or STATIC_ROOT and it traverses the entire source tree.
At least this should be explained in the documentation. At best both commands should do the exact same. It's very easy to be bitten by this as we don't always review the resulting *.po file.
Am I missing something here?
Change History (10)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Bug |
Currently, makemessages
is explicitly whitelisted as not needing a configured settings file (see no_settings_commands
in django.core.management.__init__.py
.
I wonder now if we should revert that, considering the dependency of that command on settings.FILE_CHARSET
, settings.LOCALE_PATHS
, settings.MEDIA_ROOT
, and settings.STATIC_ROOT
.
comment:4 by , 8 years ago
Summary: | django-admin makemessages vs. manage.py makemessages → makemessages incorrectly configured as not requiring settings |
---|---|
Triage Stage: | Accepted → Ready for checkin |
comment:6 by , 8 years ago
Resolution: | fixed |
---|---|
Status: | closed → new |
Triage Stage: | Ready for checkin → Unreviewed |
I'm considering reverting the fact that we require configured settings for makemessages.
I'm thinking about the use case of reusable apps, when you typically don't have/need STATIC_ROOT/MEDIA_ROOT/LOCALE_PATHS, and most of the time FILE_CHARSET in utf-8 is fine.
See this commit, above that PR.
comment:8 by , 8 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:10 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Maybe the documentation should mention that
--settings
must be specified todjango-admin
andpython -m django
for them to be interchangeable withmanage.py
.