Fixed mangling of UTF characters when converted implicitely to

wxString on Windows through the + operator.
This commit is contained in:
bubnikv 2018-06-07 22:10:23 +02:00
parent 92875709e1
commit 7dfe2e2595
6 changed files with 30 additions and 27 deletions

View file

@ -5,6 +5,9 @@
#include <vector>
#include "Config.hpp"
#include <wx/intl.h>
#include <wx/string.h>
class wxApp;
class wxWindow;
class wxFrame;
@ -30,6 +33,12 @@ class PresetUpdater;
class DynamicPrintConfig;
class TabIface;
#define _(s) Slic3r::translate((s))
inline wxString translate(const char *s) { return wxGetTranslation(wxString(s, wxConvUTF8)); }
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()); }
// !!! If you needed to translate some wxString,
// !!! please use _(L(string))
// !!! _() - is a standard wxWidgets macro to translate