Dynamic Translation Button not appearing beside field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2019 06:55 AM
I am working on dynamic text translation. I have followed all the required steps like
1. Creating Credential
2. Creating Connection
3. Configuring Dictionary for field
4. Set User Default Language
Please help me. I am new to service now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2020 04:15 AM
Hi,
Please be aware that field dynamic translation only works for some field types and uses as the target language the current user session language. Supported field types are:
- String
- String (Full UTF-8)
- Multi Line Small Text Area
- Wide Text
For other field types you can create a client side UI Action that displays the result in a field message. Something like the code below should do the trick.
//Shows the translation of the 'meta' field on the form
function translateMeta() {
var response = {};
var parms = {};
parms['targetLanguages'] = [g_form.getValue('language')];
DynamicTranslation.getTranslation(g_form.getValue('meta'), parms).then(
function(response) {
g_form.hideFieldMsg('meta');
g_form.showFieldMsg('meta', response.translations[0].translatedText + " [" + response.translator + "]");
},
function (err) {
g_form.showFieldMsg('meta', JSON.stringify(err), 'error');
}
);
}
Hope this helps,
Regards,
José Pedro Abreu
