Browse Source

TranslatableString: Make compatible with wx3.0

wxWidgets 3.0 doesn't support context in wxGetTranslation yet, so don't
use the context, similar to existing DoChooseFormat handling.
This will lead to some untranslated strings or wrong context translations
(if we have equal strings that one specifies the context, but the other
doesn't), which isn't great, but better than not being able to compile
the application at all against a stable wxWidgets library version.

Signed-off-by: Mart Raudsepp <leio@gentoo.org>
pull/300/head
Mart Raudsepp 2 years ago
parent
commit
f71d2aeb38
  1. 7
      libraries/lib-strings/TranslatableString.cpp

7
libraries/lib-strings/TranslatableString.cpp

@ -97,7 +97,12 @@ wxString TranslatableString::DoSubstitute( const Formatter &formatter,
return formatter
? formatter( format, debug ? Request::DebugFormat : Request::Format )
: // come here for most translatable strings, which have no formatting
( debug ? format : wxGetTranslation( format, wxString{}, context ) );
( debug ? format : wxGetTranslation(
format
#if HAS_I18N_CONTEXTS
, wxString{}, context
#endif
) );
}
wxString TranslatableString::DoChooseFormat(

Loading…
Cancel
Save