#34448 closed Cleanup/optimization (fixed)

makemessages' --no-obsolete option is undocumented and untested.

Reported by: Tom Sparrow Owned by: Tushar
Component: Core (Management commands) Version: 4.1
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

The documentation for makemessages is missing the argument --no-obsolete despite it being present in the source code.

For example it is not mentioned at all here: https://docs.djangoproject.com/en/4.1/ref/django-admin/#makemessages

But is present & working in the source code: https://github.com/django/django/blob/stable/4.1.x/django/core/management/commands/makemessages.py#L312

Is this a deliberate omission?

Change History (10)

comment:1 by Mariusz Felisiak, 20 months ago

Component: DocumentationCore (Management commands)
Summary: Docs missing --no-obsolete argument to makemessagesmakemessages' --no-obsolete option is undocumented and untested.
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

Thanks for the report, this option is also untested (added in cf179e195d5525e0233385be97a53a6c5d7c6985).

comment:2 by Basant Babu Bhandari, 20 months ago

Owner: changed from nobody to Basant Babu Bhandari
Status: newassigned

working on it

comment:3 by Tushar, 17 months ago

Owner: changed from Basant Babu Bhandari to Tushar

comment:4 by Tushar, 17 months ago

Hey, I was playing around with the --no-obsolete option and found https://stackoverflow.com/a/49372926/12409303. This behavior is true, .po files are not updated if there are no gettext present, which means obsolete strings still remain there in the .po file. Is this the intended behaviour that has to be documented or is it a bug ?

in reply to:  4 comment:5 by Mariusz Felisiak, 17 months ago

Replying to Tushar:

Hey, I was playing around with the --no-obsolete option and found https://stackoverflow.com/a/49372926/12409303. This behavior is true, .po files are not updated if there are no gettext present, which means obsolete strings still remain there in the .po file. Is this the intended behaviour that has to be documented or is it a bug ?

This looks like an issue in msgattrib, not in Django itself.

comment:6 by Tushar, 17 months ago

Yes, confirmed. This is an issue with msgattrib. I tried calling it directly and it failed to modify the .po files if every translation is obsolete. I will add it as a side note while documenting to add more clarity for users.

in reply to:  6 comment:7 by Mariusz Felisiak, 17 months ago

Replying to Tushar:

I will add it as a side note while documenting to add more clarity for users.

We don't document bugs in other tools.

comment:8 by Mariusz Felisiak, 17 months ago

Has patch: set
Patch needs improvement: set

comment:9 by Mariusz Felisiak, 17 months ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:10 by Mariusz Felisiak <felisiak.mariusz@…>, 17 months ago

Resolution: fixed
Status: assignedclosed

In 88a2de3c:

Fixed #34448 -- Doc'd and tested --no-obsolete option of makemessages.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@…>

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