diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-08-09 02:17:04 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-08-17 12:59:25 +0200 |
| commit | dfa2f1418cc40b65068d2eb9431ab1d79247dbbf (patch) | |
| tree | 22db92df2100e7bb8b58c707a6909ae12f1d20bd | |
| parent | 9445fd4dfa58235f6f4a2badd6ba0305218b81a8 (diff) | |
Make context_translation take a char array.
| -rw-r--r-- | src/wx/wx_util.cc | 9 | ||||
| -rw-r--r-- | 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); |
