mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Follow-up of c7cdb2fd3e -> Fixed localization of error messages for .3mf and .amf version check
				
					
				
			This commit is contained in:
		
							parent
							
								
									7f589e79f7
								
							
						
					
					
						commit
						b5c57fc134
					
				
					 2 changed files with 16 additions and 2 deletions
				
			
		|  | @ -4,6 +4,8 @@ | |||
| #include "../GCode.hpp" | ||||
| #include "../Geometry.hpp" | ||||
| 
 | ||||
| #include "../I18N.hpp" | ||||
| 
 | ||||
| #include "3mf.hpp" | ||||
| 
 | ||||
| #include <limits> | ||||
|  | @ -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()); | ||||
|             } | ||||
|         } | ||||
|  |  | |||
|  | @ -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()); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Enrico Turri
						Enrico Turri