makemessages management command should not touch POT-Creation-Date

184 views
Skip to first unread message

Daniyal Abbasi

unread,
Aug 30, 2021, 6:55:30 PM8/30/21
to Django developers (Contributions to Django itself)
Hi

I was recently working on some git hooks with the makemessages command and I noticed that the "POT-Creation-Date" was always updated even if no strings were added, removed or relocated.

I created a ticket (#33056) and was redirected to #6106 which is the original ticket which was closed over 11 years ago. However, I'd like to bring this into discussion and hoping to open this issue once again.

If the po file exists, the makemessages command uses `msgmerge` in the `write_po_file` method to get the contents of the po file. (Refer this). However, msgmerge is not ran in the update mode using the `--update` flag

I propose on added this flag and making other suitable modifications as this causes a lot of issues with source control and git hooks. I've created a sample PR for the same.

Looking forward to hear what everyone thinks about this!

Thanks and regards,
Daniyal Abbasi

Adam Johnson

unread,
Aug 31, 2021, 4:04:05 AM8/31/21
to django-d...@googlegroups.com
I'm in favour of the change. Leaving the file as-is when no actual data changed just makes sense to me.

The original discussion didn't touch upon the --update flag, so maybe it didn't exist then, or the participants didn't know about it. Its existence really weakens the argument that “we shouldn't redefine the meaning of gettext's header fields”.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/32440770-55aa-4feb-b164-6940ca07838fn%40googlegroups.com.

אורי

unread,
Aug 31, 2021, 7:10:24 AM8/31/21
to Django developers (Contributions to Django itself)
I also find it annoying that one line changes always even if there are no changes in translations. I prefer the file not to change at all if nothing has changed.

Paolo Melchiorre

unread,
Aug 31, 2021, 8:28:53 AM8/31/21
to django-d...@googlegroups.com
Hi all,

I'm also in favour of the change, I also find the current behaviour annoying.

Paolo

‪On Tue, Aug 31, 2021 at 1:10 PM ‫אורי‬‎ <u...@speedy.net> wrote:‬
>
> I also find it annoying that one line changes always even if there are no changes in translations. I prefer the file not to change at all if nothing has changed.
>
> On Tue, Aug 31, 2021 at 11:03 AM 'Adam Johnson' via Django developers (Contributions to Django itself) <django-d...@googlegroups.com> wrote:
>>
>> I'm in favour of the change. Leaving the file as-is when no actual data changed just makes sense to me.
>> The original discussion didn't touch upon the --update flag, so maybe it didn't exist then, or the participants didn't know about it. Its existence really weakens the argument that “we shouldn't redefine the meaning of gettext's header fields”.
>>
>> On Mon, 30 Aug 2021 at 23:55, Daniyal Abbasi <abbasi.d...@gmail.com> wrote:
>>>
>>> I was recently working on some git hooks with the makemessages command and I noticed that the "POT-Creation-Date" was always updated even if no strings were added, removed or relocated.
>>> I created a ticket (#33056) and was redirected to #6106 which is the original ticket which was closed over 11 years ago. However, I'd like to bring this into discussion and hoping to open this issue once again.
>>> If the po file exists, the makemessages command uses `msgmerge` in the `write_po_file` method to get the contents of the po file. (Refer this). However, msgmerge is not ran in the update mode using the `--update` flag.
>>> I propose on added this flag and making other suitable modifications as this causes a lot of issues with source control and git hooks. I've created a sample PR for the same.
>>> Looking forward to hear what everyone thinks about this!



--
Paolo Melchiorre

https://www.paulox.net

Claude Paroz

unread,
Aug 31, 2021, 1:49:48 PM8/31/21
to Django developers (Contributions to Django itself)
As the won't fixer person 11 years ago, I'm also more in favour of the change now, even if it changes a bit the meaning of POT-Creation-Date from "last time the pot file was updated" to "last time a change was detected in the pot file".
Reply all
Reply to author
Forward
0 new messages