Welcome to mirror list, hosted at ThFree Co, Russian Federation.

I18N.hpp « libslic3r « src « xs - github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: db4fd22dfe0c90f0fc33a0ed7c4644efecb75251 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef slic3r_I18N_hpp_
#define slic3r_I18N_hpp_

#include <string>

namespace Slic3r {

namespace I18N {
	typedef std::string (*translate_fn_type)(const char*);
	extern translate_fn_type translate_fn;
	inline void set_translate_callback(translate_fn_type fn) { translate_fn = fn; }
	inline std::string translate(const std::string &s) { return (translate_fn == nullptr) ? s : (*translate_fn)(s.c_str()); }
	inline std::string translate(const char *ptr) { return (translate_fn == nullptr) ? std::string(ptr) : (*translate_fn)(ptr); }
} // namespace I18N

} // namespace Slic3r

#endif /* slic3r_I18N_hpp_ */