Re: translating exception messages of postgresql functions

Поиск
Список
Период
Сортировка
От Julius Tuskenis
Тема Re: translating exception messages of postgresql functions
Дата
Msg-id 482B09DE.1040601@nsoft.lt
обсуждение исходный текст
Ответ на Re: translating exception messages of postgresql functions  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: translating exception messages of postgresql functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
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


В списке pgsql-admin по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: translating exception messages of postgresql functions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: translating exception messages of postgresql functions