pg.ddx.io  pgsql-translators@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Law <exclusion@gmail.com>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: pgsql-translators@postgresql.org
Cc: Walter Willmertinger <willmis@gmail.com>
Subject: Re: Problem with error messages
Date: Thu, 21 Jul 2016 08:59:20 +0300
Message-ID: <579064B8.3060205@gmail.com> (raw)
In-Reply-To: <2177748d-ff90-535c-080c-5ee0f399f4af@2ndquadrant.com>
References: <CAHbMG0U0E_vOEwOwChrZ4Nq06xx5W7hdevwABo9uMjQ6urkZ3g@mail.gmail.com>
	<337ce77f-4159-0f43-cdb7-fcac30e3e219@2ndquadrant.com>
	<578F1B63.5000301@gmail.com>
	<2177748d-ff90-535c-080c-5ee0f399f4af@2ndquadrant.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-translators>


21.07.2016 02:45, Peter Eisentraut wrote:
> On 7/20/16 2:34 AM, Alexander Law wrote:
>> echo 'HINWEIS: Tabelle »mickeymouse« existiert nicht, wird übersprungen' | iconv -f UTF-8 -t ASCII//TRANSLIT
>> HINWEIS: Tabelle >>mickeymouse<< existiert nicht, wird ubersprungen
>>
>> Is much better and still better than to show untranslated message with
>> the notice about failed conversion.
> Right, but we don't have that functionality in PostgreSQL.  It would
> have to be implemented, and the transliteration tables provided.
>
It seems, that the gettext functionality could be used for that conversion.
I wrote a simple test:
     bindtextdomain("postgres-9.5","/usr/share/locale");
     bind_textdomain_codeset("postgres-9.5", "ASCII");
     textdomain("postgres-9.5");
     printf(gettext("table \"%s\" does not exist, skipping"), "missing");
It prints:
 >LANG=de_DE.UTF-8 ./testgettext
Tabelle ,,missing" existiert nicht, wird uebersprungenuser
Or with LATIN9:
LANG=de_DE.UTF-8 ./testgettext | iconv -f LATIN9
Tabelle »missing« existiert nicht, wird übersprungenuser

So if we know what encoding to use when translating the server messages, 
may be we should just specify it in bind_textdomain_codeset. I see that 
the server itself can have some different encoding for the logs (which 
is?), but may be it could be converted such way too.

Best regards,
Alexander


-- 
Sent via pgsql-translators mailing list (pgsql-translators@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-translators



view thread (6+ messages)  latest in thread

Message-ID: <579064B8.3060205@gmail.com>
Permalink:  ../579064B8.3060205@gmail.com/
Also on:    postgresql.org/message-id/579064B8.3060205@gmail.com

 · 

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-translators@postgresql.org
  Cc: exclusion@gmail.com, peter.eisentraut@2ndquadrant.com, willmis@gmail.com
  Subject: Re: Problem with error messages
  In-Reply-To: <579064B8.3060205@gmail.com>

* 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