Hi Mattia,
> > 15:47:08: Error: Cannot set locale to 'de_DE'. > > > > This gets written out 20 times ( possibly linked to the number of > > components doing relocale stuff - I really don't know ). > > > > I'm not sure where this is happening, ie, if it's a Wx output, or a > > Padre output, grepping for "Cannot set locale" through Padre's source > > doesn't reveal a line, so I'm wondering if it's a problem that Wx is > > reporting. > > It's wxWidgets' output. Thanks. The code fragment that causes this is: my $locale = Wx::Locale->new($lang); unless ( $locale->IsLoaded($id) ) { $locale->AddCatalogLookupPathPrefix( Padre::Util::sharedir('locale') ); my $file = Padre::Util::sharefile( 'locale', $id ) . '.mo'; $locale->AddCatalog($id) if -f $file; } Where $lang is the Wx Language ID value. Reading through the doco, the API will: "Add a catalog for use with the current locale: it is searched for in standard places (current directory first, then the system one), but you may also prepend additional directories to the search path with AddCatalogLookupPathPrefix()." Which given that the language files won't be in the standard places, wxWidgets throws the warning. So what we need to do is set the CatalogLookupPathPrefix before setting the language. However it seems that Wx::Locale->new() requires one parameter. I'm not sure if this is correct, but it does seem to address the matter of the warning: my $locale = Wx::Locale->new(undef); $locale->AddCatalogLookupPathPrefix( Padre::Util::sharedir('locale') ); my $file = Padre::Util::sharefile( 'locale', $id ) . '.mo'; $locale->AddCatalog($id) if -f $file; By creating new with a 'null' I can create the locale object, and then set the Path and then the language file if it exists. Is this correct? > > > Also, while reading through the docs on Locale stuff I came across this: > > > > bool AddCatalog(const char *szDomain) > > > > Now in perl, when I do something like this: > > > > my $ok = $locale->AddCatalog("$prefix-$code"); > > > > $ok, should have 1 if successful? > > Looking at the source code, it should return true if it finds and > loads the .mo file. > > > in my tests, this doesn't appear to be the case. > > You mean it returns false even if successful, or true when unsuccessful? > It's returning what it should based on further experimenting. Thanks, Peter.