Opened 16 years ago

Closed 2 years ago

Last modified 14 months ago

#6106 closed Cleanup/optimization (fixed)

make-messages.py should not touch POT-Creation-Date

Reported by: Marc Fargas Owned by: Daniyal Abbasi
Component: Internationalization Version: dev
Severity: Normal Keywords:
Cc: Daniyal Abbasi, Ad Timmering, Arthur, Petar Marić, אורי 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

Hi there,
When you run make-messages.py it changes POT-Creation-Date to now and leaves PO-Revision-Date alone.

Shouldn't it be just the opposite? Creation-Date should not be changed, while Revision Date should be set to now

Maybe I got it wrong anyway :)

Attachments (1)

6106-1.diff (2.0 KB ) - added by Ramiro Morales 14 years ago.
Patch that preserves the POT-Creation-Date header of a .po file when makemessages applies the msguniq/msmerge process

Download all attachments as: .zip

Change History (28)

comment:1 by Simon Greenhill <dev@…>, 16 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Malcolm Tredinnick, 16 years ago

I have a feeling we should just be passing --omit-header to the xgettext invocation (like we do for the javascript case) in make-messages.py. Current behaviour is certainly a small problem.

I'd hold off writing a aptch for this until after #5522 is resolved, though, since Jannis is in the process of moving everything around.

comment:3 by Jannis Leidel, 16 years ago

Doesn't --omit-header just prevents the creation of " msgid "" " at the top of the file?

by Ramiro Morales, 14 years ago

Attachment: 6106-1.diff added

Patch that preserves the POT-Creation-Date header of a .po file when makemessages applies the msguniq/msmerge process

comment:4 by Ramiro Morales, 14 years ago

Has patch: set
Owner: changed from nobody to Ramiro Morales
Status: newassigned

comment:5 by Ramiro Morales, 14 years ago

milestone: 1.2

comment:6 by Jannis Leidel, 14 years ago

milestone: 1.2
Triage Stage: AcceptedSomeday/Maybe

Hm, according to the gettext manual (http://www.gnu.org/software/gettext/manual/gettext.html#Header-Entry) POT-Creation-Date will be filled out by xgettext and PO-Revision-Date "by the PO file editor when you save the file". In other words: PO-Revision-Date doesn't have anything to do with collection/updating translation strings but with the actual translation by the translators, as in "When was this file revised last time?".

As long as we use the *.po files for the same purpose as *.pot files, POT-Creation-Date is the field that is updated automatically.

I'm changing this to someday/maybe since we shouldn't redefine the meaning of gettext's header fields.

comment:7 by Claude Paroz, 13 years ago

IMHO this is clearly a wontfix issue, as jezdez stated. It is perfectly legitimate to update POT-Creation-Date each time a po file is updated.

comment:8 by Claude Paroz, 13 years ago

Resolution: wontfix
Status: assignedclosed

comment:9 by Mariusz Felisiak, 3 years ago

Cc: Daniyal Abbasi added
Easy pickings: unset
Needs tests: set
Severity: Normal
Triage Stage: Someday/MaybeUnreviewed
Type: Cleanup/optimization
UI/UX: unset

Daniyal, Can you take this to DevelopersMailingList to reach a wider audience and see what other think? see comment.

PR

#33056 was a duplicate.

comment:10 by Daniyal Abbasi, 3 years ago

Sure Mariusz. I've started the discussion on the mailing list!
Link

comment:11 by Mariusz Felisiak, 3 years ago

Resolution: wontfix
Status: closednew
Triage Stage: UnreviewedAccepted

Reopening. Discussion in DevelopersMailingList seems to reached a consensus.

comment:12 by Mariusz Felisiak, 3 years ago

Owner: changed from Ramiro Morales to Daniyal Abbasi
Status: newassigned

comment:13 by Ad Timmering, 3 years ago

Cc: Ad Timmering added

comment:14 by Ad Timmering, 2 years ago

Hi @Daniyal - would love to see this implemented. I think the last request was to add tests - to which you asked a question (ticket:33056#comment:3) on where to put them. Do you still have time to work on tests, and/or are you still waiting for a reply to that?

Just quoting here in case someone more knowledgeable comes around and can pitch in:
Daniyal wrote ticket:33056:

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!

Last edited 2 years ago by Ad Timmering (previous) (diff)

comment:15 by Daniyal Abbasi, 2 years ago

Hey
Yes I do have the time to work on this. I'm waiting on some guidance on how I should be incorporating the tests for the same!

comment:16 by Ad Timmering, 2 years ago

Great. I would probably suggest you pick whatever place you think is best for the tests for now and add them to the PR, so you can remove the "Needs tests" flag - which will then trigger someone coming in for review. (As you will have seen the Django team just pushed 4.0.0 alpha 1 so are probably a bit occupied at the moment).

It looks like the tests in test_extraction are broken out quite granularly over multiple classes, so personally I would probably suggest a separate test class.

comment:17 by Daniyal Abbasi, 2 years ago

Needs tests: unset

Sure. For now I've added a test in the test_extraction.BasicExtractorTests class itself.

comment:18 by Mariusz Felisiak, 2 years ago

Needs tests: set

comment:19 by Daniyal Abbasi, 2 years ago

Needs tests: unset
Last edited 2 years ago by Daniyal Abbasi (previous) (diff)

comment:20 by Carlton Gibson, 2 years ago

Patch needs improvement: set

comment:21 by Arthur, 2 years ago

Cc: Arthur added

comment:22 by Ad Timmering, 2 years ago

Patch needs improvement: unset

comment:23 by Mariusz Felisiak, 2 years ago

Triage Stage: AcceptedReady for checkin

comment:24 by Mariusz Felisiak <felisiak.mariusz@…>, 2 years ago

Resolution: fixed
Status: assignedclosed

In 4bfe8c0:

Fixed #6106 -- Prevented makemessages from changing .po files when up to date.

Co-authored-by: Daniyal Abbasi <abbasi.daniyal98@…>

comment:25 by Petar Marić, 2 years ago

Cc: Petar Marić added

comment:27 by אורי, 14 months ago

Cc: אורי added
Note: See TracTickets for help on using tickets.
Back to Top