mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
Initialize locale before wxTranslations::Get()
This fixes a crash similar to <https://github.com/prusa3d/PrusaSlicer/issues/8299>.
This commit is contained in:
@@ -4766,6 +4766,7 @@ bool GUI_App::load_language(wxString language, bool initial)
|
|||||||
{
|
{
|
||||||
// Allocating a temporary locale will switch the default wxTranslations to its internal wxTranslations instance.
|
// Allocating a temporary locale will switch the default wxTranslations to its internal wxTranslations instance.
|
||||||
wxLocale temp_locale;
|
wxLocale temp_locale;
|
||||||
|
temp_locale.Init();
|
||||||
// Set the current translation's language to default, otherwise GetBestTranslation() may not work (see the wxWidgets source code).
|
// Set the current translation's language to default, otherwise GetBestTranslation() may not work (see the wxWidgets source code).
|
||||||
wxTranslations::Get()->SetLanguage(wxLANGUAGE_DEFAULT);
|
wxTranslations::Get()->SetLanguage(wxLANGUAGE_DEFAULT);
|
||||||
// Let the wxFileTranslationsLoader enumerate all translation dictionaries for PrusaSlicer
|
// Let the wxFileTranslationsLoader enumerate all translation dictionaries for PrusaSlicer
|
||||||
|
|||||||
Reference in New Issue
Block a user