diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-06-21 14:52:30 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-06-21 14:52:30 +0100 |
| commit | dd2685423e9a2800a9ea6821c361a6b851ff759e (patch) | |
| tree | a180a7bbc61ec90ec1bb97fac3b3781a50d80ac3 /src/wx/wx_util.cc | |
| parent | 7dd06cc89e018bfec3cbe802495bf7dee137a71f (diff) | |
Some missing i18n markup. Add S_ macro to allow contextual translations. Add updates to de_DE from Carsten Kurz. Merge pot files.
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 b73cd490d..218a786b2 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; +} |
