A Japanese-unfriendy error message contruction

Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>

From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: pgsql-hackers@postgresql.org
Date: 2018-05-22T09:20:20Z
Lists: pgsql-hackers

Attachments

Hello.

While I revised the translation, I ran across the following code.

>    form_policy = (Form_pg_policy) GETSTRUCT(tuple);
>
>    appendStringInfo(&buffer, _("policy %s on "),
>             NameStr(form_policy->polname));
>    getRelationDescription(&buffer, form_policy->polrelid);

getRelationDescription appends a string like "table %s" to the
buffer so finally a message like "policy %s on table %s" is
constructed but this is very unfriendly to Japanese syntax.

The "policy %s" and "<objname> %s" are transposed in Japaese
syntax.  Specifically "<objname> %s NO <policy> %s" is the
natural translation of "policy %s on <objname> %s". But currently
we cannot get the natural error message in Japanese.

For the reason, I'd like to propose to refactor
getObjectDescription:OPCLASS_POLICY as the attached patch. The
same structure is seen for OPCLASS_AMOP.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

Commits

  1. Improve English wording of some other getObjectDescription() messages.

  2. Improve translatability of some getObjectDescription() messages.

  3. Fix objectaddress.c code for publication relations.

  4. Properly schema-qualify additional object types in getObjectDescription().