From: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
---|---|
To: | Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> |
Cc: | pgsql-translators(at)postgresql(dot)org |
Subject: | Re: branching time |
Date: | 2019-04-28 17:37:33 |
Message-ID: | 20190428173733.GA12483@alvherre.pgsql |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-translators |
On 2019-Apr-26, Peter Eisentraut wrote:
> On 2019-04-26 20:14, Alvaro Herrera wrote:
> > I think we need to write a filter program that compares MSGFILTER_MSGID
> > to MSGFILTER_PREV_MSGID, and if the only difference is the leading "%s: "
> > and the trailing "\n", then strip those thing from stdin and write that
> > to stdout.
>
> I didn't do it that way, which explains the above problems. We can try
> it a few more times. :)
I wrote one today. I first tried doing it in bash, which is probably
gonna give me nightmares tonight, so it ended up in Perl. It's below in
case someone wants to give it a go. You run it like
msgfilter -i somefile.po ./filter > somefile-2.po
mv somefile-2.po somefile.po
(or you can use "sponge").
It wasn't as successful as I expected, mostly because msgfilter is
limited; it doesn't let you remove the "fuzzy" flag from the message
when you get a match, so you need to revise the file afterwards each
updated entry to remove the flag from each entry ... but of course there
are fuzzies for other reasons, so it's very error-prone. Anyway, I
think it's much faster than doing it all by hand. It took quite some
time to figure out a correct filter, because it's not clear how the '\n'
is represented in each place.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachment | Content-Type | Size |
---|---|---|
filter | text/plain | 408 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2019-04-28 19:31:39 | Re: branching time |
Previous Message | Peter Eisentraut | 2019-04-26 21:37:40 | Re: branching time |