Localization not working with zh_CH - AddCatalog() returns false

Ryan Holmes <[email protected]>
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
Hi all,

I'm having a peculiar issue with attempting to load a zh_CH (Chinese - 
Simplified) locale with wx's built in functionality. Please see the 
attachment for the sample application. 

Run wxLocale.py. It's a slimmed down version of Sample 3 from 
https://wiki.wxpython.org/Internationalization%20-%20i18n%20%28Phoenix%29 When 
it loads, you'll see the header text show "Sample Title Text English". 
Select French in the drop down and restart the application. Now the title 
says "Sample Title Text French" as expected. Then select Deutsche - same 
thing.

When Chinese is selected, the title spits out the English title. I've 
tracked down a possible reason here on line 164:

self.locale.self.locale.AddCatalog(langDomain)


That function returns false. According to the documentation (
https://wxpython.org/Phoenix/docs/html/wx.Translations.html#wx.Translations.AddCatalog), 
this "might mean that the catalog is not found or that it isn’t in the 
correct format", but it doesn't go into any more detail.

That being said, if you run getTextLocale.py (which usees the gettext 
module directly), you'll see it printing out the expected Chinese 
translation: "Sample Title Text Chinese - Simplified", so the file itself 
seems to be proper.

Any ideas on what to try next for troubleshooting?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/95ebc9e5-f80c-488e-a2e7-0e85f01306fe%40googlegroups.com.
locale_test.zip (application/zip, 6.5 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.