#31914 closed Bug (invalid)
Django does not pick up .mo files when LOCALE_PATHS is unset — at Version 3
Reported by: | Ondřej Kolín | Owned by: | nobody |
---|---|---|---|
Component: | Internationalization | Version: | 3.1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Update: Kinda resolved, see my comment.
- Set LANGUAGE_CODE and LANGUAGES in settings.py
- You are able to makemessages and compilemessages
- Django is not picking up the translated messages
- Set the LOCALE_PATHS variable in the settings.py
- django now picks the messages
Fragment of settings.py
LANGUAGE_CODE = 'en' LANGUAGES =[ ('en', _('English')), ('cs', _('Czech')) ] LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale'), )
If this is intended, I think that makemessages/compile messages should fail as well. If not, the discovery should work as well.
Basic dir structure
.
├── db.sqlite3
├── locale
├── manage.py
├── safecloud
├── secshare
└── static
cat ./../venv/pyvenv.cfg
home = /usr/bin
include-system-site-packages = false
version = 3.8.3
Change History (5)
by , 4 years ago
Attachment: | without_locales_path_set.png added |
---|
by , 4 years ago
Attachment: | with_locales_path_set.png added |
---|
comment:1 by , 4 years ago
Description: | modified (diff) |
---|
comment:2 by , 4 years ago
Description: | modified (diff) |
---|
comment:3 by , 4 years ago
Description: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
As @felix pointed on irc.freenode.org #django-dev, the behaviour is documented.
But I still think this is kinda bug, or at least inconsistent, because, where is the point to be able to gather messages/compile them, but they stay unusable in the system, because the var is not set.
I think, that ./managepy compilemessages should throw a warning at least.
Without locales path set