Skip to content

Commit

Permalink
Set PO-Revision-Date for PO files created from POT
Browse files Browse the repository at this point in the history
It was already set when _saving_ the file, but that's too late. We need
to set it to a valid value at creation time, otherwise Validate on not
yet saved file would throw an error.
  • Loading branch information
vslavik committed May 16, 2020
1 parent ee6b1f6 commit 6ffba64
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,9 @@ void Catalog::CreateNewHeader(const Catalog::HeaderData& pot_header)
HeaderData &dt = Header();
dt = pot_header;

if ( !dt.RevisionDate.empty() )
dt.RevisionDate = GetCurrentTimeString();

// UTF-8 should be used by default no matter what the POT uses
dt.Charset = "UTF-8";

Expand Down

3 comments on commit 6ffba64

@l2dy
Copy link
Contributor

@l2dy l2dy commented on 6ffba64 May 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If dt.RevisionDate is not empty, set it to the current time. Why not assign it when RevisionDate is empty? Am I reading this wrong?

@vslavik
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because that's how it's done elsewhere.

GitHub has very good UI for git blame, please use it to satisfy spelunking urges like this ;) See b8d8aa9

@l2dy
Copy link
Contributor

@l2dy l2dy commented on 6ffba64 May 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See b8d8aa9

The sourceforge link is dead, but I get the point. Thanks!

Please sign in to comment.