From 693af0c98fdbce2b22cc0f3639db2e0c6d7803a9 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Wed, 7 Jun 2023 19:15:51 -0600 Subject: [PATCH] Initialize locale before wxTranslations::Get() This fixes a crash similar to . --- src/slic3r/GUI/GUI_App.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 7ec78315e..288f3bfdd 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -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. wxLocale temp_locale; + temp_locale.Init(); // Set the current translation's language to default, otherwise GetBestTranslation() may not work (see the wxWidgets source code). wxTranslations::Get()->SetLanguage(wxLANGUAGE_DEFAULT); // Let the wxFileTranslationsLoader enumerate all translation dictionaries for PrusaSlicer