Commit gettext .po files without extra comments
- From: Ulrik Sverdrup <ulrik sverdrup gmail com>
- To: Kupfer list <kupfer-list gnome org>, gnome-i18n <gnome-i18n gnome org>
- Subject: Commit gettext .po files without extra comments
- Date: Fri, 4 Jun 2010 23:18:28 +0200
[Since this is a cross-mailinglist email, please use reply-to-all and
keep CC's when replying (unless this type of emails are frowned upon)]
For two reasons, I think we should store gnome translations in the git
repositories without the comments in the file that specify the
location of the string with filename and line number. This information
changes between almost every update of the file and is of no use after
having finished updating the .po.
1) This information is not useful in the diff, it makes it much longer
than it should be, with lots of noise. Here is an example commit
Here is one with comments:
In this case, the difference is not that big. And the actual content
of the translations is very good in both changes, I am sure!
The second reason is just as important in the long run
2) Over time, the line turnover will be much lower if we don't store
these location comments with each revision. Over time, this will save
lots of megabytes of version control history as the file history will
compress much better.
These location comments help the translator, and of course they will
be there for this purpose. The comments are inserted like normal by
'intltool-update' and will be there if you edit the file. It is only
when you run 'git diff' and then 'git commit' that the files will be
displayed without the comments. It is only the filename+line comments
that are stripped, other context information is kept intact.
How to enable this?
In Kupfer, this is enabled by editing two files: .gitattributes
(shared version-controlled file) and .git/config (the user's local
repository-specific configuration file).
The .po file has to be listed in the .gitattributes file like this, to
configure it with a "filter"::
Every user of the listed language must then insert the following
definition of the 'cleanpo' filter into .git/config::
clean = grep -v -E "^#: "
This "cleanpo" is not something I can configure centrally from Kupfer;
this is because of git's logic that I can't force arbitrary programs
to run on other people's clones of the repository. That is obviously
correct. That makes this scheme opt-in.
I hope that this email explains how Kupfer translators can enable this
for their language (if they want to!). I have added the same
instructions to the actual .gitattributes file:
I have also sent this email to gnome-i18n because I want your feedback
on this proposal. Summary: Filename+line comments are still available
when updating the .po file, but not shown in diffs or stored in the
repository history. All translators have to opt-in.
] [Thread Prev