Hi.
As said in the title, it seems that wx.LANGUAGE_DEFAULT doesn’t really do its job on macOS.
Here is the code I’m using to initialize the wx.Locale var :
class MyApp(wx.App):
def OnInit(self):
..........
self.InitLanguage()
..........
def InitLanguage(self):
wx.Locale.AddCatalogLookupPathPrefix("./langs")
self._locale = wx.Locale()
if self._locale.Init(wx.LANGUAGE_DEFAULT):
print("Language initialized to " + self._locale.GetCanonicalName())
else:
print("Unable to initialize language to " + self._locale.GetCanonicalName())
self._locale.AddCatalog("mypofilename")
..........
The ‘Init’ call fails, so I obtain the second print line, but without any information of the language’s canonical name.
The ‘AddCatalog’ line works fine (my specific strings are correctly translated) but the wxWidgets default ones aren’t (for example, the menus labels, …)
If I replace ‘wx.LANGUAGE_DEFAULT’ by ‘wx.LANGUAGE_FRENCH’, all works fine.
But the goal is of course to use the system language.
This code works fine on Windows and on Linux, but not on macOS.
Did I missed something ?
Regards
Xav’