pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julius Tuskenis <julius@nsoft.lt>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: translating exception messages of postgresql functions
Date: Wed, 14 May 2008 18:48:46 +0300
Message-ID: <482B09DE.1040601@nsoft.lt> (raw)
In-Reply-To: <20080514153337.GI5521@alvh.no-ip.org>
References: <482AF7F7.5090309@nsoft.lt>
	<20080514144627.GD5521@alvh.no-ip.org>
	<482B03B0.8060206@nsoft.lt>
	<20080514153337.GI5521@alvh.no-ip.org>

Alvaro Herrera rašė:
> Julius Tuskenis wrote:
>
>   
>> I want to translate the exception message. For example I raise an  
>> exception in pg function like RAISE EXCEPTION 'my exception', then in my  
>> application that calls the function I catch the exception. But before I  
>> show it to the user of application I have to translate it. How do I know  
>> what exception it is? As Tom Lane answered - the only way is to rely on  
>> message text.
>>     
>
> 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. Using whole error 
message is inconvenient because the application gets 'user "Peter" not 
found' or 'user "John" not found' - not 'user "%" not found'. Thats 
where the problem is.

-- 
Julius Tuskenis
Programavimo skyriaus vadovas
UAB nSoft
mob. +37068233050




view thread (8+ messages)  latest in thread

Message-ID: <482B09DE.1040601@nsoft.lt>
Permalink:  ../482B09DE.1040601@nsoft.lt/
Also on:    postgresql.org/message-id/482B09DE.1040601@nsoft.lt

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: julius@nsoft.lt, alvherre@commandprompt.com
  Subject: Re: translating exception messages of postgresql functions
  In-Reply-To: <482B09DE.1040601@nsoft.lt>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox