Skip to content

Commit

Permalink
FIX: dailytips text translation
Browse files Browse the repository at this point in the history
jira: STUDIO-2556

Change-Id: If44e503615b09ee1692f42ba1f998918ec5bd691
  • Loading branch information
LiZ-Li-BBL authored and lanewei120 committed Nov 9, 2023
1 parent 5f1c4f7 commit 6ab1ee2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/slic3r/GUI/GUI_App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
#include "ReleaseNote.hpp"
#include "PrivacyUpdateDialog.hpp"
#include "ModelMall.hpp"
#include "HintNotification.hpp"

//#ifdef WIN32
//#include "BaseException.h"
Expand Down Expand Up @@ -5135,6 +5136,7 @@ bool GUI_App::load_language(wxString language, bool initial)
//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((_L("*") + " ").ToUTF8().data());
HintDatabase::get_instance().reinit();
return true;
}

Expand Down
6 changes: 6 additions & 0 deletions src/slic3r/GUI/HintNotification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ void HintDatabase::uninit()
m_used_ids.clear();
m_used_ids_loaded = false;
}
void HintDatabase::reinit()
{
if (m_initialized)
uninit();
init();
}
void HintDatabase::init()
{
load_hints_from_file(std::move(boost::filesystem::path(resources_dir()) / "data" / "hints.ini"));
Expand Down
1 change: 1 addition & 0 deletions src/slic3r/GUI/HintNotification.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class HintDatabase
// resets m_initiailized to false and writes used if was initialized
// used when reloading in runtime - like change language
void uninit();
void reinit();
private:
void init();
void init_random_hint_id();
Expand Down

0 comments on commit 6ab1ee2

Please sign in to comment.