application in multiple languages

Hi,

Thanks David , yes I am using the unicode version of wxPython…

Thanks Kevin I was working on the wiki pages u mentioned , I was able to create the pot , copied it to po file and compile to mo file … but I am getting error

in my application…

Traceback (most recent call last):

File “docBoxApp.py”, line 94, in ?

main()

File “docBoxApp.py”, line 58, in main

application = BoaApp(0)

File “C:\Python23\lib\site-packages\wx-2.6-msw-unicode\wx_core.py”, line 7473, in init

self._BootstrapApp()

File “C:\Python23\lib\site-packages\wx-2.6-msw-unicode\wx_core.py”, line 7125, in _BootstrapApp

return core.PyApp__BootstrapApp(*args, **kwargs)

File “docBoxApp.py”, line 20, in OnInit

self.startup()

File “docBoxApp.py”, line 32, in startup

self.main = mainFrame.create(None)

File “D:\Thomas\development\python\DocsBoxWidget-v2\gui\mainFrame.py”, line 52, in create

return Frame1(parent)

File “D:\Thomas\development\python\DocsBoxWidget-v2\gui\mainFrame.py”, line 1713, in init

[mylocale.GetCanonicalName()], fallback = True)

File “c:\Python23\lib\gettext.py”, line 416, in translation

t = translations.setdefault(key, class(open(mofile, ‘rb’)))

File “c:\Python23\lib\gettext.py”, line 176, in init

self._parse(fp)

File “c:\Python23\lib\gettext.py”, line 304, in _parse

tmsg = unicode(tmsg, self._charset)

LookupError: unknown encoding: CHARSET

----------------this how my po files looks---------------------

SOME DESCRIPTIVE TITLE.

Copyright © YEAR THE PACKAGE’S COPYRIGHT HOLDER

This file is distributed under the same license as the PACKAGE package.

FIRST AUTHOR EMAIL@ADDRESS, YEAR.

···

#, fuzzy
msgid “”
msgstr “”
“Project-Id-Version: PACKAGE VERSION\n”
“Report-Msgid-Bugs-To: \n”
“POT-Creation-Date: 2006-01-16 15:37+1300\n”
“PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n”
“Last-Translator: FULL NAME EMAIL@ADDRESS\n”
“Language-Team: LANGUAGE LL@li.org\n”
“MIME-Version: 1.0\n”
“Content-Type: text/plain; charset=CHARSET\n”
“Content-Transfer-Encoding: 8bit\n”

#: gui/mainFrame.py:837
msgid “Browse”
msgstr “Browseita”

#: gui/mainFrame.py:839
msgid “Download”
msgstr “Downloadita”

#: gui/mainFrame.py:841
msgid “Search”
msgstr “Searchita”

thanks

Thomas Thomas

Hi Thomas,

Thomas Thomas wrote:


tmsg = unicode(tmsg,
self._charset)

LookupError: unknown encoding:
CHARSET

“Content-Type: text/plain; charset=CHARSET\n”

I would guess it is the above line in your po file which causes the
problem. Shouldn’t that be e.g. utf-8 or similar?

I attached a small sample I18n app, just a frame with a few strings to
translate.

I am currently still on ANSI wxPython, so I don’t know if this works as
is on the Unicode version.

See you

Werner

P.S. the translation files are created with PoEdit and the encoding
used is iso-8859-1

i18n.zip (5.02 KB)