Allows users to implement their own I18n extension.
More...
#include <Ii18nImplementation.h>
|
virtual bool | CompareUntranslatedString (std::shared_ptr< IRuntimeContext > runtimeContext, std::shared_ptr< DataTypes::TranslationKey > translationKey, const std::string &unstranslatedString, const std::list< std::string > &arguments)=0 |
| Compares whether an untranslated string equals at least one of the translations of a given translation key.While searching for a match, each available locale shall be considered by the runtime. More...
|
|
virtual std::list< std::string > | GetAllLocales (std::shared_ptr< IRuntimeContext > runtimeContext)=0 |
| Gets all available locales from the runtime system that are supported and for which translations are available. More...
|
|
virtual std::string | GetCurrentLocale (std::shared_ptr< IRuntimeContext > runtimeContext)=0 |
| Gets the current locale code in use by the runtime system. More...
|
|
virtual std::string | Translate (std::shared_ptr< IRuntimeContext > runtimeContext, std::shared_ptr< DataTypes::TranslationKey > translationKey, const std::list< std::string > &arguments)=0 |
| The Translate accepts a TranslationKey which may be supplemented by additional translation arguments for message parameter substitution. More...
|
|
virtual std::string | TranslateToLocale (std::shared_ptr< IRuntimeContext > runtimeContext, const std::string &locale, std::shared_ptr< DataTypes::TranslationKey > translationKey, const std::list< std::string > &arguments)=0 |
| The TranslateToLocale shall perform a similar function to the Translate, but instead of using the current locale it shall use a target locale that is given as an argument to the call. More...
|
|
Allows users to implement their own I18n extension.
◆ CompareUntranslatedString()
virtual bool OpenTestSystem::Otx::Runtime::Api::Custom::Ii18nImplementation::CompareUntranslatedString |
( |
std::shared_ptr< IRuntimeContext > |
runtimeContext, |
|
|
std::shared_ptr< DataTypes::TranslationKey > |
translationKey, |
|
|
const std::string & |
unstranslatedString, |
|
|
const std::list< std::string > & |
arguments |
|
) |
| |
|
pure virtual |
Compares whether an untranslated string equals at least one of the translations of a given translation key.While searching for a match, each available locale shall be considered by the runtime.
- Parameters
-
runtimeContext | The related runtime context. |
translationKey | This element represents a unique key that the system shall use to search its internal database for a matching translation which matches the untranslated string |
arguments | This optional element represents a list of arguments for the translation. |
untranslatedString | Represents the string which shall be tested for a match. |
- Returns
- Return true if and only if a matching translation can be found.
◆ GetAllLocales()
virtual std::list<std::string> OpenTestSystem::Otx::Runtime::Api::Custom::Ii18nImplementation::GetAllLocales |
( |
std::shared_ptr< IRuntimeContext > |
runtimeContext | ) |
|
|
pure virtual |
Gets all available locales from the runtime system that are supported and for which translations are available.
- Parameters
-
runtimeContext | The related runtime context. |
- Returns
- A list of strings of all locals
◆ GetCurrentLocale()
virtual std::string OpenTestSystem::Otx::Runtime::Api::Custom::Ii18nImplementation::GetCurrentLocale |
( |
std::shared_ptr< IRuntimeContext > |
runtimeContext | ) |
|
|
pure virtual |
Gets the current locale code in use by the runtime system.
- Parameters
-
runtimeContext | The related runtime context. |
- Returns
- The current locale code. If no current locale is selected, the system shall return the default locale.
◆ Translate()
virtual std::string OpenTestSystem::Otx::Runtime::Api::Custom::Ii18nImplementation::Translate |
( |
std::shared_ptr< IRuntimeContext > |
runtimeContext, |
|
|
std::shared_ptr< DataTypes::TranslationKey > |
translationKey, |
|
|
const std::list< std::string > & |
arguments |
|
) |
| |
|
pure virtual |
The Translate accepts a TranslationKey which may be supplemented by additional translation arguments for message parameter substitution.
- Parameters
-
runtimeContext | The related runtime context. |
translationKey | This element represents a unique key that the system shall use to search its internal database for a translation. |
arguments | This optional element represents a list of arguments for the translation. The arguments shall be evaluated first before being inserted into the translated message.The order of arguments is important; the first argument shall substitute message parameter {0}, the second parameter {1}, and so on. |
- Returns
- A localized string in the current user language
◆ TranslateToLocale()
virtual std::string OpenTestSystem::Otx::Runtime::Api::Custom::Ii18nImplementation::TranslateToLocale |
( |
std::shared_ptr< IRuntimeContext > |
runtimeContext, |
|
|
const std::string & |
locale, |
|
|
std::shared_ptr< DataTypes::TranslationKey > |
translationKey, |
|
|
const std::list< std::string > & |
arguments |
|
) |
| |
|
pure virtual |
The TranslateToLocale shall perform a similar function to the Translate, but instead of using the current locale it shall use a target locale that is given as an argument to the call.
- Parameters
-
runtimeContext | The related runtime context. |
locale | The translation process shall use this string as the target locale for the translation. |
translationKey | This element represents a unique key that the system shall use to search its internal database for a translation. |
arguments | This optional element represents a list of arguments for the translation. The arguments shall be evaluated first before being inserted into the translated message.The order of arguments is important; the first argument shall substitute message parameter {0}, the second parameter {1}, and so on. |
- Returns
- A localized string in the target locale.
The documentation for this class was generated from the following file: