From: | Alexander Law <exclusion(at)gmail(dot)com> |
---|---|
To: | Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-translators(at)postgresql(dot)org |
Cc: | Walter Willmertinger <willmis(at)gmail(dot)com> |
Subject: | Re: Problem with error messages |
Date: | 2016-07-21 05:59:20 |
Message-ID: | 579064B8.3060205@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-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
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2016-07-25 16:50:30 | Re: Problem with error messages |
Previous Message | Peter Eisentraut | 2016-07-20 23:45:02 | Re: Problem with error messages |