30 #ifndef __TERRALIB_CORE_TRANSLATOR_TRANSLATOR_H__ 31 #define __TERRALIB_CORE_TRANSLATOR_TRANSLATOR_H__ 34 #include "../Config.h" 113 std::string translate(
const std::string& message);
127 std::string translate(
const char* message);
143 std::string translate(
const std::string& msg1,
144 const std::string& msg2,
161 std::string translate(
const char* msg1,
170 void setLocale(
const std::string &locale);
181 void addTextDomain(
const std::string& textDomain,
const std::string& dir);
189 bool exist(
const std::string& textDomain);
194 void loadAllTranslations(
const std::string& translationsDir);
213 void updateTranslationFiles();
230 #ifdef TERRALIB_TRANSLATOR_ENABLED 232 #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!" 244 #ifdef TERRALIB_TRANSLATOR_ENABLED 245 #define TE_ADD_TEXT_DOMAIN(domain, dir) te::core::Translator::instance().addTextDomain(domain, dir) 247 #define TE_ADD_TEXT_DOMAIN(domain, dir) ((void)0) 264 #define TE_TR(message) te::core::Translator::instance().translate(message).c_str() 291 #define TE_TR_PLURAL(message1, message2, n) te::core::Translator::instance().translate(message1, message2, n).c_str() 300 #define TE_TR_LANGUAGE(locale) te::core::Translator::instance().setLocale(locale) 302 #endif // __TERRALIB_CORE_TRANSLATOR_TRANSLATOR_H__
This singleton is designed to deal with multi-language text translation in TerraLib.
boost::locale::generator * m_localeGenerator
std::locale m_translationLocale
std::string m_locale
If not empty, it is the current locale.
bool m_loadTranslationFiles
std::map< std::string, std::vector< std::string > > m_textDomainMap
A vector from text domains to base directory for the message catalog.