Re: Localization not working with zh_CH - AddCatalog() returns false
Scott Talbert <[email protected]>
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <[email protected]> |
My bad, I didn't see the part about restarting the application. I do see the same behavior now. On Fri, 15 May 2020, Ryan Holmes wrote: > I'm aware of that, and that's fine. When you change the combo box, it saves > that preference to be used at the next start up (AFAIK, you can't change the > locale mid-session, and this is fine for me). I note this in the OP: > Select French in the drop down and restart the application. Now > the title says "Sample Title Text French" as expected. > > > So the issue is still that, when you select Chinese as the language, and > restart the application, it shows the English title, and this is because the > catalog failed to load. Thats the crux of the issue - why is the zh_CH > catalog failing to load? > > Thanks, > Ryan > > On Friday, May 15, 2020 at 9:54:06 AM UTC-4, Scott Talbert wrote: > 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 Sample3from https://wiki.wxpython.org/Internationalization%20-%20i18n%20%28Phoeni > x > > %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 thedocumentation(https://wxpython.org/Phoenix/docs/html/wx.Translations.html#w > x.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 visithttps://groups.google.com/d/msgid/wxpython-users/ce95fc00-48f2-4d13-8699-1e > ba73dcccbe%40googlegroups.com. > > -- 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.2005152332170.7238%40bear.techie.net.