30 #ifndef __TERRALIB_CORE_TRANSLATOR_TRANSLATOR_H__ 31 #define __TERRALIB_CORE_TRANSLATOR_TRANSLATOR_H__ 34 #include "../Config.h" 104 std::string translate(
const std::string& message);
118 std::string translate(
const char* message);
134 std::string translate(
const std::string& msg1,
135 const std::string& msg2,
152 std::string translate(
const char* msg1,
161 void setLocale(
const std::string &locale);
172 void addTextDomain(
const std::string& textDomain,
const std::string& dir);
180 bool exist(
const std::string& textDomain);
208 #ifdef TERRALIB_TRANSLATOR_ENABLED 210 #error "The TE_TR macro has been already defined by another application or code. Please, inform TerraLib Development Team <terralib-team@dpi.inpe.br>, we will be glad to help solving this problem!" 222 #ifdef TERRALIB_TRANSLATOR_ENABLED 223 #define TE_ADD_TEXT_DOMAIN(domain, dir) te::core::Translator::instance().addTextDomain(domain, dir) 225 #define TE_ADD_TEXT_DOMAIN(domain, dir) ((void)0) 242 #define TE_TR(message) te::core::Translator::instance().translate(message).c_str() 269 #define TE_TR_PLURAL(message1, message2, n) te::core::Translator::instance().translate(message1, message2, n).c_str() 278 #define TE_TR_LANGUAGE(locale) te::core::Translator::instance().setLocale(locale) 280 #endif // __TERRALIB_CORE_TRANSLATOR_TRANSLATOR_H__ This singleton is designed to deal with multi-language text translation in TerraLib.
std::string m_locale
If not empty, it is the current locale.
~Translator()
Singleton destructor must be private or protected.
Translator()
Singleton constructor must be private or protected.
std::map< std::string, std::vector< std::string > > m_textDomainMap
A vector from text domains to base directory for the message catalog.