I have finally realized the need to implement internationalization in my application, so I set up gettext. However, I am getting an error when I try running my application.
Traceback (most recent call last):
File “C:\Saketh\source\Notalon\Notalon.py”, line 36, in ?
self.lan_en = gettext.translation(‘Notalon’, ‘./locale’, languages=[‘en’])
File “C:\Python24\lib\gettext.py”, line 456, in translation
raise IOError(ENOENT, 'No translation file found for domain', domain)
IOError: [Errno 2] No translation file found for domain: ‘Notalon’
I think this is because the mki18n.py does not generate the English translation MO files for some reason. Even when I use python mki18n.py -m -e (and there is a Notalon_en_EN.po file), the English translation is not generated. French files are generated fine, though.
Here’s the important part of my code:
gettext.install(‘Notalon’, ‘./locale’, unicode=True)
self.lan_en = gettext.translation(‘Notalon’, ‘./locale’, languages=[‘en’])
self.lan_fr = gettext.translation(‘Notalon’, ‘./locale’, languages=[‘fr’])
self.lan_en.install
()
Would it work if I used the wx interface to gettext? I would have been able to figure out what’s going on if the French files weren’t generated. But since they are, I am unable to narrow down the problem.
I’m probably going to have many problems with i18n, so please bear with me…thanks!