Re: [PATCH][PROPOSAL] Add enum releation option type - Mailing list pgsql-hackers

From Nikolay Shaplov
Subject Re: [PATCH][PROPOSAL] Add enum releation option type
Date
Msg-id 1772537.zFQtMGATT1@x200m
Whole thread Raw
In response to Re: [PATCH][PROPOSAL] Add enum releation option type  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH][PROPOSAL] Add enum releation option type  (Nikolay Shaplov <dhyan@nataraj.su>)
List pgsql-hackers
В письме от 1 ноября 2018 11:10:14 пользователь Tom Lane написал:

> >>> I see you lost the Oxford comma:
> >>>
> >>> -DETAIL:  Valid values are "on", "off", and "auto".
> >>> +DETAIL:  Valid values are "auto", "on" and "off".
> >>>
> >>> Please put these back.
> >>
> >> Actually that's me who have lost it. The code with  oxford comma would be
> >> a
> >> bit more complicated. We should put such coma when we have 3+ items and
> >> do not put it when we have 2.
> >>
> >> Does it worth it?
> >
> > In my opinion, it is worth it.
>
> Uh ... I've not been paying attention to this thread, but this exchange
> seems to be about somebody constructing a message like that piece-by-piece
> in code.  This has got to be a complete failure from the translatability
> standpoint.  See
>
> https://www.postgresql.org/docs/devel/static/nls-programmer.html#NLS-GUIDELI
> NES

It's a very good reason...

In this case the only solution I can see is

DETAIL:  Valid values are: "value1", "value2", "value3".

Where list '"value1", "value2", "value3"' is built in runtime but have no any
bindnings to any specific language. And the rest of the message is
'DETAIL:  Valid values are: %s' which can be properly translated.


--
Do code for fun.
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH][PROPOSAL] Add enum releation option type
Next
From: "Bossart, Nathan"
Date:
Subject: Re: New vacuum option to do only freezing