Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer
This commit is contained in:
commit
f26d5effd9
@ -1,12 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
<!-- Generator: Adobe Illustrator 23.0.6, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||||
<g id="redo">
|
<path id="undo_1_" fill="#808080" d="M1.95,7.01h10.24L8.86,2.51c-0.31-0.42-0.22-1.01,0.2-1.32c0.42-0.31,1.01-0.22,1.32,0.2
|
||||||
<path fill="none" stroke="#ED6B21" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M13.39,11
|
l4.44,6.01c0,0.01,0.01,0.01,0.01,0.02c0.01,0.01,0.02,0.03,0.03,0.04c0.01,0.02,0.03,0.05,0.04,0.07c0.01,0.02,0.02,0.03,0.03,0.05
|
||||||
c-0.91,1.78-2.76,3-4.89,3C5.46,14,3,11.54,3,8.5C3,5.46,5.46,3,8.5,3C8.67,3,8.84,3.01,9,3.03"/>
|
c0.01,0.01,0.01,0.03,0.02,0.04c0.01,0.02,0.02,0.05,0.02,0.07c0.01,0.02,0.01,0.04,0.02,0.06c0,0.01,0,0.03,0.01,0.04
|
||||||
|
c0,0.02,0.01,0.05,0.01,0.07c0,0.02,0.01,0.05,0.01,0.07c0,0.01,0,0.01,0,0.02c0,0.01,0,0.01,0,0.02c0,0.02,0,0.05-0.01,0.07
|
||||||
<polygon fill="#ED6B21" stroke="#ED6B21" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
|
c0,0.02,0,0.05-0.01,0.07c0,0.01,0,0.03-0.01,0.04c0,0.02-0.01,0.04-0.02,0.06c-0.01,0.02-0.01,0.05-0.02,0.07
|
||||||
9,1 9,5 12,3 "/>
|
c-0.01,0.01-0.01,0.03-0.02,0.04c-0.01,0.02-0.02,0.04-0.03,0.05c-0.01,0.02-0.02,0.04-0.04,0.07c-0.01,0.01-0.02,0.03-0.03,0.04
|
||||||
</g>
|
c0,0.01-0.01,0.01-0.01,0.02l-4.54,6.05c-0.19,0.25-0.47,0.38-0.76,0.38c-0.2,0-0.4-0.06-0.57-0.19c-0.42-0.31-0.5-0.91-0.19-1.32
|
||||||
|
l3.41-4.54H1.95C1.42,8.91,1,8.48,1,7.96C1,7.44,1.42,7.01,1.95,7.01z"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 734 B After Width: | Height: | Size: 1.2 KiB |
@ -1,12 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
<!-- Generator: Adobe Illustrator 23.0.6, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||||
<g id="undo">
|
<path id="undo_1_" fill="#808080" d="M14.05,7.01H3.82l3.32-4.51c0.31-0.42,0.22-1.01-0.2-1.32c-0.42-0.31-1.01-0.22-1.32,0.2
|
||||||
<path fill="none" stroke="#ED6B21" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M3,11
|
L1.18,7.4c0,0.01-0.01,0.01-0.01,0.02C1.17,7.43,1.16,7.44,1.15,7.46C1.13,7.48,1.12,7.5,1.11,7.53C1.1,7.54,1.09,7.56,1.08,7.58
|
||||||
c0.91,1.78,2.76,3,4.89,3c3.04,0,5.5-2.46,5.5-5.5c0-3.04-2.46-5.5-5.5-5.5c-0.17,0-0.34,0.01-0.5,0.03"/>
|
C1.08,7.59,1.07,7.61,1.06,7.62C1.06,7.65,1.05,7.67,1.04,7.69C1.04,7.71,1.03,7.73,1.02,7.75c0,0.01,0,0.03-0.01,0.04
|
||||||
|
c0,0.02-0.01,0.05-0.01,0.07C1.01,7.89,1,7.92,1,7.94c0,0.01,0,0.01,0,0.02c0,0.01,0,0.01,0,0.02c0,0.02,0,0.05,0.01,0.07
|
||||||
<polygon fill="#ED6B21" stroke="#ED6B21" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
|
c0,0.02,0,0.05,0.01,0.07c0,0.01,0,0.03,0.01,0.04c0,0.02,0.01,0.04,0.02,0.06C1.05,8.26,1.06,8.28,1.07,8.3
|
||||||
7.39,1 7.39,5 4.39,3 "/>
|
c0.01,0.01,0.01,0.03,0.02,0.04C1.09,8.36,1.1,8.38,1.11,8.4c0.01,0.02,0.02,0.04,0.04,0.07c0.01,0.01,0.02,0.03,0.03,0.04
|
||||||
</g>
|
c0,0.01,0.01,0.01,0.01,0.02l4.54,6.05c0.19,0.25,0.47,0.38,0.76,0.38c0.2,0,0.4-0.06,0.57-0.19c0.42-0.31,0.5-0.91,0.19-1.32
|
||||||
|
L3.84,8.91h10.22c0.52,0,0.95-0.42,0.95-0.95C15,7.44,14.58,7.01,14.05,7.01z"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 746 B After Width: | Height: | Size: 1.2 KiB |
@ -653,12 +653,18 @@ bool GUI_App::load_language(wxString language, bool initial)
|
|||||||
wxFileTranslationsLoader::AddCatalogLookupPathPrefix(from_u8(localization_dir()));
|
wxFileTranslationsLoader::AddCatalogLookupPathPrefix(from_u8(localization_dir()));
|
||||||
// Get the active language from PrusaSlicer.ini, or empty string if the key does not exist.
|
// Get the active language from PrusaSlicer.ini, or empty string if the key does not exist.
|
||||||
language = app_config->get("translation_language");
|
language = app_config->get("translation_language");
|
||||||
|
if (! language.empty())
|
||||||
|
BOOST_LOG_TRIVIAL(trace) << boost::format("translation_language provided by PrusaSlicer.ini: %1%") % language;
|
||||||
|
|
||||||
// Get the system language.
|
// Get the system language.
|
||||||
{
|
{
|
||||||
const wxLanguage lang_system = wxLanguage(wxLocale::GetSystemLanguage());
|
const wxLanguage lang_system = wxLanguage(wxLocale::GetSystemLanguage());
|
||||||
if (lang_system != wxLANGUAGE_UNKNOWN)
|
if (lang_system != wxLANGUAGE_UNKNOWN) {
|
||||||
m_language_info_system = wxLocale::GetLanguageInfo(lang_system);
|
m_language_info_system = wxLocale::GetLanguageInfo(lang_system);
|
||||||
|
BOOST_LOG_TRIVIAL(trace) << boost::format("System language detected (user locales and such): %1%") % m_language_info_system->CanonicalName.ToUTF8().data();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#if defined(__WXMSW__) || defined(__WXOSX__)
|
||||||
{
|
{
|
||||||
// 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;
|
||||||
@ -670,36 +676,41 @@ bool GUI_App::load_language(wxString language, bool initial)
|
|||||||
// The last parameter gets added to the list of detected dictionaries. This is a workaround
|
// The last parameter gets added to the list of detected dictionaries. This is a workaround
|
||||||
// for not having the English dictionary. Let's hope wxWidgets of various versions process this call the same way.
|
// for not having the English dictionary. Let's hope wxWidgets of various versions process this call the same way.
|
||||||
wxString best_language = wxTranslations::Get()->GetBestTranslation(SLIC3R_APP_KEY, wxLANGUAGE_ENGLISH);
|
wxString best_language = wxTranslations::Get()->GetBestTranslation(SLIC3R_APP_KEY, wxLANGUAGE_ENGLISH);
|
||||||
if (! best_language.IsEmpty())
|
if (! best_language.IsEmpty()) {
|
||||||
m_language_info_best = wxLocale::FindLanguageInfo(best_language);
|
m_language_info_best = wxLocale::FindLanguageInfo(best_language);
|
||||||
|
BOOST_LOG_TRIVIAL(trace) << boost::format("Best translation language detected (may be different from user locales): %1%") % m_language_info_best->CanonicalName.ToUTF8().data();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const wxLanguageInfo *language_info = wxLocale::FindLanguageInfo(language);
|
const wxLanguageInfo *language_info = wxLocale::FindLanguageInfo(language);
|
||||||
if (language_info == nullptr)
|
if (! language.empty() && language_info == nullptr)
|
||||||
language.clear();
|
BOOST_LOG_TRIVIAL(error) << boost::format("Language code \"%1%\" is not supported") % language.ToUTF8().data();
|
||||||
|
|
||||||
if (language.IsEmpty()) {
|
if (language_info != nullptr && language_info->LayoutDirection == wxLayout_RightToLeft) {
|
||||||
|
BOOST_LOG_TRIVIAL(trace) << boost::format("The following language code requires right to left layout, which is not supported by PrusaSlicer: %1%") % language_info->CanonicalName.ToUTF8().data();
|
||||||
|
language_info = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (language_info == nullptr) {
|
||||||
if (m_language_info_system != nullptr && m_language_info_system->LayoutDirection != wxLayout_RightToLeft)
|
if (m_language_info_system != nullptr && m_language_info_system->LayoutDirection != wxLayout_RightToLeft)
|
||||||
language = m_language_info_system->CanonicalName;
|
language_info = m_language_info_system;
|
||||||
if (m_language_info_best != nullptr && m_language_info_best->LayoutDirection != wxLayout_RightToLeft)
|
if (m_language_info_best != nullptr && m_language_info_best->LayoutDirection != wxLayout_RightToLeft)
|
||||||
language = m_language_info_best->CanonicalName;
|
language_info = m_language_info_best;
|
||||||
if (language.IsEmpty())
|
if (language_info == nullptr)
|
||||||
language = "en_US";
|
language_info = wxLocale::GetLanguageInfo(wxLANGUAGE_ENGLISH_US);
|
||||||
}
|
}
|
||||||
|
|
||||||
language_info = wxLocale::FindLanguageInfo(language);
|
BOOST_LOG_TRIVIAL(trace) << boost::format("Switching wxLocales to %1%") % language_info->CanonicalName.ToUTF8().data();
|
||||||
if (language_info == nullptr || language_info->LayoutDirection == wxLayout_RightToLeft) {
|
|
||||||
// We don't support right-to-left rendering (Hebrew, Arabic ...), therefore we switch to English.
|
|
||||||
language = "en_US";
|
|
||||||
language_info = wxLocale::GetLanguageInfo(wxLANGUAGE_ENGLISH_US);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Alternate language code.
|
// Alternate language code.
|
||||||
wxLanguage language_dict = wxLanguage(language_info->Language);
|
wxLanguage language_dict = wxLanguage(language_info->Language);
|
||||||
if (language.BeforeFirst('_') == "sk")
|
if (language_info->CanonicalName.BeforeFirst('_') == "sk") {
|
||||||
// Slovaks understand Czech well. Give them the Czech translation.
|
// Slovaks understand Czech well. Give them the Czech translation.
|
||||||
language_dict = wxLANGUAGE_CZECH;
|
language_dict = wxLANGUAGE_CZECH;
|
||||||
|
BOOST_LOG_TRIVIAL(trace) << "Using Czech dictionaries for Slovak language";
|
||||||
|
}
|
||||||
|
|
||||||
if (! wxLocale::IsAvailable(language_info->Language)) {
|
if (! wxLocale::IsAvailable(language_info->Language)) {
|
||||||
// Loading the language dictionary failed.
|
// Loading the language dictionary failed.
|
||||||
|
Loading…
Reference in New Issue
Block a user