Opened 4 years ago

Closed 3 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 Jacob Walls, 3 years ago

Component: UncategorizedCore (Management commands)
Summary: Error message for missing locale is hard to understandUnclear error raised by makemessages when /locale does not exist under app directory
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization
Version: 3.1master

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 running makemessages 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 ran manage.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.

comment:2 by Josh Santos, 3 years ago

Owner: changed from nobody to Josh Santos
Status: newassigned

Looking into this now

comment:3 by Jacob Walls, 3 years ago

Has patch: set

comment:4 by Jacob Walls, 3 years ago

Needs tests: set
Patch needs improvement: set

comment:5 by Chinmoy, 3 years ago

This ticket hasn't seen any recent updates. May I claim it?

EDIT: Received updates :)

Last edited 3 years ago by Chinmoy (previous) (diff)

comment:6 by Josh Santos, 3 years ago

Needs tests: unset
Patch needs improvement: unset

comment:7 by Mariusz Felisiak, 3 years ago

Patch needs improvement: set

comment:8 by Mariusz Felisiak, 3 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:9 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In 9c6ba876:

Fixed #32145 -- Improved makemessages error message when app's locale directory doesn't exist.

Note: See TracTickets for help on using tickets.
Back to Top