Follow-up of c7cdb2fd3e -> Fixed localization of error messages for .3mf and .amf version check

This commit is contained in:
Enrico Turri 2019-08-26 09:35:04 +02:00
parent 7f589e79f7
commit b5c57fc134
2 changed files with 16 additions and 2 deletions

View file

@ -11,6 +11,8 @@
#include "../GCode.hpp"
#include "../PrintConfig.hpp"
#include "../Utils.hpp"
#include "../I18N.hpp"
#include "AMF.hpp"
#include <boost/filesystem/operations.hpp>
@ -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());
}