I18N in wxPython

Dear wxPython Usersgroup,

I just finished developing my first application in wxPython - it was fun!

I am looking for some hints as to how to migrate my application to
different languages. It is presently in English, and I would like to add
support for various European languages as well as Hebrew which reads
right to left.
I am using Python 2.4 and wxPython 2.5.3 with Unicode.

If possible, please send me a few examples or pointers to examples for
how to get foreign language text into menus, notebook labels, buttons,
simple StaticText labels on panels, etc.

Thanks very much in advance,
Victor Elkind
gvsi@bigfoot.com

···

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.8 - Release Date: 1/3/2005

http://wiki.wxpython.org/index.cgi/RecipesI18n

would be a good place to start.

David

···

-----Original Message-----
From: Avraham Victor Elkind [mailto:pstllc@netvision.net.il]
Sent: Thursday, January 06, 2005 9:22 AM
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] I18N in wxPython

Dear wxPython Usersgroup,

I just finished developing my first application in wxPython - it was fun!

I am looking for some hints as to how to migrate my application to
different languages. It is presently in English, and I would like to add
support for various European languages as well as Hebrew which reads
right to left.
I am using Python 2.4 and wxPython 2.5.3 with Unicode.

If possible, please send me a few examples or pointers to examples for
how to get foreign language text into menus, notebook labels, buttons,
simple StaticText labels on panels, etc.

Thanks very much in advance,
Victor Elkind
gvsi@bigfoot.com

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.8 - Release Date: 1/3/2005

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

use gettext module - there is a very simple explanation in
the wiki
http://wiki.wxpython.org

also you have to quote your strings:
"name" will become _("name")

create a .pot file - get it translated and compile it using
msgfmt to a .mo file

···

On Thursday 06 Jan 2005 8:51 pm, Avraham Victor Elkind wrote:

Dear wxPython Usersgroup,

I just finished developing my first application in
wxPython - it was fun!

I am looking for some hints as to how to migrate my
application to different languages. It is presently in
English, and I would like to add support for various
European languages as well as Hebrew which reads right to
left.
I am using Python 2.4 and wxPython 2.5.3 with Unicode.

If possible, please send me a few examples or pointers to
examples for how to get foreign language text into menus,
notebook labels, buttons, simple StaticText labels on
panels, etc.

--
regards
kg

tally ho! http://avsap.sourceforge.net

I'm using wxpython unicode version, and i'm trying to use the i18n as explained in that page too, but once test the application i
get unicode errors (using languages with accented chars like french spanish and italian)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6: ordinal not in range(128)

I don't know exactly how does the unicode param works here:
gettext.install('i18ntest', './locale', unicode=False)
In fact i try also set it to true, but nothing changed.

Alessandro Crugnola - sephiroth

···

---------------------------------------------
Macromedia Flash Team Volunteer
http://www.macromedia.com/go/team
Flash && PHP developer
alessandro@sephiroth.it

*relax with SEPY http://www.sf.net/projects/sepy
---------------------------------------------

::-----Original Message-----
::From: Kenneth Gonsalves [mailto:lawgon@thenilgiris.com]
::Sent: venerdì 7 gennaio 2005 13.00
::To: wxPython-users@lists.wxwidgets.org
::Subject: Re: [wxPython-users] I18N in wxPython
::
::On Thursday 06 Jan 2005 8:51 pm, Avraham Victor Elkind
::wrote:
::> Dear wxPython Usersgroup,
::>
::> I just finished developing my first application in wxPython
::- it was
::> fun!
::>
::> I am looking for some hints as to how to migrate my application to
::> different languages. It is presently in English, and I
::would like to
::> add support for various European languages as well as Hebrew which
::> reads right to left.
::> I am using Python 2.4 and wxPython 2.5.3 with Unicode.
::>
::> If possible, please send me a few examples or pointers to
::examples for
::> how to get foreign language text into menus, notebook
::labels, buttons,
::> simple StaticText labels on panels, etc.
::
::use gettext module - there is a very simple explanation in
::the wiki http://wiki.wxpython.org
::
::also you have to quote your strings:
::"name" will become _("name")
::
::create a .pot file - get it translated and compile it using
::msgfmt to a .mo file
::--
::regards
::kg
::
::tally ho! http://avsap.sourceforge.net
::
::---------------------------------------------------------------------
::To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
::For additional commands, e-mail:
::wxPython-users-help@lists.wxwidgets.org
::

Alessandro Crugnola *sephiroth* wrote:

I'm using wxpython unicode version, and i'm trying to use the i18n as explained in that page too, but once test the application i
get unicode errors (using languages with accented chars like french spanish and italian)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6: ordinal not in range(128)

See this page for some explaination for the reasons this happens:

http://wiki.wxpython.org/index.cgi/UnicodeBuild

I don't know exactly how does the unicode param works here:
gettext.install('i18ntest', './locale', unicode=False)
In fact i try also set it to true, but nothing changed.

You may want to try just using the wxWidgets i18n features as then messages pulled from the catalog will already be unicode. Use wx.Locale to set the locale, add catalogs, etc. and set the "_" function to wx.GetTranslation.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

say you have code like this:

"Confirm save of %s" %(name)

this will give the error. do this:
"Confirm save of %s" %(name.encode('utf-8'))

should work

···

On Friday 07 Jan 2005 4:27 pm, Alessandro Crugnola *sephiroth* wrote:

I'm using wxpython unicode version, and i'm trying to use the i18n
as explained in that page too, but once test the application i get
unicode errors (using languages with accented chars like french
spanish and italian) UnicodeDecodeError: 'ascii' codec can't decode
byte 0xc3 in position 6: ordinal not in range(128)

--
regards
kg

tally ho! http://avsap.sourceforge.net

is this in 2.4 ?

···

On Friday 07 Jan 2005 11:46 pm, Robin Dunn wrote:

You may want to try just using the wxWidgets i18n features as then
messages pulled from the catalog will already be unicode. Use
wx.Locale to set the locale, add catalogs, etc. and set the "_"
function to wx.GetTranslation.

--
regards
kg

tally ho! http://avsap.sourceforge.net