Interface ITextApi
Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime.dll
Provide method for working with text resources
public interface ITextApi : IDslApi
Implements
Extension Methods
ObjectExtension.ConvertToBsonValue(object), EnumExtensions.DeepClone<ITextApi>(ITextApi)
Methods
CacheAndTranslate(string, string)
Cache and translate a text resource by a given key with language name (en or da)
string CacheAndTranslate(string key, string language)
Parameters
key
string
language
string
Returns
The translated text corresponding to the provided key and language name.
Examples
var textApi = ctx.Use<ITextApi>();
var translatedText = textApi.CacheAndTransalte("cw_search_result_limit_exceeded", "en");
LoadTextResources(string)
Load text resources by a language name which could be en or da
var textApi = ctx.Use<ITextApi>();
var textResult = textApi.LoadTextResources("en")
IDictionary<string, string> LoadTextResources(string languageName)
Parameters
languageName
string
Returns
Translate(string, string)
Translate a text resource by a given key with language name (en or da)
var textApi = ctx.Use<ITextApi>();
var translatedText = textApi.Translate("cw_search_result_limit_exceeded", "en");
string Translate(string key, string languageName)
Parameters
key
string
The text resource key
languageName
string
Language name
Returns
The translated text corresponding to the provided key and language name.