[Django] #33056: makemessages overrides the *.po files even if they are already up to date

4 views
Skip to first unread message

Django

unread,
Aug 25, 2021, 4:58:13 PM8/25/21
to django-...@googlegroups.com
#33056: makemessages overrides the *.po files even if they are already up to date
------------------------------------------------+------------------------
Reporter: Daniyal Abbasi | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Internationalization | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33056>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 25, 2021, 5:18:04 PM8/25/21
to django-...@googlegroups.com
#33056: makemessages overrides the *.po files even if they are already up to date
-------------------------------------+-------------------------------------

Reporter: Daniyal Abbasi | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: | Version: 3.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Daniyal Abbasi):

* has_patch: 0 => 1


Comment:

I created a PR for this.
https://github.com/django/django/pull/14800

--
Ticket URL: <https://code.djangoproject.com/ticket/33056#comment:1>

Django

unread,
Aug 26, 2021, 11:37:55 AM8/26/21
to django-...@googlegroups.com
#33056: makemessages overrides the *.po files even if they are already up to date
--------------------------------------+------------------------------------

Reporter: Daniyal Abbasi | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Internationalization | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Claude Paroz):

* needs_tests: 0 => 1
* stage: Unreviewed => Accepted


Comment:

Makes sense. Please add a test.

--
Ticket URL: <https://code.djangoproject.com/ticket/33056#comment:2>

Django

unread,
Aug 27, 2021, 3:59:48 AM8/27/21
to django-...@googlegroups.com
#33056: makemessages overrides the *.po files even if they are already up to date
--------------------------------------+------------------------------------

Reporter: Daniyal Abbasi | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Internationalization | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Daniyal Abbasi):

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!

--
Ticket URL: <https://code.djangoproject.com/ticket/33056#comment:3>

Django

unread,
Aug 27, 2021, 4:00:01 AM8/27/21
to django-...@googlegroups.com
#33056: makemessages overrides the *.po files even if they are already up to date
-------------------------------------+-------------------------------------
Reporter: Daniyal Abbasi | Owner: Daniyal
Type: | Abbasi
Cleanup/optimization | Status: assigned
Component: | Version: 3.2
Internationalization |

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Daniyal Abbasi):

* owner: nobody => Daniyal Abbasi
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/33056#comment:4>

Django

unread,
Aug 30, 2021, 3:02:15 AM8/30/21
to django-...@googlegroups.com
#33056: makemessages overrides the *.po files even if they are already up to date
-------------------------------------+-------------------------------------
Reporter: Daniyal Abbasi | Owner: Daniyal
Type: | Abbasi
Cleanup/optimization | Status: assigned
Component: | Version: 3.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33056#comment:5>

Django

unread,
Aug 30, 2021, 7:11:31 AM8/30/21
to django-...@googlegroups.com
#33056: makemessages overrides the *.po files even if they are already up to date
-------------------------------------+-------------------------------------
Reporter: Daniyal Abbasi | Owner: Daniyal
Type: | Abbasi
Cleanup/optimization | Status: assigned
Component: | Version: 3.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33056#comment:6>

Django

unread,
Aug 30, 2021, 7:22:42 AM8/30/21
to django-...@googlegroups.com
#33056: makemessages overrides the *.po files even if they are already up to date
-------------------------------------+-------------------------------------
Reporter: Daniyal Abbasi | Owner: Daniyal
Type: | Abbasi
Cleanup/optimization | Status: closed
Component: | Version: 3.2
Internationalization |
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: assigned => closed
* has_patch: 1 => 0
* resolution: => duplicate
* needs_tests: 1 => 0


Comment:

Duplicate of #6106.

--
Ticket URL: <https://code.djangoproject.com/ticket/33056#comment:7>

Reply all
Reply to author
Forward
0 new messages