+
+#if wxUSE_FONTMAP
+ // first look for the catalog for this language and the current locale:
+ // notice that we don't use the system name for the locale as this would
+ // force us to install catalogs in different locations depending on the
+ // system but always use the canonical name
+ wxFontEncoding encSys = wxLocale::GetSystemEncoding();
+ if ( encSys != wxFONTENCODING_SYSTEM )
+ {
+ wxString fullname(lang);
+ fullname << wxS('.') << wxFontMapperBase::GetEncodingName(encSys);
+
+ if ( m_loader->LoadCatalog(this, domain, fullname) )
+ return true;
+ }
+#endif // wxUSE_FONTMAP
+
+ // Next try: use the provided name language name:
+ if ( m_loader->LoadCatalog(this, domain, lang) )
+ return true;
+
+ // Also try just base locale name: for things like "fr_BE" (Belgium
+ // French) we should use fall back on plain "fr" if no Belgium-specific
+ // message catalogs exist
+ if ( lang.length() > LEN_LANG && lang[LEN_LANG] == wxS('_') )
+ {
+ if ( m_loader->LoadCatalog(this, domain, ExtractLang(lang)) )
+ return true;
+ }
+
+ // Nothing worked, the catalog just isn't there
+ wxLogTrace(TRACE_I18N,
+ "Catalog \"%s.mo\" not found for language \"%s\".",
+ domain, lang);
+ return false;