Improve translations lookup logging.
Log match directory in GetAvailableTranslations(). Log search paths with one directory per line, for better readability when debugging. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -101,6 +101,13 @@ void LogTraceArray(const char *prefix, const wxArrayString& arr)
|
|||||||
wxLogTrace(TRACE_I18N, "%s: [%s]", prefix, wxJoin(arr, ','));
|
wxLogTrace(TRACE_I18N, "%s: [%s]", prefix, wxJoin(arr, ','));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LogTraceLargeArray(const char *prefix, const wxArrayString& arr)
|
||||||
|
{
|
||||||
|
wxLogTrace(TRACE_I18N, "%s:", prefix);
|
||||||
|
for ( wxArrayString::const_iterator i = arr.begin(); i != arr.end(); ++i )
|
||||||
|
wxLogTrace(TRACE_I18N, " %s", *i);
|
||||||
|
}
|
||||||
|
|
||||||
// Use locale-based detection as a fallback
|
// Use locale-based detection as a fallback
|
||||||
wxString GetPreferredUILanguageFallback(const wxArrayString& WXUNUSED(available))
|
wxString GetPreferredUILanguageFallback(const wxArrayString& WXUNUSED(available))
|
||||||
{
|
{
|
||||||
@@ -1871,8 +1878,11 @@ wxMsgCatalog *wxFileTranslationsLoader::LoadCatalog(const wxString& domain,
|
|||||||
{
|
{
|
||||||
wxString searchPath = GetFullSearchPath(lang);
|
wxString searchPath = GetFullSearchPath(lang);
|
||||||
|
|
||||||
wxLogTrace(TRACE_I18N, wxS("Looking for \"%s.mo\" in search path \"%s\""),
|
LogTraceLargeArray
|
||||||
domain, searchPath);
|
(
|
||||||
|
wxString::Format("looking for \"%s.mo\" in search path", domain),
|
||||||
|
wxSplit(searchPath, wxPATH_SEP[0])
|
||||||
|
);
|
||||||
|
|
||||||
wxFileName fn(domain);
|
wxFileName fn(domain);
|
||||||
fn.SetExt(wxS("mo"));
|
fn.SetExt(wxS("mo"));
|
||||||
@@ -1894,9 +1904,11 @@ wxArrayString wxFileTranslationsLoader::GetAvailableTranslations(const wxString&
|
|||||||
wxArrayString langs;
|
wxArrayString langs;
|
||||||
const wxArrayString prefixes = GetSearchPrefixes();
|
const wxArrayString prefixes = GetSearchPrefixes();
|
||||||
|
|
||||||
wxLogTrace(TRACE_I18N,
|
LogTraceLargeArray
|
||||||
"looking for available translations of \"%s\" in search path \"%s\"",
|
(
|
||||||
domain, wxJoin(prefixes, wxPATH_SEP[0]));
|
wxString::Format("looking for available translations of \"%s\" in search path", domain),
|
||||||
|
prefixes
|
||||||
|
);
|
||||||
|
|
||||||
for ( wxArrayString::const_iterator i = prefixes.begin();
|
for ( wxArrayString::const_iterator i = prefixes.begin();
|
||||||
i != prefixes.end();
|
i != prefixes.end();
|
||||||
@@ -1923,7 +1935,8 @@ wxArrayString wxFileTranslationsLoader::GetAvailableTranslations(const wxString&
|
|||||||
#endif // __WXOSX__
|
#endif // __WXOSX__
|
||||||
|
|
||||||
wxLogTrace(TRACE_I18N,
|
wxLogTrace(TRACE_I18N,
|
||||||
"found %s translation of \"%s\"", lang, domain);
|
"found %s translation of \"%s\" in %s",
|
||||||
|
lang, domain, langdir);
|
||||||
langs.push_back(lang);
|
langs.push_back(lang);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user