SOLVED

Re: auto-translating data entered via form fills

Go to solution
Tom_Liolios4
Level 4

auto-translating data entered via form fills

Hello!

 

Our team works globally, and we generate leads across regions & languages. We currently also generate data via form fills & imports in non-latin script. Mostly in Chinese characters.

 

Does anyone have experience with setting up a process that auto-translates Chinese characters (or other scripts) to English?

Would the Google Translate API be something that can be used for this purpose?

 

Our biggest concern the Company Name that is currently entered in Chinese characters. It would be great if we can call a webhook whenever data is entered on our Chinese forms, and that the webhook is able to translate the Chinese value in field X and write a translation to field Y.

 

Thank you for sharing your input!

Tom

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor

Re: auto-translating data entered via form fills

You can use the Google Translate API! This can be setup to translate the form field data in Marketo using the Webhook. The JSON response will have the translated text in the parameter which can be mapped with the field Y per your question while setting up the webhook. You can also leverage Google's autodetection API which is fairly accurate in most cases if you're skeptical of the source language for translating data to the target language.

 

You can do a source language detection and validation to ensure the data is in a specific language before calling the translation api, i.e., if you want to translate only a certain language's data e.g., Chinese.

 

There is a cool little demo by Sandy here which although does translation on the form - but addresses a similar use case of data translation.

Hope this helps.

 

View solution in original post

5 REPLIES 5
Jay_Jiang
Level 10

Re: auto-translating data entered via form fills

Interesting problem. It seems there are some regex solutions you can deploy to try and match on Chinese unicode characters. You could also infer if a person might enter Chinese characters by looking at the browser's language setting using javascript 'navigator.language'.

 

Either way, add the outcome of the check to a hidden field that gets submitted to Marketo. Inside Marketo, if that field indicates likelihood of Chinese characters, then call the webhook to do the translation.

Darshil_Shah1
Level 10 - Community Advisor

Re: auto-translating data entered via form fills

You can use the Google Translate API! This can be setup to translate the form field data in Marketo using the Webhook. The JSON response will have the translated text in the parameter which can be mapped with the field Y per your question while setting up the webhook. You can also leverage Google's autodetection API which is fairly accurate in most cases if you're skeptical of the source language for translating data to the target language.

 

You can do a source language detection and validation to ensure the data is in a specific language before calling the translation api, i.e., if you want to translate only a certain language's data e.g., Chinese.

 

There is a cool little demo by Sandy here which although does translation on the form - but addresses a similar use case of data translation.

Hope this helps.

 

Tom_Liolios4
Level 4

Re: auto-translating data entered via form fills

Hi Darshil,

 

Many thanks for your feedback and sending over these links. Would you by any chance also have an example of this setup in Marketo? Would be great to see a demo of this process. I had a hard time getting Sanford's demo to work, as I'm not too familiar with JS.

 

Thanks!

Tom

Darshil_Shah1
Level 10 - Community Advisor

Re: auto-translating data entered via form fills

I'm afraid that I do not have this set up in an instance right now. Creating and using Webhooks in most cases is not that difficult once you refer some documentation though, and in-case you face any issues while setting this up - you can DM me or ask on the community where we have a sea of experts eager to help users.

Follow below steps to see Sandy's translation setup in action that uses the google APIs to translate English to German:

1. Navigate to the linked fiddle

2. Enter the data in English in the Comments field:

Darshil_Shah1_0-1646747550207.png

2. Hit Submit, the data gets translated to the DE in the Comments field:

Darshil_Shah1_1-1646747600542.png

I should have linked the original thread in my earlier comment, but it's linked here in case you wanna refer that.

Tom_Liolios4
Level 4

Re: auto-translating data entered via form fills

Thanks again Darshil!

 

I was able to adjust the 'translatesource' to Chinese and 'translatetarget' to English, and reproduce a correct translation from Chinese characters to an English company name.

 

I'll work with my IT team to investigate the webhook. Thanks! I'll mark your initial reply as correct.