Re: pg_upgrade: prep_status doesn't translate messages

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_upgrade: prep_status doesn't translate messages
Date: 2019-06-12 02:20:00
Message-ID: CAKPRHzLi-QcgPMKTHQ6GMyynMVM_17F-fVX7e3XobraoVDEQ7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

On Tue, Jun 11, 2019 at 11:11 PM Alvaro Herrera
<alvherre(at)2ndquadrant(dot)com> wrote:
> I think the problem with those messages is that they are poorly
> worded/styled, but I haven't tried to figure out how to make them
> better. That may also fix the translation burden, not sure. If you
> have proposals for improvement, let's hear them.

I didn't think so deeply. What I had in mind at the time was
splitting-out of the variable part from template part, as we have many
existing examples.

> Here's a quick idea. We already have this:
>
> msgid "The target cluster lacks some required control information:\n"
> msgid " checkpoint next XID\n"
> msgid " latest checkpoint next OID\n"

== By the way,

I found a similar but to-exit message:

controldata.c:175
| if (cluster == &old_cluster)
| pg_fatal("The source cluster lacks cluster state information:\n");

The colon should be a period?

== END OF "By the way"

> so this gives me the idea that one way to fix the problem you mention is
> something like this:
>
> msgid "The following source and target pg_controldata items do not match:"
> msgid " block size"
> msgid " maximum relation segment size"
> etc. (One thing to note is that those strings already exist in the .po
> files, so already translated). Obviously needs a bit of code rework

Each of the message is pg_fatal'ed. So the following insated will
work:

pg_fatal("The source and target pg_controldata item do not match:%s",
_(" maximum alignment\n"));

That seems closer to the the guideline. (But I don't think
"[SP][SP]maximum[SP]alignment\n" is not proper as a translation unit..)

> (and the first new one should use the plural stuff, because it's likely
> it'll only be one item that does not match). Also will need separate
> messages (with plurals) for
>
> msgid "The following source pg_controldata items are invalid:"
> msgid "The following target pg_controldata items are invalid:"

Something like the attached works that way.

By the way I'm a bit annoyed also by the (seemingly) random occurrence
of "old/new" and "source/target".

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
PoC_pg_upgrade_controldata_error_refactor.patch application/octet-stream 4.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2019-06-12 02:58:44 Parallel grouping sets
Previous Message Andres Freund 2019-06-11 23:26:36 Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?