OTX-Runtime for C++  
OpenTestSystem::Otx::Runtime::Api::Custom::Ii18nImplementation Class Referenceabstract

Allows users to implement their own I18n extension. More...

#include <Ii18nImplementation.h>

Public Member Functions

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...
 

Detailed Description

Allows users to implement their own I18n extension.

Member Function Documentation

◆ 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
runtimeContextThe related runtime context.
translationKeyThis element represents a unique key that the system shall use to search its internal database for a matching translation which matches the untranslated string
argumentsThis optional element represents a list of arguments for the translation.
untranslatedStringRepresents 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
runtimeContextThe 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
runtimeContextThe 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
runtimeContextThe related runtime context.
translationKeyThis element represents a unique key that the system shall use to search its internal database for a translation.
argumentsThis 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
runtimeContextThe related runtime context.
localeThe translation process shall use this string as the target locale for the translation.
translationKeyThis element represents a unique key that the system shall use to search its internal database for a translation.
argumentsThis 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: