Opened 4 years ago
Closed 4 years ago
#32145 closed Cleanup/optimization (fixed)
Unclear error raised by makemessages when /locale does not exist under app directory
Reported by: | Anders Hovmöller | Owned by: | Josh Santos |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | |
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
I got this error message:
CommandError: Unable to find a locale path to store translations for file conftest.py
I had to google the error message and got to this: https://stackoverflow.com/questions/24937133/unable-to-find-a-locale-path-to-store-translations-for-file-init-py It would be better if the error message was simple and obvious so you could solve the problem yourself directly instead.
I thought the error message would be better if it said 'We are looking for a directory called "locale"" but after that change the command fails silently anyway. Maybe LOCALE_PATHS should also include the directory where manage.py is by default? Or some other error message should exist...
Change History (9)
comment:1 by , 4 years ago
Component: | Uncategorized → Core (Management commands) |
---|---|
Summary: | Error message for missing locale is hard to understand → Unclear error raised by makemessages when /locale does not exist under app directory |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
Version: | 3.1 → master |
comment:4 by , 4 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
comment:5 by , 4 years ago
This ticket hasn't seen any recent updates. May I claim it?
comment:6 by , 4 years ago
Needs tests: | unset |
---|---|
Patch needs improvement: | unset |
comment:7 by , 4 years ago
Patch needs improvement: | set |
---|
comment:8 by , 4 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Thanks for the report. I agree the message needs to be improved. There might even be a case for creating
/locale
for the user when we've detected the user is runningmakemessages
in the app directory (which we already detect), but I would be interested to hear more opinions.Regarding the command failing silently, I cannot reproduce that. I marked a string for translation, created the directory
app-level-directory/locale
and ranmanage.py makemessages -l es
from the app directory and received translation files. If you suggest providing feedback to the user when no translatable strings are found that would be a separate issue.