Merge branch 'master-remote' 01.06.00.66

# Conflicts:
#	.github/workflows/build_ubuntu.yml
#	bbl/i18n/OrcaSlicer.pot
#	bbl/i18n/de/OrcaSlicer_de.po
#	bbl/i18n/en/OrcaSlicer_en.po
#	bbl/i18n/es/OrcaSlicer_es.po
#	bbl/i18n/fr/OrcaSlicer_fr.po
#	bbl/i18n/hu/OrcaSlicer_hu.po
#	bbl/i18n/it/OrcaSlicer_it.po
#	bbl/i18n/ja/OrcaSlicer_ja.po
#	bbl/i18n/nl/OrcaSlicer_nl.po
#	bbl/i18n/sv/OrcaSlicer_sv.po
#	bbl/i18n/zh_cn/OrcaSlicer_zh_CN.po
#	resources/i18n/zh_cn/BambuStudio.mo
#	version.inc
This commit is contained in:
SoftFever 2023-05-01 10:20:38 +08:00
commit 54c02521d4
10 changed files with 108 additions and 23 deletions

View file

@ -37,6 +37,11 @@
#include "MeshBoolean.hpp"
#include "Format/3mf.hpp"
// Transtltion
#include "I18N.hpp"
#define _L(s) Slic3r::I18N::translate(s)
namespace Slic3r {
// BBS initialization of static variables
std::map<size_t, ExtruderParams> Model::extruderParamsMap = { {0,{"",0,0}}};
@ -191,7 +196,7 @@ Model Model::read_from_file(const std::string& input_file, DynamicPrintConfig* c
//BBS: is_xxx is used for is_bbs_3mf when load 3mf
result = load_bbs_3mf(input_file.c_str(), config, config_substitutions, &model, plate_data, project_presets, is_xxx, file_version, proFn, options, project, plate_id);
else
throw Slic3r::RuntimeError("Unknown file format. Input file must have .stl, .obj, .amf(.xml) extension.");
throw Slic3r::RuntimeError(_L("Unknown file format. Input file must have .stl, .obj, .amf(.xml) extension."));
if (is_cb_cancel) {
Model empty_model;
@ -200,13 +205,13 @@ Model Model::read_from_file(const std::string& input_file, DynamicPrintConfig* c
if (!result) {
if (message.empty())
throw Slic3r::RuntimeError("Loading of a model file failed.");
throw Slic3r::RuntimeError(_L("Loading of a model file failed."));
else
throw Slic3r::RuntimeError(message);
}
if (model.objects.empty())
throw Slic3r::RuntimeError("The supplied file couldn't be read because it's empty");
throw Slic3r::RuntimeError(_L("The supplied file couldn't be read because it's empty"));
for (ModelObject *o : model.objects)
o->input_file = input_file;
@ -252,14 +257,14 @@ Model Model::read_from_archive(const std::string& input_file, DynamicPrintConfig
else if (boost::algorithm::iends_with(input_file, ".zip.amf"))
result = load_amf(input_file.c_str(), config, config_substitutions, &model, &is_bbl_3mf);
else
throw Slic3r::RuntimeError("Unknown file format. Input file must have .3mf or .zip.amf extension.");
throw Slic3r::RuntimeError(_L("Unknown file format. Input file must have .3mf or .zip.amf extension."));
if (out_file_type != En3mfType::From_Prusa) {
out_file_type = is_bbl_3mf ? En3mfType::From_BBS : En3mfType::From_Other;
}
if (!result)
throw Slic3r::RuntimeError("Loading of a model file failed.");
throw Slic3r::RuntimeError(_L("Loading of a model file failed."));
for (ModelObject *o : model.objects) {
// if (boost::algorithm::iends_with(input_file, ".zip.amf"))
@ -278,7 +283,7 @@ Model Model::read_from_archive(const std::string& input_file, DynamicPrintConfig
if (proFn) {
proFn(IMPORT_STAGE_ADD_INSTANCE, 0, 1, cb_cancel);
if (cb_cancel)
throw Slic3r::RuntimeError("Canceled");
throw Slic3r::RuntimeError(_L("Canceled"));
}
}
@ -289,7 +294,7 @@ Model Model::read_from_archive(const std::string& input_file, DynamicPrintConfig
if (proFn) {
proFn(IMPORT_STAGE_UPDATE_GCODE, 0, 1, cb_cancel);
if (cb_cancel)
throw Slic3r::RuntimeError("Canceled");
throw Slic3r::RuntimeError(_L("Canceled"));
}
//BBS
@ -300,7 +305,7 @@ Model Model::read_from_archive(const std::string& input_file, DynamicPrintConfig
if (proFn) {
proFn(IMPORT_STAGE_CHECK_MODE_GCODE, 0, 1, cb_cancel);
if (cb_cancel)
throw Slic3r::RuntimeError("Canceled");
throw Slic3r::RuntimeError(_L("Canceled"));
}
handle_legacy_sla(*config);