This class is designed for dealing with multi-language text translation in TerraLib. More...
Go to the source code of this file.
Classes | |
class | te::core::Translator |
This singleton is designed to deal with multi-language text translation in TerraLib. More... | |
Namespaces | |
boost | |
boost::locale | |
te | |
TerraLib. | |
te::core | |
Macros | |
#define | TE_ADD_TEXT_DOMAIN(domain, dir) ((void)0) |
It adds the given text domain and its directory to the multilingual system. More... | |
#define | TE_TR(message) te::core::Translator::instance().translate(message).c_str() |
It marks a string in order to get translated. More... | |
#define | TE_TR_LANGUAGE(locale) te::core::Translator::instance().setLocale(locale) |
It sets the locale for the Translator. More... | |
#define | TE_TR_PLURAL(message1, message2, n) te::core::Translator::instance().translate(message1, message2, n).c_str() |
It marks a string in order to get translated according to plural form. More... | |
This class is designed for dealing with multi-language text translation in TerraLib.
Definition in file Translator.h.
#define TE_ADD_TEXT_DOMAIN | ( | domain, | |
dir | |||
) | ((void)0) |
It adds the given text domain and its directory to the multilingual system.
domain | A given message domain (just a name). A text domain is the name of the catalog used to translate the message. |
dir | Where the text domain is located. |
Definition at line 247 of file Translator.h.
#define TE_TR | ( | message | ) | te::core::Translator::instance().translate(message).c_str() |
It marks a string in order to get translated.
message | The text to be translated. |
Example of usage:
Definition at line 264 of file Translator.h.
Referenced by te::cl::KMeans< TTRAIN, TCLASSIFY >::classify(), te::gdal::GetGDALRessamplingMethod(), te::rst::PolygonIterator< T >::getIntersectionRanges(), te::map::GroupingByStdDeviation(), te::cl::Dummy< TTRAIN, TCLASSIFY >::initialize(), te::cl::KMeans< TTRAIN, TCLASSIFY >::initialize(), te::common::FactoryDictionary< TFACTORY, TFACTORYKEY, TKEYCOMPARE >::insert(), te::rst::LineIterator< T >::LineIterator(), te::common::ParameterizedAbstractFactory< TPRODUCT, TFACTORYKEY, TPARAM, TKEYCOMPARE >::make(), te::common::AbstractFactory< te::qt::widgets::ChartWidget, std::string >::make(), te::rst::PointSetIterator< T >::PointSetIterator(), te::rst::PolygonIterator< T >::PolygonIterator(), te::common::FactoryDictionary< TFACTORY, TFACTORYKEY, TKEYCOMPARE >::remove(), and te::cl::KMeans< TTRAIN, TCLASSIFY >::train().
#define TE_TR_LANGUAGE | ( | locale | ) | te::core::Translator::instance().setLocale(locale) |
It sets the locale for the Translator.
locale | A string of the new locale. |
Definition at line 300 of file Translator.h.
#define TE_TR_PLURAL | ( | message1, | |
message2, | |||
n | |||
) | te::core::Translator::instance().translate(message1, message2, n).c_str() |
It marks a string in order to get translated according to plural form.
message1 | The singular form of the text to be translated. |
message2 | The plural form of the text to be translated. |
n | This parameter is used to determine the plural form. |
Example of usage:
In the above example, the parameter n can be a threshold that helps to choose between the first or the second construction. If your trabslation file is configured with a theashold of 1, indicating that if n > 1 must choose the second construction, the plural versin will be choosed, otherwise, it will choose the singular form (the fisrt one).
Definition at line 291 of file Translator.h.