Re: Change: l10n patch

Lists: pgadmin-hackers
From: Marek Černocký <marek(at)manet(dot)cz>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: l10n patch
Date: 2009-08-01 15:58:17
Message-ID: 1249142297.557.17.camel@zabiny
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

Hi,

I send patch. It solves translation for object type names in dialog
Grand Wizard.

Regards

Marek

Attachment Content-Type Size
gw.patch text/x-patch 867 bytes

From: Marek Černocký <marek(at)manet(dot)cz>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: Change: l10n patch
Date: 2009-08-01 17:00:56
Message-ID: 1249146056.11154.1.camel@zabiny
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

Oops! I now see there is prepared function for translanted object types
names. I send new patch instead previous.

Marek Černocký píše v So 01. 08. 2009 v 17:58 +0200:
> Hi,
>
> I send patch. It solves translation for object type names in dialog
> Grand Wizard.
>
>
> Regards
>
> Marek

Attachment Content-Type Size
gw.patch text/x-patch 849 bytes

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Marek Černocký <marek(at)manet(dot)cz>
Cc: pgadmin-hackers(at)postgresql(dot)org, Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Subject: Re: Change: l10n patch
Date: 2009-08-03 09:21:44
Message-ID: 937d27e10908030221k13bc4c4bs54ab2c19226ca175@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

2009/8/1 Marek Černocký <marek(at)manet(dot)cz>:
> Oops! I now see there is prepared function for translanted object types
> names. I send new patch instead previous.
>
> Marek Černocký píše v So 01. 08. 2009 v 17:58 +0200:
>> Hi,
>>
>> I send patch. It solves translation for object type names in dialog
>> Grand Wizard.

Hi,

Should there be some formatting in there to allow for languages where
the ordering of the type name and the object name may differ from
English?

Guillaume?

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Marek Černocký <marek(at)manet(dot)cz>, pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Change: l10n patch
Date: 2009-08-03 11:10:17
Message-ID: 200908031310.17802.guillaume@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

Le lundi 3 août 2009 à 11:21:44, Dave Page a écrit :
> 2009/8/1 Marek Černocký <marek(at)manet(dot)cz>:
> > Oops! I now see there is prepared function for translanted object types
> > names. I send new patch instead previous.
> >
> > Marek Černocký píše v So 01. 08. 2009 v 17:58 +0200:
> >> Hi,
> >>
> >> I send patch. It solves translation for object type names in dialog
> >> Grand Wizard.
>
> Hi,
>
> Should there be some formatting in there to allow for languages where
> the ordering of the type name and the object name may differ from
> English?
>
> Guillaume?

I tried this too, and it works AFAICT.

Not sure why, in some place we use the _ and in other places, we use
wxGetTranslation.

Apart from that, the code Marek wrote is looking good. I'll work on the
ordering in some time. Or perhaps Marek can work on this, if he agrees. I
don't know enough right know to have a good answer for you. Anyways, there are
other codes in pgadmin that looks like what Marek wrote, so I think we would
better apply his patch, and work on the ordering in a separate patch.

--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: Marek Černocký <marek(at)manet(dot)cz>, pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Change: l10n patch
Date: 2009-08-03 11:26:12
Message-ID: 937d27e10908030426l5eae7bb5m78debb075509051e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

On Mon, Aug 3, 2009 at 12:10 PM, Guillaume
Lelarge<guillaume(at)lelarge(dot)info> wrote:

> I tried this too, and it works AFAICT.
>
> Not sure why, in some place we use the _ and in other places, we use
> wxGetTranslation.

iirc, there is a reason, but I'm darned if I can remember what it it.
Of course, wxGetTranslation won't work well with the stringextract
scripts.

> Apart from that, the code Marek wrote is looking good. I'll work on the
> ordering in some time. Or perhaps Marek can work on this, if he agrees. I
> don't know enough right know to have a good answer for you. Anyways, there are
> other codes in pgadmin that looks like what Marek wrote, so I think we would
> better apply his patch, and work on the ordering in a separate patch.

OK - I'll leave this stuff in your capable hands then :-)

Thanks!

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


From: Marek Černocký <marek(at)manet(dot)cz>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-hackers(at)postgresql(dot)org, Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Subject: Re: Change: l10n patch
Date: 2009-08-03 14:01:31
Message-ID: 1249308091.27849.62.camel@zabiny
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

Dave Page píše v Po 03. 08. 2009 v 10:21 +0100:
> 2009/8/1 Marek Černocký <marek(at)manet(dot)cz>:
> > Oops! I now see there is prepared function for translanted object types
> > names. I send new patch instead previous.
> >
> > Marek Černocký píše v So 01. 08. 2009 v 17:58 +0200:
> >> Hi,
> >>
> >> I send patch. It solves translation for object type names in dialog
> >> Grand Wizard.
>
> Hi,
>
> Should there be some formatting in there to allow for languages where
> the ordering of the type name and the object name may differ from
> English?
>

You are right. For some languages may be better use some like:

wxString::Printf(
_("%s %s"),
(wxString)wxGetTranslation(obj->GetTypeName()),
obj->GetFullIdentifier()
)

But it solves only little part of more bigger problem which reported
here: http://code.pgadmin.org/trac/ticket/4

It has two solutions (Let's have real example "Cannot drop system %s %
s"):

--- 1. To leave it in translators

Right czech translation is "Nelze odstranit systémovou tabulku XXX"
(accusative case tabulkU). But it is substituted "Nelze odstranit
systemovou tabulka XXX" (Nominative case tabulkA).

I circumvent problem by other formulation in translation: "Nelze
odstranit systémový objekt: tabulka XXX" (= "Cannot drop system object:
%s %s").

Negative: It isn't universal solution. It's differnt laguage by
language.

--- 2. To split it to individual objekts

"Cannot drop system table %s"
"Cannot drop system function %s"
"Cannot drop system sequence %s"
...

Negative: There is much combinations which would increase quantities of
code.

Marek

> --
> Dave Page
> EnterpriseDB UK: http://www.enterprisedb.com
>


From: Marek Černocký <marek(at)manet(dot)cz>
To:
Cc: Guillaume Lelarge <guillaume(at)lelarge(dot)info>, pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Change: l10n patch
Date: 2009-08-03 14:29:57
Message-ID: 1249309797.27849.83.camel@zabiny
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

Dave Page píše v Po 03. 08. 2009 v 12:26 +0100:
> On Mon, Aug 3, 2009 at 12:10 PM, Guillaume
> Lelarge<guillaume(at)lelarge(dot)info> wrote:
>
> > I tried this too, and it works AFAICT.
> >
> > Not sure why, in some place we use the _ and in other places, we use
> > wxGetTranslation.

wxGetTranslation isn't passed by argument -k to xgettext in
stringextract script.

Macro _(s) do automatic cast with macro _T(s) before call
wxGetTranslation.

So _(s) is useful for constant strings, which should be extracted to
POT. And wxGetTranslation is useful for wxString variables (expressions
are extracted elsewher, e.g by N_(s) in structure).

>
> iirc, there is a reason, but I'm darned if I can remember what it it.
> Of course, wxGetTranslation won't work well with the stringextract
> scripts.
>
> > Apart from that, the code Marek wrote is looking good. I'll work on the
> > ordering in some time. Or perhaps Marek can work on this, if he agrees. I
> > don't know enough right know to have a good answer for you. Anyways, there are
> > other codes in pgadmin that looks like what Marek wrote, so I think we would
> > better apply his patch, and work on the ordering in a separate patch.
>
> OK - I'll leave this stuff in your capable hands then :-)
>
> Thanks!
>
> --
> Dave Page
> EnterpriseDB UK: http://www.enterprisedb.com
>