diff options
author | bubnikv <bubnikv@gmail.com> | 2020-03-23 20:51:10 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2020-03-23 21:20:54 +0300 |
commit | 580d739d6f377fcf76456051e1816aae2fb35bad (patch) | |
tree | 9c266d187679ba812cd0bc132ffc27fc36ab3c5c /src/slic3r/GUI/I18N.hpp | |
parent | 22d9fcb27f0fba76e4fffe86fde4034ea0b8e32f (diff) | |
parent | d5bcddeed333e6be567de517bc22c69fc5559b7e (diff) |
Merging version_2.2.0 final into stable
Merge commit 'd5bcddeed333e6be567de517bc22c69fc5559b7e' into stable
Diffstat (limited to 'src/slic3r/GUI/I18N.hpp')
-rw-r--r-- | src/slic3r/GUI/I18N.hpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/slic3r/GUI/I18N.hpp b/src/slic3r/GUI/I18N.hpp index bf3103f77..25e46930b 100644 --- a/src/slic3r/GUI/I18N.hpp +++ b/src/slic3r/GUI/I18N.hpp @@ -1,10 +1,12 @@ #ifndef _ -#define _(s) Slic3r::GUI::I18N::translate((s)) +#define _(s) Slic3r::GUI::I18N::translate((s)) +#define _L(s) Slic3r::GUI::I18N::translate((s)) #define _utf8(s) Slic3r::GUI::I18N::translate_utf8((s)) +#define _u8L(s) Slic3r::GUI::I18N::translate_utf8((s)) #endif /* _ */ #ifndef _CTX -#define _CTX(s, ctx) Slic3r::GUI::I18N::translate((s), (ctx)) +#define _CTX(s, ctx) Slic3r::GUI::I18N::translate((s), (ctx)) #define _CTX_utf8(s, ctx) Slic3r::GUI::I18N::translate_utf8((s), (ctx)) #endif /* _ */ @@ -40,21 +42,25 @@ namespace I18N { inline wxString translate(const wchar_t *s) { return wxGetTranslation(s); } inline wxString translate(const std::string &s) { return wxGetTranslation(wxString(s.c_str(), wxConvUTF8)); } inline wxString translate(const std::wstring &s) { return wxGetTranslation(s.c_str()); } + inline wxString translate(const wxString &s) { return wxGetTranslation(s); } inline wxString translate(const char *s, const char *plural, unsigned int n) { return wxGetTranslation(wxString(s, wxConvUTF8), wxString(plural, wxConvUTF8), n); } inline wxString translate(const wchar_t *s, const wchar_t *plural, unsigned int n) { return wxGetTranslation(s, plural, n); } inline wxString translate(const std::string &s, const std::string &plural, unsigned int n) { return wxGetTranslation(wxString(s.c_str(), wxConvUTF8), wxString(plural.c_str(), wxConvUTF8), n); } inline wxString translate(const std::wstring &s, const std::wstring &plural, unsigned int n) { return wxGetTranslation(s.c_str(), plural.c_str(), n); } + inline wxString translate(const wxString &s, const wxString &plural, unsigned int n) { return wxGetTranslation(s, plural, n); } inline std::string translate_utf8(const char *s) { return wxGetTranslation(wxString(s, wxConvUTF8)).ToUTF8().data(); } inline std::string translate_utf8(const wchar_t *s) { return wxGetTranslation(s).ToUTF8().data(); } inline std::string translate_utf8(const std::string &s) { return wxGetTranslation(wxString(s.c_str(), wxConvUTF8)).ToUTF8().data(); } inline std::string translate_utf8(const std::wstring &s) { return wxGetTranslation(s.c_str()).ToUTF8().data(); } + inline std::string translate_utf8(const wxString &s) { return wxGetTranslation(s).ToUTF8().data(); } inline std::string translate_utf8(const char *s, const char *plural, unsigned int n) { return translate(s, plural, n).ToUTF8().data(); } inline std::string translate_utf8(const wchar_t *s, const wchar_t *plural, unsigned int n) { return translate(s, plural, n).ToUTF8().data(); } inline std::string translate_utf8(const std::string &s, const std::string &plural, unsigned int n) { return translate(s, plural, n).ToUTF8().data(); } inline std::string translate_utf8(const std::wstring &s, const std::wstring &plural, unsigned int n) { return translate(s, plural, n).ToUTF8().data(); } + inline std::string translate_utf8(const wxString &s, const wxString &plural, unsigned int n) { return translate(s, plural, n).ToUTF8().data(); } #if wxCHECK_VERSION(3, 1, 1) #define _wxGetTranslation_ctx(S, CTX) wxGetTranslation((S), wxEmptyString, (CTX)) @@ -66,11 +72,13 @@ namespace I18N { inline wxString translate(const wchar_t *s, const char* ctx) { return _wxGetTranslation_ctx(s, ctx); } inline wxString translate(const std::string &s, const char* ctx) { return _wxGetTranslation_ctx(wxString(s.c_str(), wxConvUTF8), ctx); } inline wxString translate(const std::wstring &s, const char* ctx) { return _wxGetTranslation_ctx(s.c_str(), ctx); } + inline wxString translate(const wxString &s, const char* ctx) { return _wxGetTranslation_ctx(s, ctx); } - inline wxString translate_utf8(const char *s, const char* ctx) { return _wxGetTranslation_ctx(wxString(s, wxConvUTF8), ctx).ToUTF8().data(); } - inline wxString translate_utf8(const wchar_t *s, const char* ctx) { return _wxGetTranslation_ctx(s, ctx).ToUTF8().data(); } - inline wxString translate_utf8(const std::string &s, const char* ctx) { return _wxGetTranslation_ctx(wxString(s.c_str(), wxConvUTF8), ctx).ToUTF8().data(); } - inline wxString translate_utf8(const std::wstring &s, const char* ctx) { return _wxGetTranslation_ctx(s.c_str(), ctx).ToUTF8().data(); } + inline std::string translate_utf8(const char *s, const char* ctx) { return _wxGetTranslation_ctx(wxString(s, wxConvUTF8), ctx).ToUTF8().data(); } + inline std::string translate_utf8(const wchar_t *s, const char* ctx) { return _wxGetTranslation_ctx(s, ctx).ToUTF8().data(); } + inline std::string translate_utf8(const std::string &s, const char* ctx) { return _wxGetTranslation_ctx(wxString(s.c_str(), wxConvUTF8), ctx).ToUTF8().data(); } + inline std::string translate_utf8(const std::wstring &s, const char* ctx) { return _wxGetTranslation_ctx(s.c_str(), ctx).ToUTF8().data(); } + inline std::string translate_utf8(const wxString &s, const char* ctx) { return _wxGetTranslation_ctx(s, ctx).ToUTF8().data(); } #undef _wxGetTranslation_ctx } // namespace I18N |