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

Re: Utility to unfuzzy one specific msgstr in .po files?



On Apr 11, 2005 9:35 PM, Tobias Toedter <t.toedter@gmx.net> wrote:
> On Monday 11 April 2005 15:13, Anibal Monsalve Salazar wrote:
> > On Mon, Apr 11, 2005 at 03:05:26PM +0200, Tobias Toedter wrote:
> > >Does anyone know a solution for this, other than manual editing?
> >
> > http://lists.debian.org/debian-i18n/2005/03/msg00047.html
> 
> Well, the recipe mentioned there is not exactly what I was looking for --
> the "unfuzzyfication" of corrected msgstrs requires the translated .po
> files to contain only translated and untranslated msgstrs. It would fail if
> there are already one or more fuzzy entries.

The following command probably does what you want, provided you can
get the regex right for the msgid -- though the command is cumbersome.

msgmerge bad.po new.pot | msggrep -K -E "<regex>" -  | msgattrib
--clear-fuzzy | msgmerge -o good.po bad.po new.pot -C -

Here bad.po is old po file with wrong msgid, new.pot is .pot with
corrected msgid, and "<regex>" is extended regular expression
(as of egrep) representing the correct msgid. The idea is to generate a
compendium consisting of the single entry with correct msgid,
and remove its fuzziness. Afterwards, merge this compendium
with the incorrect po file. The downside is, it is sloooooow.

Disclaimer: I only tested the command with simple cases.

Abel


> 
> Quoting Christian Perrier:
> > Nothing already written comes to my mind.
> 
> Hrm.
> 
> Quoting him again:
> > There are other ways, more elaborated, to do preventive modification
> > of PO files (for instance by using sed)....which allow the
> > "unfuzzyfication" process to be done even on incomplete files....but
> > this is gory enough for being left to people who *really* are sure of
> > what they do...:-)
> 
> This seems to be what I was looking for. Christian, are you willing to share
> those elaborated ways?
> 
> Cheers,
> 
> --
> 
> Tobias
> 
>     Recursion: n., see Recursion.
> 
> 
>



Reply to: