FIX: [STUDIO-2675] linux language switch zh_CN

Change-Id: Ifba1682b7fb402712665dad0219a84db0a23f1c3
This commit is contained in:
chunmao.guo 2023-05-22 17:50:45 +08:00 committed by Lane.Wei
parent 6e5e947aa2
commit a7566ea592
3 changed files with 9 additions and 3 deletions

View File

@ -246,6 +246,12 @@ else ()
COMMAND ln -sfn "${SLIC3R_RESOURCES_DIR}" "${BIN_RESOURCES_DIR}"
COMMENT "Symlinking the resources directory into the build tree"
VERBATIM)
if (UNIX AND NOT APPLE)
add_custom_command(TARGET BambuStudio POST_BUILD
COMMAND ln -sfn "zh_cn" "${BIN_RESOURCES_DIR}/i18n/zh_CN"
COMMENT "Symlinking zh_CN language setting to zh_cn"
VERBATIM)
endif()
endif ()
# Slic3r binary install target. Default build type is release in case no CMAKE_BUILD_TYPE is provided.

View File

@ -4796,7 +4796,7 @@ bool GUI_App::load_language(wxString language, bool initial)
// Get the active language from PrusaSlicer.ini, or empty string if the key does not exist.
language = app_config->get("language");
if (! language.empty())
BOOST_LOG_TRIVIAL(trace) << boost::format("language provided by PBambuStudio.conf: %1%") % language;
BOOST_LOG_TRIVIAL(trace) << boost::format("language provided by BambuStudio.conf: %1%") % language;
else {
// Get the system language.
const wxLanguage lang_system = wxLanguage(wxLocale::GetSystemLanguage());
@ -4902,7 +4902,7 @@ bool GUI_App::load_language(wxString language, bool initial)
#ifdef __linux__
// If we can't find this locale , try to use different one for the language
// instead of just reporting that it is impossible to switch.
if (! wxLocale::IsAvailable(language_info->Language)) {
if (! wxLocale::IsAvailable(language_info->Language) && m_language_info_system) {
std::string original_lang = into_u8(language_info->CanonicalName);
language_info = linux_get_existing_locale_language(language_info, m_language_info_system);
BOOST_LOG_TRIVIAL(trace) << boost::format("Can't switch language to %1% (missing locales). Using %2% instead.")

View File

@ -540,7 +540,7 @@ wxBitmap *get_extruder_color_icon(std::string color, std::string label, int icon
// there is no neede to scale created solid bitmap
wxColor clr(color);
bitmap = bmp_cache.insert(bitmap_key, wxBitmap(icon_width, icon_height));
#ifdef __WXOSX__
#ifndef __WXMSW__
wxMemoryDC dc;
#else
wxClientDC cdc((wxWindow *) Slic3r::GUI::wxGetApp().mainframe);