Rough draft: easier translation of psql help - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Rough draft: easier translation of psql help
Date
Msg-id 1252876244.26439.18.camel@vanquo.pezone.net
Whole thread Raw
Responses Re: Rough draft: easier translation of psql help
Re: Rough draft: easier translation of psql help
Re: Rough draft: easier translation of psql help
List pgsql-hackers
One of the main pains in translating PostgreSQL messages is translating
the SQL syntax synopses in psql.  Things like:

msgid ""
"[ WITH [ RECURSIVE ] with_query [, ...] ]\n"
"SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]\n"
"    * | expression [ [ AS ] output_name ] [, ...]\n"
"    INTO [ TEMPORARY | TEMP ] [ TABLE ] new_table\n"
"    [ FROM from_item [, ...] ]\n"
"    [ WHERE condition ]\n"
"    [ GROUP BY expression [, ...] ]\n"
"    [ HAVING condition [, ...] ]\n"
"    [ WINDOW window_name AS ( window_definition ) [, ...] ]\n"
"    [ { UNION | INTERSECT | EXCEPT } [ ALL ] select ]\n"
"    [ ORDER BY expression [ ASC | DESC | USING operator ] [ NULLS
{ FIRST | "
"LAST } ] [, ...] ]\n"
"    [ LIMIT { count | ALL } ]\n"
"    [ OFFSET start [ ROW | ROWS ] ]\n"
"    [ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ]\n"
"    [ FOR { UPDATE | SHARE } [ OF table_name [, ...] ] [ NOWAIT ]
[...] ]"

Especially when small things are changed from release to release,
figuring this out on the part of the translator is cumbersome and
error-prone.

Instead of translating the whole string, that is (picking a shorter
example)

N_("ALTER TEXT SEARCH PARSER name RENAME TO newname")

we really only want to translate the placeholders, so it could look like
this:

   appendPQExpBuffer(buf,
                      "ALTER TEXT SEARCH PARSER %s RENAME TO %s",
                      _("name"),
                      _("newname"));

This is what the attached patch produces.

Comments?

Attachment

pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: RfD: more powerful "any" types
Next
From: Josh Berkus
Date:
Subject: Re: COPY enhancements