Re: Localization not working with zh_CH - AddCatalog() returns false
Scott Talbert <[email protected]>
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 14 May 2020, Ryan Holmes wrote: > 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 3from 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.Translation > s.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? I don't think your sample application is doing what you think it does. AddCatalog isn't being called when you change the combobox. It's only being called at startup. Scott -- 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/alpine.DEB.2.21.2005150952010.21015%40bear.techie.net.