mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Don't delete old locales when switching language. It crashes for
an unknown reason.
This commit is contained in:
parent
002ae9a4bf
commit
a1ebb8d483
1 changed files with 5 additions and 3 deletions
|
@ -692,7 +692,7 @@ bool GUI_App::load_language(wxString language)
|
|||
else
|
||||
return false;
|
||||
}
|
||||
delete m_wxLocale;
|
||||
wxLocale *old_locale = m_wxLocale;
|
||||
m_wxLocale = new_locale;
|
||||
m_wxLocale->AddCatalogLookupPathPrefix(from_u8(localization_dir()));
|
||||
m_wxLocale->AddCatalog(SLIC3R_APP_KEY);
|
||||
|
@ -700,6 +700,8 @@ bool GUI_App::load_language(wxString language)
|
|||
//FIXME This is a temporary workaround, the correct solution is to switch to "C" locale during file import / export only.
|
||||
wxSetlocale(LC_NUMERIC, "C");
|
||||
Preset::update_suffix_modified();
|
||||
//FIXME Why the following line crashes?
|
||||
// delete old_locale;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -709,7 +711,7 @@ std::vector<const wxLanguageInfo*> GUI_App::get_installed_languages()
|
|||
wxDir dir(from_u8(localization_dir()));
|
||||
wxString filename;
|
||||
std::vector<const wxLanguageInfo*> res;
|
||||
res.emplace_back(wxLocale::FindLanguageInfo("en_EN"));
|
||||
res.emplace_back(wxLocale::GetLanguageInfo(wxLANGUAGE_ENGLISH_US));
|
||||
for (bool cont = dir.GetFirst(&filename, wxEmptyString, wxDIR_DIRS); cont; cont = dir.GetNext(&filename)) {
|
||||
const wxLanguageInfo *langinfo = wxLocale::FindLanguageInfo(filename);
|
||||
if (langinfo != nullptr) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue