Translate

Description

Translate an HTML document or fragment of HTML into a user's chosen language.

Input

<Translate>
  <userLogonReference/>
  <password/>
<userLogonReferenceTranslate/> <html/> <fragment>false|true</fragment> <id/> <TranslateList> <Translate> <html/> <fragment/> <id/> </Translate> </TranslateList>
</Translate>

userLogonReferenceTranslate is the user logon reference whose options are to be used for the translation. If omitted, these default to the userLogonReference.

Set fragment to true to translate only a fragment of HTML. If false, the default, the translation will expect, and return, an entire HTML document.

If fragment is true, set id to translate the fragment using the given id as the translation id (effectively wrapping the html in an element with data-l10-id set to the id).

If TranslateList is optional, and Translate repeats within TranslateList. If given, then the service will translate and return all the phrases in the list. This allows multiple translations for the same user to be performed in one service call, without the overhead of looking up their detail more than once.

If the config option authorized is set to true, then the user logon reference and password are optional, and no check is made that the caller has authority over the translate user. The service TranslateAuthorized, which is not available from the UI or scripts, is configured in this way.

Output

<Translate>
<errorNumber>0</errorNumber> <html/> <TranslateList> <Translate> <html/> </Translate> </TranslateList>
</Translate>

TranslateList is only returned if it is passed.

Errors

101 - Not authorised

Class

com.metrici.xerula.TranslateService