[Freeipa-devel] [PATCH] 0066 Arrange stripping .po files

Petr Viktorin pviktori at redhat.com
Mon Jun 25 11:17:43 UTC 2012


The translation files we currently store in Git are full of redundant 
information: source strings for untranslated messages, and file locations.
The first causes unnecessarily huge files. The second makes diffs 
unreadable: when code is edited and line numbers change, metadata for 
all messages shows up as changed. This makes reviewing translation 
patches, and merging possible conflicts, hard -- it requires specialized 
tools.

This patch changes the Makefile to strip the unneeded data from .po files.

Translators using Git must now run msgmerge (or, `make merge-po`) to get 
.po files they can work with. Transifex users are unaffected, as the 
source .pot file is not changed.

The i18n tests use file locations for producing nice error reports¹.
To make this work as before, the .pot is merged in before validation to 
restore comments.
Currently this takes a noticeable amount of time, because polib uses a 
particularly naïve algorithm for merging. I've sent a patch to polib to 
resolve this; once that makes it downstream merging will be fast again.

Updating the translations with the new Makefile will cause a >5MB patch. 
I don't want to pollute the mailing list with it, at least until the 
Makefile patch is reviewed. It's available 
https://github.com/encukou/freeipa/commit/65e2e4.patch


https://fedorahosted.org/freeipa/ticket/2435


--
¹ And for divining the programming language messages come from, but that 
is only done on the .pot file, unaffected by this patch.

-- 
Petr³

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0066-Arrange-stripping-.po-files.patch
Type: text/x-patch
Size: 7917 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20120625/61c8722e/attachment.bin>


More information about the Freeipa-devel mailing list