diff --git a/src/libslic3r/Format/3mf.cpp b/src/libslic3r/Format/3mf.cpp index 9da0d4fd99..5e0878884c 100644 --- a/src/libslic3r/Format/3mf.cpp +++ b/src/libslic3r/Format/3mf.cpp @@ -4,6 +4,8 @@ #include "../GCode.hpp" #include "../Geometry.hpp" +#include "../I18N.hpp" + #include "3mf.hpp" #include @@ -202,6 +204,11 @@ bool is_valid_object_type(const std::string& type) namespace Slic3r { +//! macro used to mark string used at localization, +//! return same string +#define L(s) (s) +#define _(s) Slic3r::I18N::translate(s) + // Base class with error messages management class _3MF_Base { @@ -1416,7 +1423,7 @@ namespace Slic3r { if (m_check_version && (m_version > VERSION_3MF)) { - std::string msg = "The selected 3mf file has been saved with a newer version of " + std::string(SLIC3R_APP_NAME) + " and is not compatibile."; + std::string msg = _(L("The selected 3mf file has been saved with a newer version of " + std::string(SLIC3R_APP_NAME) + " and is not compatibile.")); throw std::runtime_error(msg.c_str()); } } diff --git a/src/libslic3r/Format/AMF.cpp b/src/libslic3r/Format/AMF.cpp index be15f833b5..033e64aa00 100644 --- a/src/libslic3r/Format/AMF.cpp +++ b/src/libslic3r/Format/AMF.cpp @@ -11,6 +11,8 @@ #include "../GCode.hpp" #include "../PrintConfig.hpp" #include "../Utils.hpp" +#include "../I18N.hpp" + #include "AMF.hpp" #include @@ -42,6 +44,11 @@ const char* SLIC3R_CONFIG_TYPE = "slic3rpe_config"; namespace Slic3r { +//! macro used to mark string used at localization, +//! return same string +#define L(s) (s) +#define _(s) Slic3r::I18N::translate(s) + struct AMFParserContext { AMFParserContext(XML_Parser parser, DynamicPrintConfig* config, Model* model) : @@ -803,7 +810,7 @@ bool extract_model_from_archive(mz_zip_archive& archive, const mz_zip_archive_fi if (check_version && (ctx.m_version > VERSION_AMF)) { - std::string msg = "The selected amf file has been saved with a newer version of " + std::string(SLIC3R_APP_NAME) + " and is not compatibile."; + std::string msg = _(L("The selected amf file has been saved with a newer version of " + std::string(SLIC3R_APP_NAME) + " and is not compatibile.")); throw std::runtime_error(msg.c_str()); }