From f71d2aeb382db5c28e7c5084054907409b7eb42e Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Sun, 18 Jul 2021 14:01:33 +0300 Subject: [PATCH] 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 --- libraries/lib-strings/TranslatableString.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/lib-strings/TranslatableString.cpp b/libraries/lib-strings/TranslatableString.cpp index 188541e2f..459cd2b90 100644 --- a/libraries/lib-strings/TranslatableString.cpp +++ b/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(