Thread: Syntax got translated

Syntax got translated

From
Susanne Ebrecht
Date:
Hello,

I tested 9.1.2 and I used --enable-nls in ./configure.

I used psql.

I tested German, French and Spanish - I guess it is in all translated=20
languages.

The test is very easy:

CREATE TABLE t(i serial);

\d t

Output in German:
i      | integer | not null Vorgabewert nextval('t_i_seq'::regclass)

Output in French:
i       | integer | non NULL Par d=E9faut, nextval('t_i_seq'::regclass)

Output in Spanish:
i       | integer | not null valor por omisi=F3n nextval('t_i_seq'::regclas=
s)

I think that the constraint keyword "DEFAULT" should not be translated here.
In my eyes in all cases it should output:

i      | integer | not null default nextval('t_i_seq'::regclass)

Susanne

--=20
Dipl. Inf. Susanne Ebrecht - 2ndQuadrant
PostgreSQL Development, 24x7 Support, Training and Services
www.2ndQuadrant.com

Re: Syntax got translated

From
Susanne Ebrecht
Date:
Am 18.02.2012 22:11, schrieb Susanne Ebrecht:
>
> Output in French:
> i | integer | non NULL Par d=C3=A9faut, nextval('t_i_seq'::regclass)

I just recognised that in French also the "not" from "not null" got=20
translated.

Additionally I tested Turkish:
i | integer | Null de=C4=9Fil =C3=B6ntan=C4=B1ml=C4=B1 nextval('t_i_seq'::r=
egclass)

Same here - "not null" and "default" got translated.

Susanne

--=20
Dipl. Inf. Susanne Ebrecht - 2ndQuadrant
PostgreSQL Development, 24x7 Support, Training and Services
www.2ndQuadrant.com

Re: Syntax got translated

From
Alvaro Herrera
Date:
Excerpts from Susanne Ebrecht's message of s=C3=A1b feb 18 18:11:54 -0300 2=
012:

> Output in German:
> i      | integer | not null Vorgabewert nextval('t_i_seq'::regclass)
>=20
> Output in French:
> i       | integer | non NULL Par d=C3=A9faut, nextval('t_i_seq'::regclass)
>=20
> Output in Spanish:
> i       | integer | not null valor por omisi=C3=B3n nextval('t_i_seq'::re=
gclass)
>=20
> I think that the constraint keyword "DEFAULT" should not be translated he=
re.
> In my eyes in all cases it should output:
>=20
> i      | integer | not null default nextval('t_i_seq'::regclass)

I'm not clear on this.  I translated it because it seemed sensible, but
I remember stopping for a minute to consider it.  Maybe if more people
thinks it should not be translated, we could remove the translatability
marker from DEFAULT and other stuff like NOT NULL.  I'mnot sure
however.  Just removing the translations from the existing catalogs is
not enough, because future versions will just put them back.

--=20
=C3=81lvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: Syntax got translated

From
Guillaume Lelarge
Date:
On Mon, 20 Feb 2012 14:15:34 -0300, Alvaro Herrera
<alvherre@commandprompt.com> wrote:
> Excerpts from Susanne Ebrecht's message of s=C3=A1b feb 18 18:11:54 -0300
2012:
>=20
>> Output in German:
>> i      | integer | not null Vorgabewert nextval('t_i_seq'::regclass)
>>=20
>> Output in French:
>> i       | integer | non NULL Par d=C3=A9faut, nextval('t_i_seq'::regclas=
s)
>>=20
>> Output in Spanish:
>> i       | integer | not null valor por omisi=C3=B3n
>> nextval('t_i_seq'::regclass)
>>=20
>> I think that the constraint keyword "DEFAULT" should not be translated
>> here.
>> In my eyes in all cases it should output:
>>=20
>> i      | integer | not null default nextval('t_i_seq'::regclass)
>=20
> I'm not clear on this.  I translated it because it seemed sensible, but
> I remember stopping for a minute to consider it.  Maybe if more people
> thinks it should not be translated, we could remove the translatability
> marker from DEFAULT and other stuff like NOT NULL.  I'mnot sure
> however.  Just removing the translations from the existing catalogs is
> not enough, because future versions will just put them back.
>=20

I don't see why the modifiers shouldn't be translatable. It's not as if
they were intended to be copied and pasted in a query. They are here to
help the user understand the different modifiers in each column.

-1 to get rid of the translations.


--=20
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Re: Syntax got translated

From
Susanne Ebrecht
Date:
Am 20.02.2012 21:22, schrieb Guillaume Lelarge:
>
> I don't see why the modifiers shouldn't be translatable. It's not as if
> they were intended to be copied and pasted in a query. They are here to
> help the user understand the different modifiers in each column.
>

Of course they are intended to get copied and pasted. In support you
often ask
for output from \d tablename. And when I look to the languages that I
never learned,
especially when I look into Turkish - I would read NULL and not would
estimate column is
not NULL.

Default and not null are keywords - they are valid sql syntax.
They are constraint definitions.

When I output the table definition I want the constraint definition - I
don't want to translate it
back to english to understand - ahhhh default is meant.

Susanne

--
Dipl. Inf. Susanne Ebrecht - 2ndQuadrant
PostgreSQL Development, 24x7 Support, Training and Services
www.2ndQuadrant.com

Re: Syntax got translated

From
Tom Lane
Date:
Guillaume Lelarge <guillaume@lelarge.info> writes:
> On Mon, 20 Feb 2012 14:15:34 -0300, Alvaro Herrera
> <alvherre@commandprompt.com> wrote:
>> Excerpts from Susanne Ebrecht's message of sáb feb 18 18:11:54 -0300
>>> I think that the constraint keyword "DEFAULT" should not be translated
>>> here.

> I don't see why the modifiers shouldn't be translatable. It's not as if
> they were intended to be copied and pasted in a query. They are here to
> help the user understand the different modifiers in each column.

> -1 to get rid of the translations.

It seems to boil down to whether you think the "Modifiers" column
contains SQL, or a textual description of the column's properties.
I could go either way on that, but I notice that the existing code
is in the habit of truncating the default expression at 128 characters.
If we want to decide that we're printing real, copy-and-pastable SQL,
that seems like a bad idea.  On the other hand, if we're printing
informational text, it's not an unreasonable thing.

            regards, tom lane

Re: Syntax got translated

From
Guillaume Lelarge
Date:
On Mon, 20 Feb 2012 21:47:49 +0100, Susanne Ebrecht
<susanne@2ndquadrant.com> wrote:
> Am 20.02.2012 21:22, schrieb Guillaume Lelarge:
>>
>> I don't see why the modifiers shouldn't be translatable. It's not as if
>> they were intended to be copied and pasted in a query. They are here to
>> help the user understand the different modifiers in each column.
>>
>
> Of course they are intended to get copied and pasted. In support you
> often ask
> for output from \d tablename. And when I look to the languages that I
> never learned,
> especially when I look into Turkish - I would read NULL and not would
> estimate column is
> not NULL.
>
> Default and not null are keywords - they are valid sql syntax.
> They are constraint definitions.
>
> When I output the table definition I want the constraint definition - I
> don't want to translate it
> back to english to understand - ahhhh default is meant.
>

If that's so, nothing should be translatable in psql. If you do \d, the
second column is the relation type. I guess seeing vue instead of view
won't help you, so we need to stop translating this. The table's title
shouldn't be translatable too. Etc.

If you want the english way, you already can do this. You just need to ask
your customer to use "LANG=C psql" instead of psql.


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Re: Syntax got translated

From
Susanne Ebrecht
Date:
Am 20.02.2012 21:55, schrieb Tom Lane:
> It seems to boil down to whether you think the "Modifiers" column
> contains SQL, or a textual description of the column's properties.
> I could go either way on that, but I notice that the existing code
> is in the habit of truncating the default expression at 128 characters.
> If we want to decide that we're printing real, copy-and-pastable SQL,
> that seems like a bad idea.  On the other hand, if we're printing
> informational text, it's not an unreasonable thing.
>
>             regards, tom lane
>

We might also have a culture difference here.

I discovered it during a demonstration in my training class.
The whole class laughed - when they read "Vorgabewert" instead of Default.

Maybe Germans aren't used to have a translation here - Maybe French folk
is used to have a translation here.

Regards,

Susanne

--
Dipl. Inf. Susanne Ebrecht - 2ndQuadrant
PostgreSQL Development, 24x7 Support, Training and Services
www.2ndQuadrant.com

Re: Syntax got translated

From
Guillaume Lelarge
Date:
On Mon, 20 Feb 2012 15:55:54 -0500, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Guillaume Lelarge <guillaume@lelarge.info> writes:
>> On Mon, 20 Feb 2012 14:15:34 -0300, Alvaro Herrera
>> <alvherre@commandprompt.com> wrote:
>>> Excerpts from Susanne Ebrecht's message of s=C3=83=C2=A1b feb 18 18:11:=
54 -0300
>>>> I think that the constraint keyword "DEFAULT" should not be
translated
>>>> here.
>=20
>> I don't see why the modifiers shouldn't be translatable. It's not as if
>> they were intended to be copied and pasted in a query. They are here to
>> help the user understand the different modifiers in each column.
>=20
>> -1 to get rid of the translations.
>=20
> It seems to boil down to whether you think the "Modifiers" column
> contains SQL, or a textual description of the column's properties.
> I could go either way on that, but I notice that the existing code
> is in the habit of truncating the default expression at 128 characters.
> If we want to decide that we're printing real, copy-and-pastable SQL,
> that seems like a bad idea.  On the other hand, if we're printing
> informational text, it's not an unreasonable thing.
>=20

My first move was that truncating to 128 characters was bad idea. But in a
terminal, you have a limited number of columns, so it would make sense.

And, to me, it's a textual description. Not SQL. BTW, if it was SQL, when
I do \d tablename, I should get the complete SQL query to create the table,
not a description of the table definition. So, yeah, sure, the "Modifiers"
column doesn't contain SQL, it's a description.


--=20
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Re: Syntax got translated

From
Guillaume Lelarge
Date:
On Mon, 20 Feb 2012 22:14:32 +0100, Susanne Ebrecht
<susanne@2ndquadrant.com> wrote:
> Am 20.02.2012 21:55, schrieb Tom Lane:
>> It seems to boil down to whether you think the "Modifiers" column
>> contains SQL, or a textual description of the column's properties.
>> I could go either way on that, but I notice that the existing code
>> is in the habit of truncating the default expression at 128 characters.
>> If we want to decide that we're printing real, copy-and-pastable SQL,
>> that seems like a bad idea.  On the other hand, if we're printing
>> informational text, it's not an unreasonable thing.
>>
>>             regards, tom lane
>>
>
> We might also have a culture difference here.
>
> I discovered it during a demonstration in my training class.
> The whole class laughed - when they read "Vorgabewert" instead of
Default.
>
> Maybe Germans aren't used to have a translation here - Maybe French folk
> is used to have a translation here.
>

French folks are used to have translations everywhere. And if they don't,
they scream :)

I don't say it's a good thing :)


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Re: Syntax got translated

From
Susanne Ebrecht
Date:
Am 20.02.2012 22:19, schrieb Guillaume Lelarge:
> French folks are used to have translations everywhere. And if they don't,
> they scream :)
>
> I don't say it's a good thing :)
>
>

That is why I expected a culture difference here.
I know that in French all get translated to French.
That is the French culture - the French language - neither good nor bad.
It is like it is.
There are other languages that work similar to French.

Languages like German, Dutch and others just work different.

Germans often just take the English word and use it - and after a while
you can find the
English word in German thesaurus using German grammar.
When the word made it into our thesaurus - then the English word finally
got adopted as
German word.

Honestly, the problem Germans have with it is - thinking to beginners -
when they read
"Default" they know that there is a default constraint on it. When they
read one of the
translations for "default" - they don't know what is going on. You
really need to translate
to English to understand that it is a default constraint.

Germans are confused from such kind of translations. It is more
confusing for them as
it will help them.

I don't know if it is possible - but could it get split by language
here. Translate in French but
not in German or so.

Susanne

--
Dipl. Inf. Susanne Ebrecht - 2ndQuadrant
PostgreSQL Development, 24x7 Support, Training and Services
www.2ndQuadrant.com

Re: Syntax got translated

From
Guillaume Lelarge
Date:
On Mon, 20 Feb 2012 22:49:16 +0100, Susanne Ebrecht
<susanne@2ndquadrant.com> wrote:
> Am 20.02.2012 22:19, schrieb Guillaume Lelarge:
>> French folks are used to have translations everywhere. And if they
don't,
>> they scream :)
>>
>> I don't say it's a good thing :)
>>
>>
>
> That is why I expected a culture difference here.
> I know that in French all get translated to French.
> That is the French culture - the French language - neither good nor bad.

> It is like it is.
> There are other languages that work similar to French.
>
> Languages like German, Dutch and others just work different.
>
> Germans often just take the English word and use it - and after a while
> you can find the
> English word in German thesaurus using German grammar.
> When the word made it into our thesaurus - then the English word finally

> got adopted as
> German word.
>
> Honestly, the problem Germans have with it is - thinking to beginners -
> when they read
> "Default" they know that there is a default constraint on it. When they
> read one of the
> translations for "default" - they don't know what is going on. You
> really need to translate
> to English to understand that it is a default constraint.
>
> Germans are confused from such kind of translations. It is more
> confusing for them as
> it will help them.
>
> I don't know if it is possible - but could it get split by language
> here. Translate in French but
> not in German or so.
>

Sure, just don't translate it in the german .po file. Or, better, use the
same string.


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com