Opened 3 years ago

Closed 3 years ago

#33056 closed Cleanup/optimization (duplicate)

makemessages overrides the *.po files even if they are already up to date

Reported by: Daniyal Abbasi Owned by: Daniyal Abbasi
Component: Internationalization Version: 3.2
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The *.po files are updated when the makemessages command in run even if they are already up to date. The significant change that occurs is the "POT-Creation-Date". If a *.po file exists, we should use the --update flag of msgmerge. This will not update the *.po if all the translation strings are not updated.

A benifit of this (that I personally encountered) would be writing pre-commit hooks for makemessages. The pre-commit hooks would not update the file if it is already up to date.

Change History (7)

comment:1 by Daniyal Abbasi, 3 years ago

Has patch: set

comment:2 by Claude Paroz, 3 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

Makes sense. Please add a test.

comment:3 by Daniyal Abbasi, 3 years ago

Thanks for accepting this. I'm not sure where the tests should live. Should the tests go in the BasicExtractorTests or should they be in a separate class in the tests.i18n.test_extraction?
Moreover, I could not find any tests for the write_po_file method of the makemessages Command class. Let me know how I shall proceed!

comment:4 by Daniyal Abbasi, 3 years ago

Owner: changed from nobody to Daniyal Abbasi
Status: newassigned

comment:5 by Mariusz Felisiak, 3 years ago

Claude, it looks like a duplicate of #6106. IMO we should close this as a duplicate and reopen the original ticket if we want to change the previous decision.

comment:6 by Claude Paroz, 3 years ago

This may be discussed on the django-developers mailing list.

I guess the closing 11 years ago was to keep the meaning of POT-Creation-Date as "last time we checked for new translations", vs "last time a string changed in the file". However I can understand the issue it is with source control, having been bitten by this too. Now I think I'm rather in favour of the change, but getting more opinions from the mailing list would be great.

comment:7 by Mariusz Felisiak, 3 years ago

Has patch: unset
Needs tests: unset
Resolution: duplicate
Status: assignedclosed

Duplicate of #6106.

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