These functions are used to localize an attribute value of a (possibly custom) ISML tag. For that purpose localizeText()
returns the plain text behind a given language neutral key.
The very similar function localizeTextEx() supports an additional parameter that allows to assign an array of objects to be injected into the translation.
localizeText(key : String) : String localizeText(key : String, locale : String) : String localizeText(key : String, locale : String, site : Domain) : String
Domain domain = NamingMgr.getManager(DomainMgr.class).getDomainByName("eTest"); LocaleInformation enUS = NamingMgr.getManager(LocaleMgr.class).getLocaleBy("en_US"); LocalizationProvider localizationProvider = NamingMgr.getProvider(LocalizationProvider.class); localizationProvider.localizeText(anyKey, en_US, domain);
The function accepts the following arguments:
key
key = string
a unique key for a translation
locale
locale = string
an optional parameter to get the translation in a specific locale
site
site = string
an optional parameter indicating for which site the translated text should be presented