mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Provide a callback to libslic3r to translate texts.
Moved the "translate" functions to namespaces to avoid clashes between the code in libslic3r and Slic3r GUI projects.
This commit is contained in:
parent
6b2b970b9a
commit
02d4f3e14d
6 changed files with 23 additions and 13 deletions
|
@ -56,7 +56,7 @@
|
|||
|
||||
#include "../Utils/PresetUpdater.hpp"
|
||||
#include "../Config/Snapshot.hpp"
|
||||
|
||||
#include "libslic3r/I18N.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
|
@ -149,9 +149,13 @@ void update_label_colours_from_appconfig()
|
|||
}
|
||||
}
|
||||
|
||||
static std::string libslic3r_translate_callback(const char *s) { return wxGetTranslation(wxString(s, wxConvUTF8)); }
|
||||
|
||||
void set_wxapp(wxApp *app)
|
||||
{
|
||||
g_wxApp = app;
|
||||
// Let the libslic3r know the callback, which will translate messages on demand.
|
||||
Slic3r::I18N::set_translate_callback(libslic3r_translate_callback);
|
||||
init_label_colours();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue