pgsql: pg_test_timing: Add NLS

Started by Peter Eisentrautabout 9 years ago3 messages
#1Peter Eisentraut
peter_e@gmx.net

pg_test_timing: Add NLS

Also straighten out use of time unit abbreviations a bit.

Reviewed-by: Michael Paquier <michael.paquier@gmail.com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/59fa9d2d9da46097dd4da5c5f1f07e22a288fccf

Modified Files
--------------
doc/src/sgml/ref/pgtesttiming.sgml | 16 ++++++++--------
src/bin/pg_test_timing/nls.mk | 4 ++++
src/bin/pg_test_timing/pg_test_timing.c | 28 ++++++++++++++++------------
3 files changed, 28 insertions(+), 20 deletions(-)

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

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Peter Eisentraut (#1)
Re: [COMMITTERS] pgsql: pg_test_timing: Add NLS

Peter Eisentraut wrote:

pg_test_timing: Add NLS

Also straighten out use of time unit abbreviations a bit.

We (well, Carlos Chapi, who's doing the translation work now) just
noticed that this has a bug in this line

+ printf("%6s %10s %10s\n", _("< us"), _("% of total"), _("count"));

_() marks the strings with the c-string flag, which means that the
%-specifiers are checked by gettext, but the % in the third literal is
not a printf specifier. So there's no correct way to write the
translation. We need to use a different xgettext trigger there, one
that doesn't set c-format, but I don't know what.

Babel is now complaining:

/home/nlsuser/admin/wwwtools/scm/postgresql-master/src/bin/pg_test_timing/po/es.po:73: format specifications in 'msgid' and 'msgstr' for argument 1 are not the same

where the line is

#: pg_test_timing.c:181
#, c-format
msgid "% of total"
msgstr "% del total"

--
�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

#3Peter Eisentraut
peter.eisentraut@2ndquadrant.com
In reply to: Alvaro Herrera (#2)
Re: [COMMITTERS] pgsql: pg_test_timing: Add NLS

On 7/6/17 14:56, Alvaro Herrera wrote:

We (well, Carlos Chapi, who's doing the translation work now) just
noticed that this has a bug in this line

+ printf("%6s %10s %10s\n", _("< us"), _("% of total"), _("count"));

_() marks the strings with the c-string flag, which means that the
%-specifiers are checked by gettext, but the % in the third literal is
not a printf specifier. So there's no correct way to write the
translation. We need to use a different xgettext trigger there, one
that doesn't set c-format, but I don't know what.

I have fixed this.

--
Peter Eisentraut http://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