From dfa2f1418cc40b65068d2eb9431ab1d79247dbbf Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 9 Aug 2024 02:17:04 +0200 Subject: Make context_translation take a char array. --- src/wx/wx_util.cc | 9 +++++---- src/wx/wx_util.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 7f16760e0..481ff9447 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -554,10 +554,11 @@ wx_get (wxSpinCtrlDouble* w) * @return translation, or String if no translation is available. */ wxString -context_translation (wxString s) +context_translation(char const* s) { - auto t = wxGetTranslation (s); - if (t == s) { + auto wx_s = char_to_wx(s); + auto t = wxGetTranslation(wx_s); + if (t == wx_s) { /* No translation; strip the context */ int c = t.Find (wxT ("|")); if (c != wxNOT_FOUND) { @@ -619,7 +620,7 @@ maybe_show_splash () { /* This wxMemoryDC must be destroyed before bitmap can be used elsewhere */ wxMemoryDC dc(bitmap); - auto const version = wxString::Format("%s (%s)", dcpomatic_version, dcpomatic_git_commit); + auto const version = wxString::Format(char_to_wx("%s (%s)"), std_to_wx(dcpomatic_version), std_to_wx(dcpomatic_git_commit)); auto screen_size = dc.GetSize(); auto text_size = dc.GetTextExtent(version); dc.DrawText(version, (screen_size.GetWidth() - text_size.GetWidth()) / 2, 236); diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h index 51a46d307..6a57b3262 100644 --- a/src/wx/wx_util.h +++ b/src/wx/wx_util.h @@ -110,7 +110,7 @@ extern wxString std_to_wx (std::string); extern wxString char_to_wx(char const* s); extern void dcpomatic_setup_i18n (); -extern wxString context_translation (wxString); +extern wxString context_translation(char const* s); extern std::string string_client_data (wxClientData* o); extern wxString time_to_timecode (dcpomatic::DCPTime t, double fps); extern void setup_audio_channels_choice (wxChoice* choice, int minimum); -- cgit v1.2.3