dbTalk Databases Forums  

[BUGS] BUG #2632: createuser language poblem

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2632: createuser language poblem in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Massimo Fidanza
 
Posts: n/a

Default [BUGS] BUG #2632: createuser language poblem - 09-18-2006 , 12:37 PM







The following bug has been logged online:

Bug reference: 2632
Logged by: Massimo Fidanza
Email address: max (AT) massimofidanza (DOT) it
PostgreSQL version: 8.1.4
Operating system: Ubuntu 6.04
Description: createuser language poblem
Details:

Hi, I discover a very annoying bug in the create user command. I have the
environment variable LANG=it_IT.UTF-8 and when I try to crate a new user wit
the create user command, at he prompt I have the three questions
Shall the new role be a superuser? (y/n)
Shall the new role be allowed to create databases? (y/n)
Shall the new role be allowed to create more new roles? (y/n)
So I ask y only to the second, but when I try to create a new database with
the new just created user it claims that I don't have permissions. So I drop
the user and recreated it several times. After a lot of tentative I discover
the arcane I must ask s=sì the italian affermative answer during
createuser, but the question is in english. This is a very stupid bug. I
think the right is to accept the italian and the english answer as oher
commands do like apt. Translate the question to is not a bad idea.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2632: createuser language poblem - 09-18-2006 , 03:48 PM






"Massimo Fidanza" <max (AT) massimofidanza (DOT) it> writes:
Quote:
Hi, I discover a very annoying bug in the create user command. I have the
environment variable LANG=it_IT.UTF-8 and when I try to crate a new user wit
the create user command, at he prompt I have the three questions
Shall the new role be a superuser? (y/n)
Shall the new role be allowed to create databases? (y/n)
Shall the new role be allowed to create more new roles? (y/n)
The reason those aren't getting translated is that the Italian
translations have not been updated for 8.1 --- the entries in it.po
still look like the 8.0 wording:

#: createuser.c:170
msgid "Shall the new user be allowed to create databases? (y/n) "
msgstr "Il nuovo utente può creare database? (s/n)"

#: createuser.c:181
msgid "Shall the new user be allowed to create more new users? (y/n) "
msgstr "Il nuovo utente può creare altri utenti? (s/n)"

If this annoys you, please join the PG translation project and help to
fix it:
http://pgtranslation.projects.postgresql.org/

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
  #3  
Old   
Peter Eisentraut
 
Posts: n/a

Default Re: [BUGS] BUG #2632: createuser language poblem - 09-18-2006 , 04:46 PM



Tom Lane wrote:
Quote:
The reason those aren't getting translated is that the Italian
translations have not been updated for 8.1 --- the entries in it.po
still look like the 8.0 wording:
It might be possible with little effort to rework this so that the
prompts display the letters that are actually expected as answers.
I'll look into it.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
  #4  
Old   
Massimo Fidanza
 
Posts: n/a

Default Re: [BUGS] BUG #2632: createuser language poblem - 09-21-2006 , 03:46 AM



This message is in MIME format.

--=_5x5pbtclm0co
Content-Type: text/plain;
charset=ISO-8859-1;
DelSp="Yes";
format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Quoting Tom Lane <tgl (AT) sss (DOT) pgh.pa.us>:

Quote:
"Massimo Fidanza" <max (AT) massimofidanza (DOT) it> writes:
Hi, I discover a very annoying bug in the create user command. I have the
environment variable LANG=3Dit_IT.UTF-8 and when I try to crate a new us=
er wit
the create user command, at he prompt I have the three questions
Shall the new role be a superuser? (y/n)
Shall the new role be allowed to create databases? (y/n)
Shall the new role be allowed to create more new roles? (y/n)

The reason those aren't getting translated is that the Italian
translations have not been updated for 8.1 --- the entries in it.po
still look like the 8.0 wording:

#: createuser.c:170
msgid "Shall the new user be allowed to create databases? (y/n) "
msgstr "Il nuovo utente pu=F2 creare database? (s/n)"

#: createuser.c:181
msgid "Shall the new user be allowed to create more new users? (y/n) "
msgstr "Il nuovo utente pu=F2 creare altri utenti? (s/n)"

If this annoys you, please join the PG translation project and help to
fix it:
http://pgtranslation.projects.postgresql.org/

regards, tom lane

Yes, I can join the translation team and translate the missing strigs,=20=
=20
but I think this is not the right answer. I think the best solution is=20=
=20
to accept the english answer too.
I made a patch to common.c (src/bin/scripts/common.c) that compare the=20=
=20
user answer with the translated and the english affermative (y) and=20=20
negative (n) answer. I add a case insensitive comparison too.
I know that this can generate conflicts between languages, but looking=20=
=20
at the other languages in wich Postgresql is already translated there=20=20
are no conflict between english and non english languages. I look for=20=20
other languages too and I find a possible conflict with african=20=20
Swahili language, where the answers are (ndiyo=3D=3Dyes/kataa=3D=3Dno), but=
=20=20
they can for example specify (y/n) as (nd/k).

Bye Max!

--=_5x5pbtclm0co
Content-Type: text/plain;
charset=UTF-8;
name="common.c.diff"
Content-Disposition: attachment;
filename="common.c.diff"
Content-Transfer-Encoding: 7bit

--- common.c 2006-09-19 22:41:35.000000000 +0200
+++ common.c 2006-09-19 22:45:29.000000000 +0200
@@ -25,2 +25,5 @@

+#ifdef WIN32
+#define strcasecmp(s1,s2) lstrcmpiA((s1), (s2))
+#endif

@@ -208,5 +211,5 @@
{
- if (strcmp(string, _(PG_YESLETTER)) == 0)
+ if ((strcasecmp(string, _(PG_YESLETTER)) == 0) || (strcasecmp(string, "y") == 0))
return 1;
- else if (strcmp(string, _(PG_NOLETTER)) == 0)
+ else if ((strcasecmp(string, _(PG_NOLETTER)) == 0) || (strcasecmp(string, "n") == 0))
return 0;

--=_5x5pbtclm0co
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

--=_5x5pbtclm0co--



Reply With Quote
  #5  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2632: createuser language poblem - 09-21-2006 , 09:43 AM



Massimo Fidanza <max (AT) massimofidanza (DOT) it> writes:
Quote:
Yes, I can join the translation team and translate the missing strigs,=20=
=20
but I think this is not the right answer. I think the best solution is=20=
=20
to accept the english answer too.
I liked Peter's idea better (ie, not have the y/n in the
string-to-be-translated but generate it dynamically using the same
strings that will actually be matched to the input). Your approach
fails if there are any languages that use y or n in a way conflicting
with the English usage ... and whether or not we have any such
translations today, who knows what will be out there tomorrow?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.