+
+// ----------------------------------------------------------------------------
+// wxResourceTranslationsLoader
+// ----------------------------------------------------------------------------
+
+#ifdef __WINDOWS__
+bool wxResourceTranslationsLoader::LoadCatalog(wxTranslations *translations,
+ const wxString& domain,
+ const wxString& lang)
+{
+
+ const void *mo_data = NULL;
+ size_t mo_size = 0;
+
+ const wxString resname = wxString::Format("%s_%s", domain, lang);
+
+ if ( !wxLoadUserResource(&mo_data, &mo_size,
+ resname,
+ GetResourceType(),
+ GetModule()) )
+ return false;
+
+ wxLogTrace(TRACE_I18N,
+ "Using catalog from Windows resource \"%s\".", resname);
+
+ const bool ok = translations->LoadCatalogData(
+ wxCharBuffer::CreateNonOwned(static_cast<const char*>(mo_data), mo_size));
+ if ( !ok )
+ wxLogWarning(_("Resource '%s' is not a valid message catalog."), resname);
+
+ return ok;
+}
+#endif // __WINDOWS__
+
+