Re: Fixed redundant i18n strings in json

Lists: pgsql-hackers
From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Fixed redundant i18n strings in json
Date: 2014-07-30 18:59:46
Message-ID: CA+mi_8a3ve0bintuJXswCu2OgPJUb213DWAwvWGuC=EuxOPgEg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Please find attached a small tweak to a couple of strings found while
updating translations. The %d version is already used elsewhere in the
same file.

-- Daniele

Attachment Content-Type Size
fixarg.patch text/x-patch 890 bytes

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed redundant i18n strings in json
Date: 2014-07-31 12:57:41
Message-ID: CA+TgmoagE5g4r=BrGvKyMw9OEz5uFoJztQt0ZeXiMF9YVwHXgw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Jul 30, 2014 at 2:59 PM, Daniele Varrazzo
<daniele(dot)varrazzo(at)gmail(dot)com> wrote:
> Please find attached a small tweak to a couple of strings found while
> updating translations. The %d version is already used elsewhere in the
> same file.

Probably not a bad idea, but aren't these strings pretty awful anyway?
At a minimum, "arg" as an abbreviation for "argument" doesn't seem
good.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed redundant i18n strings in json
Date: 2014-08-02 13:15:26
Message-ID: CA+mi_8YMbUMtFsbuPTL8DNauxFraE5ia8==jp6Yqbp8oCn_6Gg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I'd definitely replace /arg/argument/. Furthermore I'd avoid the form
"argument 1: something is wrong": the string is likely to end up in
sentences with other colons so I'd rather use "something is wrong at
argument 1".

Is the patch attached better?

Cheers,

-- Daniele

On Thu, Jul 31, 2014 at 1:57 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Wed, Jul 30, 2014 at 2:59 PM, Daniele Varrazzo
> <daniele(dot)varrazzo(at)gmail(dot)com> wrote:
>> Please find attached a small tweak to a couple of strings found while
>> updating translations. The %d version is already used elsewhere in the
>> same file.
>
> Probably not a bad idea, but aren't these strings pretty awful anyway?
> At a minimum, "arg" as an abbreviation for "argument" doesn't seem
> good.
>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company

Attachment Content-Type Size
fixarg2.patch text/x-patch 2.9 KB

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed redundant i18n strings in json
Date: 2014-08-05 16:35:17
Message-ID: CA+TgmoY6gSoNtrRX3_yRQgVa639PVBUmY+ygYdUL9X7DgHcY4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Aug 2, 2014 at 9:15 AM, Daniele Varrazzo
<daniele(dot)varrazzo(at)gmail(dot)com> wrote:
> I'd definitely replace /arg/argument/. Furthermore I'd avoid the form
> "argument 1: something is wrong": the string is likely to end up in
> sentences with other colons so I'd rather use "something is wrong at
> argument 1".
>
> Is the patch attached better?

Looks OK to me. I thought someone else might comment, but since no
one has, committed.

(As a note for the future, you forgot to update the regression test
outputs; I took care of that before committing.)

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed redundant i18n strings in json
Date: 2014-08-05 22:05:54
Message-ID: CAMkU=1wGRVta0fCHfXy4rSTi4ew+DNxAPcjs_AOqQtUESnTtBg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Aug 5, 2014 at 9:35 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Sat, Aug 2, 2014 at 9:15 AM, Daniele Varrazzo
> <daniele(dot)varrazzo(at)gmail(dot)com> wrote:
> > I'd definitely replace /arg/argument/. Furthermore I'd avoid the form
> > "argument 1: something is wrong": the string is likely to end up in
> > sentences with other colons so I'd rather use "something is wrong at
> > argument 1".
> >
> > Is the patch attached better?
>
> Looks OK to me. I thought someone else might comment, but since no
> one has, committed.
>
> (As a note for the future, you forgot to update the regression test
> outputs; I took care of that before committing.)
>

I think you missed one of the regression tests, see attached

Thanks,

Jeff

Attachment Content-Type Size
regression.diffs application/octet-stream 931 bytes

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed redundant i18n strings in json
Date: 2014-08-06 15:35:15
Message-ID: CA+Tgmoa=fDe1B22ZOwRz2XQW3OztDTDT16vrYQp-xH0nfERRAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Aug 5, 2014 at 6:05 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> I think you missed one of the regression tests, see attached

Woops. Thanks, committed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed redundant i18n strings in json
Date: 2014-08-06 23:20:01
Message-ID: CAMkU=1xfZWiPMOFj7WNgUY1FaCFyPi6OdTB=KD2RoigAMUWUzA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Aug 6, 2014 at 8:35 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Tue, Aug 5, 2014 at 6:05 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> > I think you missed one of the regression tests, see attached
>
> Woops. Thanks, committed.
>

Thanks.

It needs to go into 9_4_STABLE as well.

Cheers,

Jeff


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed redundant i18n strings in json
Date: 2014-08-07 06:24:36
Message-ID: CAB7nPqSq3mmMTeoojwRM681DcQPQwWzJ3bRUdN-5FRnQuHABig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Aug 7, 2014 at 8:20 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> It needs to go into 9_4_STABLE as well.
It is worth noticing that the buildfarm is completely in red because
this patch was not backpatched to REL9_4_STABLE:
http://buildfarm.postgresql.org/cgi-bin/show_status.pl
Regards,
--
Michael


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed redundant i18n strings in json
Date: 2014-08-07 13:52:27
Message-ID: CA+TgmoaOOyM6RZ=b7NcQ=z+b7dVoVuE-F=LXaHyBgP-9BLbLHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Aug 6, 2014 at 7:20 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> On Wed, Aug 6, 2014 at 8:35 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>
>> On Tue, Aug 5, 2014 at 6:05 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
>> > I think you missed one of the regression tests, see attached
>>
>> Woops. Thanks, committed.
>
> Thanks.
>
> It needs to go into 9_4_STABLE as well.

Sheesh, where is my brain? Done, thanks.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed redundant i18n strings in json
Date: 2014-08-07 19:28:12
Message-ID: 18716.1407439692@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Sat, Aug 2, 2014 at 9:15 AM, Daniele Varrazzo
> <daniele(dot)varrazzo(at)gmail(dot)com> wrote:
>> I'd definitely replace /arg/argument/. Furthermore I'd avoid the form
>> "argument 1: something is wrong": the string is likely to end up in
>> sentences with other colons so I'd rather use "something is wrong at
>> argument 1".
>>
>> Is the patch attached better?

> Looks OK to me. I thought someone else might comment, but since no
> one has, committed.

It looks to me like this is still wrong:

if (nargs % 2 != 0)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("invalid number or arguments: object must be matched key value pairs")));
+ errmsg("invalid number or arguments"),
+ errhint("Object must be matched key value pairs.")));

Surely that was meant to read "invalid number OF arguments". The errhint
is only charitably described as English, as well. I'd suggest something
like "Arguments of json_build_object() must be pairs of keys and values."
--- but maybe someone else can phrase that better.

regards, tom lane


From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fixed redundant i18n strings in json
Date: 2014-08-07 21:26:52
Message-ID: 1407446812103-5814122.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane-2 wrote
> Robert Haas &lt;

> robertmhaas@

> &gt; writes:
>> On Sat, Aug 2, 2014 at 9:15 AM, Daniele Varrazzo
>> &lt;

> daniele.varrazzo@

> &gt; wrote:
>>> I'd definitely replace /arg/argument/. Furthermore I'd avoid the form
>>> "argument 1: something is wrong": the string is likely to end up in
>>> sentences with other colons so I'd rather use "something is wrong at
>>> argument 1".
>>>
>>> Is the patch attached better?
>
>> Looks OK to me. I thought someone else might comment, but since no
>> one has, committed.
>
> It looks to me like this is still wrong:
>
> if (nargs % 2 != 0)
> ereport(ERROR,
> (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
> - errmsg("invalid number or arguments: object must be
> matched key value pairs")));
> + errmsg("invalid number or arguments"),
> + errhint("Object must be matched key value pairs.")));
>
> Surely that was meant to read "invalid number OF arguments". The errhint
> is only charitably described as English, as well. I'd suggest something
> like "Arguments of json_build_object() must be pairs of keys and values."
> --- but maybe someone else can phrase that better.

The user documentation is worth emulating here:

http://www.postgresql.org/docs/9.4/interactive/functions-json.html

errmsg("argument count must be divisible by 2")
errhint("The argument list consists of alternating names and values")

Note that I s/keys/names/ to match said documentation.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Fixed-redundant-i18n-strings-in-json-tp5813330p5814122.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fixed redundant i18n strings in json
Date: 2014-08-08 00:53:36
Message-ID: 25107.1407459216@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> Tom Lane-2 wrote
>> Surely that was meant to read "invalid number OF arguments". The errhint
>> is only charitably described as English, as well. I'd suggest something
>> like "Arguments of json_build_object() must be pairs of keys and values."
>> --- but maybe someone else can phrase that better.

> The user documentation is worth emulating here:
> http://www.postgresql.org/docs/9.4/interactive/functions-json.html

> errmsg("argument count must be divisible by 2")
> errhint("The argument list consists of alternating names and values")

Seems reasonable to me.

> Note that I s/keys/names/ to match said documentation.

Hm. The docs aren't too consistent either: there are several other nearby
places that say "keys". Notably, the functions json[b]_object_keys() have
that usage embedded in their names, where we can't readily change it.

I'm inclined to think we should s/names/keys/ in the docs instead.
Thoughts?

regards, tom lane


From: David Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed redundant i18n strings in json
Date: 2014-08-08 01:06:19
Message-ID: CAKFQuwZANaGEvzi8z3vgiTN4ttRoutqL9gNcFzaPXOMEWOsyFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Aug 7, 2014 at 5:53 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> > Tom Lane-2 wrote
> >> Surely that was meant to read "invalid number OF arguments". The
> errhint
> >> is only charitably described as English, as well. I'd suggest something
> >> like "Arguments of json_build_object() must be pairs of keys and
> values."
> >> --- but maybe someone else can phrase that better.
>
> > The user documentation is worth emulating here:
> > http://www.postgresql.org/docs/9.4/interactive/functions-json.html
>
> > errmsg("argument count must be divisible by 2")
> > errhint("The argument list consists of alternating names and values")
>
> Seems reasonable to me.
>
> > Note that I s/keys/names/ to match said documentation.
>
> Hm. The docs aren't too consistent either: there are several other nearby
> places that say "keys". Notably, the functions json[b]_object_keys() have
> that usage embedded in their names, where we can't readily change it.
>
> I'm inclined to think we should s/names/keys/ in the docs instead.
> Thoughts?
>
>
Agreed - have the docs match the common API term usage in our
implementation.

Not sure its worth a thorough hunt but at least fix them as they are
noticed.

David J.