[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Fwd: merging PO branches?



FYI

---------- Forwarded message ----------
From: cobaco (aka Bart Cornelis) <cobaco@linux.be>
Date: Apr 7, 2006 3:21 PM
Subject: Re: merging PO branches?
To: debian-i18n@lists.debian.org


On Friday 07 April 2006 13:43, Robert Millan wrote:
> [ Please CC me, I'm not subscribed ]
>
> Hi!
>
> How does one operate to merge different branches in a PO file?  It seems
> traditional "diff & patch" methods are very fragile.
>
> Let's say I modify a PO file, then prepare a patch to send the
> maintainer. However, since PO files are full of references to C source
> line numbers, it's very likely that when the PO is updated by the
> maintainer, my patch will no longer work (context broken; fuzzy/offset
> matching is useless).
>
> I've noticed the msg* tools in gettext offer a lot of possibilities for
> filtering strings, etc.  But I couldn't find a "msgdiff/msgpatch" pair of
> commands which is what I really wanted.

take a look at msgmerge (and msgcmp), usually it's enough to msgmerge your
translation with the latest .pot of the package this will:
- fuzzy all translations for which the english string changed
- add all new english strings (possibly doing fuzzy matching with existing
  similar strings for the translation)
- remove al obsolete strings

Note: graphical tools usually have a menu option for this ('Catalog->update
      from pot file' in poedit)

if both branches have changes in the translations, you want to add the
second branch of the least preferred translation as --compendium to the
msgmerge invocation.

Another approach would be to update both branches with the latest .pot (this
gets rid of the differences from the c-references), format them to the same
pagewidth (gets rid of different line-wrap styles by different tools) with
        msgfmt randomlyFormatted.po > canonicalFormatetd.po
diff will then work ok on those 2 .po files
--
Cheers, cobaco (aka Bart Cornelis)

1. Encrypted mail preferred (GPG KeyID: 0x86624ABB)
2. Plain-text mail recommended since I move html and double
    format mails to a low priority folder (they're mainly spam)




--
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein

Attachment: pgp_02Umdc9EB.pgp
Description: PGP signature


Reply to: