diff options
Diffstat (limited to 'src/wx/wx_util.cc')
| -rw-r--r-- | src/wx/wx_util.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index aac35e97a..94a08f372 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -319,3 +319,21 @@ run_gui_loop () wxTheApp->Dispatch (); } } + +/** @param s String of the form Context|String + * @return translation, or String if no translation is available. + */ +wxString +context_translation (wxString s) +{ + wxString t = wxGetTranslation (s); + if (t == s) { + /* No translation; strip the context */ + int c = t.Find (wxT ("|")); + if (c != wxNOT_FOUND) { + t = t.Mid (c + 1); + } + } + + return t; +} |
