Discussion:
Gettext utility to compare two PO files
Christian Perrier
2005-04-10 17:40:25 UTC
Permalink
For D-I l10n handling, I'm looking for a method for being able to
isolate the msgids from a PO file which are NOT in another PO file.

Something like the opposite behaviour of msgcomm(1)

msgcmp(1) does something like this, but I would indeed need to output
the strings which are in file1 but not in file2 as a PO file...

--
Denis Barbier
2005-04-10 18:59:30 UTC
Permalink
Post by Christian Perrier
For D-I l10n handling, I'm looking for a method for being able to
isolate the msgids from a PO file which are NOT in another PO file.
Something like the opposite behaviour of msgcomm(1)
msgcmp(1) does something like this, but I would indeed need to output
the strings which are in file1 but not in file2 as a PO file...
Hi Christian,

"msgcat -u file1.po file2.po" does the trick.

Denis
Christian Perrier
2005-04-11 05:04:10 UTC
Permalink
Post by Denis Barbier
Post by Christian Perrier
Something like the opposite behaviour of msgcomm(1)
msgcmp(1) does something like this, but I would indeed need to output
the strings which are in file1 but not in file2 as a PO file...
Hi Christian,
"msgcat -u file1.po file2.po" does the trick.
Thanks, it seems that both that and Martin's suggestion fit the
need....

Which incidentally shows me that a few strings are in D-I sarge branch
POT file and no more in D-I trunk branch POT file while I was thinking
that no such strings existed.

Dammit...:-)
Denis Barbier
2005-04-11 05:58:15 UTC
Permalink
Post by Denis Barbier
Post by Christian Perrier
For D-I l10n handling, I'm looking for a method for being able to
isolate the msgids from a PO file which are NOT in another PO file.
Something like the opposite behaviour of msgcomm(1)
msgcmp(1) does something like this, but I would indeed need to output
the strings which are in file1 but not in file2 as a PO file...
Hi Christian,
"msgcat -u file1.po file2.po" does the trick.
More precisely "msgcat -u file1.po file2.po file2.po"

Denis

Martin Quinson
2005-04-10 19:17:07 UTC
Permalink
Post by Christian Perrier
For D-I l10n handling, I'm looking for a method for being able to
isolate the msgids from a PO file which are NOT in another PO file.
Something like the opposite behaviour of msgcomm(1)
msgcmp(1) does something like this, but I would indeed need to output
the strings which are in file1 but not in file2 as a PO file...
msgcomm -u does something very close. Indeed, to select the strings in 1.po
and not in 2.po, I think you could do:

msgcomm -u 1.po 2.po 2.po -o res.po

Strings which are both in 1 and 2 are discarded, and strings which are in 2
but not in 1 are also discarded since they are in both instance of 2.po.
Only strings which are in 1.po but not in 2.po remain.

Note that this is not tested, and that if it fails, doing such a tool which
the perl tools for Po manipulation contained in po4a should be quite easy.

Mt.
Loading...