Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 89D312E0086 for ; Wed, 14 May 2008 13:32:45 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 87415-06-3 for ; Wed, 14 May 2008 13:32:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id D33782E0072 for ; Wed, 14 May 2008 13:32:23 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m4EGWJtN021000; Wed, 14 May 2008 12:32:20 -0400 (EDT) To: Julius Tuskenis cc: Alvaro Herrera , pgsql-admin@postgresql.org Subject: Re: translating exception messages of postgresql functions In-reply-to: <482B09DE.1040601@nsoft.lt> References: <482AF7F7.5090309@nsoft.lt> <20080514144627.GD5521@alvh.no-ip.org> <482B03B0.8060206@nsoft.lt> <20080514153337.GI5521@alvh.no-ip.org> <482B09DE.1040601@nsoft.lt> Comments: In-reply-to Julius Tuskenis message dated "Wed, 14 May 2008 18:48:46 +0300" Date: Wed, 14 May 2008 12:32:19 -0400 Message-ID: <20999.1210782739@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/122 X-Sequence-Number: 29206 Julius Tuskenis writes: > Alvaro Herrera rašė: >> You want to translate it from english to another language, or you want >> to change the nature of the message reported? If you just want to >> translate it to another language, see here: >> >> http://pgtranslation.projects.postgresql.org/status.html >> > Thank you, Alvaro, but it seems you have slightly misunderstood me. I > want to translate the exceptions I rise myself. That is I do RAISE > EXCEPT 'user "%" not found', prm_user; in pl/pgsql function, but I want > the user to see it translated to the language he uses. I wonder if it would help to make plpgsql pass the RAISE format string through gettext? This would only be a usable approach if there were some fairly easy way to add installation-specific translations to gettext's table. I don't know enough about gettext to know if that's doable. regards, tom lane