MichaelChirico / potools

Tools for working with translations in R
https://michaelchirico.github.io/potools/
58 stars 2 forks source link

Drop probably unneeded metadata #313

Open hadley opened 6 months ago

hadley commented 6 months ago

It'd be nice to drop these:

"Project-Id-Version: pkgdown 2.0.9.9000\n"
"POT-Creation-Date: 2024-04-18 17:22-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

The version and dates cause spurious git diffs and the translator info is duplicative with what you'll get from git anyway.

MichaelChirico commented 6 months ago

We do need those for consistency with base:

https://github.com/search?q=repo%3Ar-devel%2Fr-svn+path%3Apo+%2FProject-Id-Version%2F&type=code

I'm also not sure if these are required by gettext. But certainly we could expose an option to supply those manually --> allow idempotency.

hadley commented 6 months ago

Maybe there could be an argument to suppress them, and it would default to true if the current project root contained a .git directory?

MichaelChirico commented 6 months ago

I'm still loath to suppress them by default. Project-Id-Version is pretty ubiquitous -- 4.9 million hits on GitHub:

https://github.com/search?q=path%3A.po%20%2FProject-Id-Version%3A%2F&type=code

Similar for POT-Creation-Date and PO-Revision-Date.

So I understand why we can suppress them and back up on git to track this info, but would do so only optionally.

These are populated by msginit by default:

https://www.gnu.org/software/gettext/manual/gettext.html#msginit-Invocation