diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-06-22 21:11:18 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-06-22 21:11:18 +0100 |
| commit | f0edd6ab35c3c2b7800a26ec8206adab75e5f633 (patch) | |
| tree | aad6fc8ca2d932bcc630254e339fd648d8a10f50 /src/wx/wx_util.cc | |
| parent | 6d26c4afe1e2b63d346d311ceffe41bf8cb62572 (diff) | |
| parent | 14b1f672dc92ae8e1385c75e30420a4dcb4e32c9 (diff) | |
Merge master.
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; +} |
