OTX-Runtime for DotNet  
OpenTestSystem.Otx.Runtime.Api.Custom.Ii18nImplementation Interface Reference

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

Public Member Functions

bool CompareUntranslatedString (IRuntimeContext runtimeContext, TranslationKey translationKey, List< string > arguments, string untranslatedString)
 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...
 
List< string > GetAllLocales (IRuntimeContext runtimeContext)
 Gets all available locales from the runtime system that are supported and for which translations are available. More...
 
string GetCurrentLocale (IRuntimeContext runtimeContext)
 Gets the current locale code in use by the runtime system. More...
 
string Translate (IRuntimeContext runtimeContext, TranslationKey translationKey, List< string > arguments)
 The Translate accepts a TranslationKey which may be supplemented by additional translation arguments for message parameter substitution More...
 
string TranslateToLocale (IRuntimeContext runtimeContext, string locale, TranslationKey translationKey, List< string > arguments)
 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()

bool OpenTestSystem.Otx.Runtime.Api.Custom.Ii18nImplementation.CompareUntranslatedString ( IRuntimeContext  runtimeContext,
TranslationKey  translationKey,
List< string >  arguments,
string  untranslatedString 
)

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()

List<string> OpenTestSystem.Otx.Runtime.Api.Custom.Ii18nImplementation.GetAllLocales ( IRuntimeContext  runtimeContext)

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()

string OpenTestSystem.Otx.Runtime.Api.Custom.Ii18nImplementation.GetCurrentLocale ( IRuntimeContext  runtimeContext)

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()

string OpenTestSystem.Otx.Runtime.Api.Custom.Ii18nImplementation.Translate ( IRuntimeContext  runtimeContext,
TranslationKey  translationKey,
List< string >  arguments 
)

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()

string OpenTestSystem.Otx.Runtime.Api.Custom.Ii18nImplementation.TranslateToLocale ( IRuntimeContext  runtimeContext,
string  locale,
TranslationKey  translationKey,
List< string >  arguments 
)

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 interface was generated from the following file: