pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
fixing pg_upgrade strings (was Re: pgsql: Add new files to nls.mk and add translation)
2+ messages / 2 participants
[nested] [flat]

* fixing pg_upgrade strings (was Re: pgsql: Add new files to nls.mk and add translation)
@ 2017-08-03 03:47  Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Alvaro Herrera @ 2017-08-03 03:47 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-hackers@postgresql.org

Peter Eisentraut wrote:
> Add new files to nls.mk and add translation markers

This reminds me that I noticed a few days ago another really serious
broken piece in pg_upgrade where check_required_directory() is incurring
in the ugliest case of string building I've ever seen.  I didn't have
the courage to try to fix it back then, but I think we should dedicate
it some time.  It does this:

            pg_fatal("You must identify the directory where the %s.\n"
                     "Please use the %s command-line option or the %s environment variable.\n",
                     description, cmdLineOption, envVarName);

and the callsites are like this:

    check_required_directory(&new_cluster.bindir, NULL, "PGBINNEW", "-B",
                             _("new cluster binaries reside"));
    check_required_directory(&old_cluster.pgdata, &old_cluster.pgconfig,
                             "PGDATAOLD", "-d", _("old cluster data resides"));

note the declensions don't match even in the English original.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: fixing pg_upgrade strings (was Re: pgsql: Add new files to nls.mk and add translation)
@ 2017-08-03 04:15  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2017-08-03 04:15 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Peter Eisentraut <peter_e@gmx.net>; pgsql-hackers@postgresql.org

Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> It does this:

>             pg_fatal("You must identify the directory where the %s.\n"
>                      "Please use the %s command-line option or the %s environment variable.\n",
>                      description, cmdLineOption, envVarName);

> and the callsites are like this:

>     check_required_directory(&new_cluster.bindir, NULL, "PGBINNEW", "-B",
>                              _("new cluster binaries reside"));
>     check_required_directory(&old_cluster.pgdata, &old_cluster.pgconfig,
>                              "PGDATAOLD", "-d", _("old cluster data resides"));

> note the declensions don't match even in the English original.

FWIW, I think the English declensions are fine as long as you consider
"data" to be a group noun --- "data reside" would read a bit funny IMO.
But certainly this is an utter translatability fail.  Maybe pass a boolean
to indicate one of two first sentences to use?  Or actually, might as well
consider the entire message string to be one of two translatable options.
It's not like we have a need to indicate more than one option or envar
name for each case.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2017-08-03 04:15 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-08-03 03:47 fixing pg_upgrade strings (was Re: pgsql: Add new files to nls.mk and add translation) Alvaro Herrera <alvherre@2ndquadrant.com>
2017-08-03 04:15 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox