Blog

Adding Google Translate to Your Salesforce Forms

Blog

Adding Google Translate to Your Salesforce Forms

Blog

Adding Google Translate to Your Salesforce Forms

Blog

Adding Google Translate to Your Salesforce Forms

Blog

Adding Google Translate to Your Salesforce Forms

Download PDFDownload PDF
Blog

Adding Google Translate to Your Salesforce Forms

Lacey Jackson
/
September 19, 2019
Blog

Adding Google Translate to Your Salesforce Forms

MIN
/
September 19, 2019
About the Episode
Episode Highlights
Meet our Guest
Episode Transcript

We recently shared how you can create an automated customer feedback process using Formstack for Salesforce. However, if you’re serving customers across multiple countries, you may need to translate your feedback forms into multiple languages. But creating an individual form and email campaign for each customer language is costly and time intensive. So, we’ve created a better way. With Formstack for Salesforce, you can allow users to automatically translate your forms into their preferred language using the Google Translate API

Formstack’s Salesforce app supports HTML, but it does not allow you to directly use script tags within the Salesforce form builder. Today, I’m going to show you an easy workaround. Here’s how to add a Google Translate language picklist to your form in three easy steps.

Step 1: Adding the Google Translate script to your form. 

Salesforce general text field

After you’ve built your form, we’re going to need to make a few tweaks. First, we’re going to add a General Text Field to act as a placeholder for the Google Translate button. Open up the field options and double click "Text" to edit. 

Salesforce general text field

Add the <div> element below field. Insert the phrase “Google Translate” before your <div> element. When you close your field settings, your <div> element will disappear and the “Google Translate” text will help you to locate it in the next steps. Your text should look like this: </div></div></div>

Google Translate <div id="google_translate_element"></div>

Step 2: Create the picklist with Javascript.

Next, we’re going to use Javascript to create our picklist. Don’t worry, we’re sharing the complete version below so you don’t need to write a single line of code. We’ll get started on this step by navigating to “Form Settings.”

Salesforce form settings

Within your form settings, scroll down to the section labeled “Javascript Code.” Here, we’ll dynamically create the script tag.

Salesforce Javascript code

You will need to dynamically create the script tag when the form is loaded by adding the following code to the Javascript Code area. Simply scroll to the bottom of the code as it appears and paste the following script into the box.

function googleTranslateElementInit() {

new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');

}

function FF_OnAfterRender()

{

var d = document,

     b = d.getElementById('google_translate_element'),

     js = d.createElement('script');

     js.type='text/javascript';

  /* The below source is the same as the one in the script tag in the sample  */

js.src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';

     b.appendChild(js);

}

Step 3: Publish! 

Close the Form Settings, and publish your form! Now, a Google Translate picklist and button will appear for your users to translate the form into their preferred language. Your final form should look something like this:

Salesforce form with Google Translate picklist button shown.

It’s that easy! However, if you have any issues or questions about adding Google Translate to your Salesforce app forms, don’t hesitate to reach out to our Customer Support team. They’ll be happy to assist. 

 

If you haven’t tried out Formstack for Salesforce, why not? You can access this functionality and much more by starting a free trial of our native form builder today.

TRY IT FREE

Blog

Adding Google Translate to Your Salesforce Forms

Blog

Adding Google Translate to Your Salesforce Forms

Get the Report

Great, thank ya!

You can now access the content.
Oops! Something went wrong while submitting the form.
Blog

Adding Google Translate to Your Salesforce Forms

Panelists
No items found.
Introduction
Introduction

Great, thank ya!

You can now access the content.
Download NowDownload Now
Oops! Something went wrong while submitting the form.

We recently shared how you can create an automated customer feedback process using Formstack for Salesforce. However, if you’re serving customers across multiple countries, you may need to translate your feedback forms into multiple languages. But creating an individual form and email campaign for each customer language is costly and time intensive. So, we’ve created a better way. With Formstack for Salesforce, you can allow users to automatically translate your forms into their preferred language using the Google Translate API

Formstack’s Salesforce app supports HTML, but it does not allow you to directly use script tags within the Salesforce form builder. Today, I’m going to show you an easy workaround. Here’s how to add a Google Translate language picklist to your form in three easy steps.

Step 1: Adding the Google Translate script to your form. 

Salesforce general text field

After you’ve built your form, we’re going to need to make a few tweaks. First, we’re going to add a General Text Field to act as a placeholder for the Google Translate button. Open up the field options and double click "Text" to edit. 

Salesforce general text field

Add the <div> element below field. Insert the phrase “Google Translate” before your <div> element. When you close your field settings, your <div> element will disappear and the “Google Translate” text will help you to locate it in the next steps. Your text should look like this: </div></div></div>

Google Translate <div id="google_translate_element"></div>

Step 2: Create the picklist with Javascript.

Next, we’re going to use Javascript to create our picklist. Don’t worry, we’re sharing the complete version below so you don’t need to write a single line of code. We’ll get started on this step by navigating to “Form Settings.”

Salesforce form settings

Within your form settings, scroll down to the section labeled “Javascript Code.” Here, we’ll dynamically create the script tag.

Salesforce Javascript code

You will need to dynamically create the script tag when the form is loaded by adding the following code to the Javascript Code area. Simply scroll to the bottom of the code as it appears and paste the following script into the box.

function googleTranslateElementInit() {

new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');

}

function FF_OnAfterRender()

{

var d = document,

     b = d.getElementById('google_translate_element'),

     js = d.createElement('script');

     js.type='text/javascript';

  /* The below source is the same as the one in the script tag in the sample  */

js.src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';

     b.appendChild(js);

}

Step 3: Publish! 

Close the Form Settings, and publish your form! Now, a Google Translate picklist and button will appear for your users to translate the form into their preferred language. Your final form should look something like this:

Salesforce form with Google Translate picklist button shown.

It’s that easy! However, if you have any issues or questions about adding Google Translate to your Salesforce app forms, don’t hesitate to reach out to our Customer Support team. They’ll be happy to assist. 

 

If you haven’t tried out Formstack for Salesforce, why not? You can access this functionality and much more by starting a free trial of our native form builder today.

TRY IT FREE

Panelists
No items found.
Infographic

Adding Google Translate to Your Salesforce Forms

Make your forms accessible to any user by adding this Google Translate feature to your forms in Formstack Salesforce app. Learn how!
Download InfographicDownload Infographic

We recently shared how you can create an automated customer feedback process using Formstack for Salesforce. However, if you’re serving customers across multiple countries, you may need to translate your feedback forms into multiple languages. But creating an individual form and email campaign for each customer language is costly and time intensive. So, we’ve created a better way. With Formstack for Salesforce, you can allow users to automatically translate your forms into their preferred language using the Google Translate API

Formstack’s Salesforce app supports HTML, but it does not allow you to directly use script tags within the Salesforce form builder. Today, I’m going to show you an easy workaround. Here’s how to add a Google Translate language picklist to your form in three easy steps.

Step 1: Adding the Google Translate script to your form. 

Salesforce general text field

After you’ve built your form, we’re going to need to make a few tweaks. First, we’re going to add a General Text Field to act as a placeholder for the Google Translate button. Open up the field options and double click "Text" to edit. 

Salesforce general text field

Add the <div> element below field. Insert the phrase “Google Translate” before your <div> element. When you close your field settings, your <div> element will disappear and the “Google Translate” text will help you to locate it in the next steps. Your text should look like this: </div></div></div>

Google Translate <div id="google_translate_element"></div>

Step 2: Create the picklist with Javascript.

Next, we’re going to use Javascript to create our picklist. Don’t worry, we’re sharing the complete version below so you don’t need to write a single line of code. We’ll get started on this step by navigating to “Form Settings.”

Salesforce form settings

Within your form settings, scroll down to the section labeled “Javascript Code.” Here, we’ll dynamically create the script tag.

Salesforce Javascript code

You will need to dynamically create the script tag when the form is loaded by adding the following code to the Javascript Code area. Simply scroll to the bottom of the code as it appears and paste the following script into the box.

function googleTranslateElementInit() {

new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');

}

function FF_OnAfterRender()

{

var d = document,

     b = d.getElementById('google_translate_element'),

     js = d.createElement('script');

     js.type='text/javascript';

  /* The below source is the same as the one in the script tag in the sample  */

js.src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';

     b.appendChild(js);

}

Step 3: Publish! 

Close the Form Settings, and publish your form! Now, a Google Translate picklist and button will appear for your users to translate the form into their preferred language. Your final form should look something like this:

Salesforce form with Google Translate picklist button shown.

It’s that easy! However, if you have any issues or questions about adding Google Translate to your Salesforce app forms, don’t hesitate to reach out to our Customer Support team. They’ll be happy to assist. 

 

If you haven’t tried out Formstack for Salesforce, why not? You can access this functionality and much more by starting a free trial of our native form builder today.

TRY IT FREE

We recently shared how you can create an automated customer feedback process using Formstack for Salesforce. However, if you’re serving customers across multiple countries, you may need to translate your feedback forms into multiple languages. But creating an individual form and email campaign for each customer language is costly and time intensive. So, we’ve created a better way. With Formstack for Salesforce, you can allow users to automatically translate your forms into their preferred language using the Google Translate API

Formstack’s Salesforce app supports HTML, but it does not allow you to directly use script tags within the Salesforce form builder. Today, I’m going to show you an easy workaround. Here’s how to add a Google Translate language picklist to your form in three easy steps.

Step 1: Adding the Google Translate script to your form. 

Salesforce general text field

After you’ve built your form, we’re going to need to make a few tweaks. First, we’re going to add a General Text Field to act as a placeholder for the Google Translate button. Open up the field options and double click "Text" to edit. 

Salesforce general text field

Add the <div> element below field. Insert the phrase “Google Translate” before your <div> element. When you close your field settings, your <div> element will disappear and the “Google Translate” text will help you to locate it in the next steps. Your text should look like this: </div></div></div>

Google Translate <div id="google_translate_element"></div>

Step 2: Create the picklist with Javascript.

Next, we’re going to use Javascript to create our picklist. Don’t worry, we’re sharing the complete version below so you don’t need to write a single line of code. We’ll get started on this step by navigating to “Form Settings.”

Salesforce form settings

Within your form settings, scroll down to the section labeled “Javascript Code.” Here, we’ll dynamically create the script tag.

Salesforce Javascript code

You will need to dynamically create the script tag when the form is loaded by adding the following code to the Javascript Code area. Simply scroll to the bottom of the code as it appears and paste the following script into the box.

function googleTranslateElementInit() {

new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');

}

function FF_OnAfterRender()

{

var d = document,

     b = d.getElementById('google_translate_element'),

     js = d.createElement('script');

     js.type='text/javascript';

  /* The below source is the same as the one in the script tag in the sample  */

js.src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';

     b.appendChild(js);

}

Step 3: Publish! 

Close the Form Settings, and publish your form! Now, a Google Translate picklist and button will appear for your users to translate the form into their preferred language. Your final form should look something like this:

Salesforce form with Google Translate picklist button shown.

It’s that easy! However, if you have any issues or questions about adding Google Translate to your Salesforce app forms, don’t hesitate to reach out to our Customer Support team. They’ll be happy to assist. 

 

If you haven’t tried out Formstack for Salesforce, why not? You can access this functionality and much more by starting a free trial of our native form builder today.

TRY IT FREE

Collecting payments with online forms is easy, but first, you have to choose the right payment gateway. Browse the providers in our gateway credit card processing comparison chart to find the best option for your business. Then sign up for Formstack Forms, customize your payment forms, and start collecting profits in minutes.

Online Payment Gateway Comparison Chart

NOTE: These amounts reflect the monthly subscription for the payment provider. Formstack does not charge a fee to integrate with any of our payment partners.

FEATURES
Authorize.Net
Bambora
Chargify
First Data
PayPal
PayPal Pro
PayPal Payflow
Stripe
WePay
ProPay
Monthly Fees
$25
$25
$149+
Contact First Data
$0
$25
$0-$25
$0
$0
$4
Transaction Fees
$2.9% + 30¢
$2.9% + 30¢
N/A
Contact First Data
$2.9% + 30¢
$2.9% + 30¢
10¢
$2.9% + 30¢
$2.9% + 30¢
$2.6% + 30¢
Countries
5
8
Based on payment gateway
50+
203
3
4
25
USA
USA
Currencies
11
2
23
140
25
23
25
135+
1
1
Card Types
6
13
Based on payment gateway
5
9
9
5
6
4
4
Limits
None
None
Based on payment gateway
None
$10,000
None
None
None
None
$500 per transaction
Form Payments
Recurring Billing
Mobile Payments
PSD2 Compliant

We recently shared how you can create an automated customer feedback process using Formstack for Salesforce. However, if you’re serving customers across multiple countries, you may need to translate your feedback forms into multiple languages. But creating an individual form and email campaign for each customer language is costly and time intensive. So, we’ve created a better way. With Formstack for Salesforce, you can allow users to automatically translate your forms into their preferred language using the Google Translate API

Formstack’s Salesforce app supports HTML, but it does not allow you to directly use script tags within the Salesforce form builder. Today, I’m going to show you an easy workaround. Here’s how to add a Google Translate language picklist to your form in three easy steps.

Step 1: Adding the Google Translate script to your form. 

Salesforce general text field

After you’ve built your form, we’re going to need to make a few tweaks. First, we’re going to add a General Text Field to act as a placeholder for the Google Translate button. Open up the field options and double click "Text" to edit. 

Salesforce general text field

Add the <div> element below field. Insert the phrase “Google Translate” before your <div> element. When you close your field settings, your <div> element will disappear and the “Google Translate” text will help you to locate it in the next steps. Your text should look like this: </div></div></div>

Google Translate <div id="google_translate_element"></div>

Step 2: Create the picklist with Javascript.

Next, we’re going to use Javascript to create our picklist. Don’t worry, we’re sharing the complete version below so you don’t need to write a single line of code. We’ll get started on this step by navigating to “Form Settings.”

Salesforce form settings

Within your form settings, scroll down to the section labeled “Javascript Code.” Here, we’ll dynamically create the script tag.

Salesforce Javascript code

You will need to dynamically create the script tag when the form is loaded by adding the following code to the Javascript Code area. Simply scroll to the bottom of the code as it appears and paste the following script into the box.

function googleTranslateElementInit() {

new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');

}

function FF_OnAfterRender()

{

var d = document,

     b = d.getElementById('google_translate_element'),

     js = d.createElement('script');

     js.type='text/javascript';

  /* The below source is the same as the one in the script tag in the sample  */

js.src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';

     b.appendChild(js);

}

Step 3: Publish! 

Close the Form Settings, and publish your form! Now, a Google Translate picklist and button will appear for your users to translate the form into their preferred language. Your final form should look something like this:

Salesforce form with Google Translate picklist button shown.

It’s that easy! However, if you have any issues or questions about adding Google Translate to your Salesforce app forms, don’t hesitate to reach out to our Customer Support team. They’ll be happy to assist. 

 

If you haven’t tried out Formstack for Salesforce, why not? You can access this functionality and much more by starting a free trial of our native form builder today.

TRY IT FREE

We recently shared how you can create an automated customer feedback process using Formstack for Salesforce. However, if you’re serving customers across multiple countries, you may need to translate your feedback forms into multiple languages. But creating an individual form and email campaign for each customer language is costly and time intensive. So, we’ve created a better way. With Formstack for Salesforce, you can allow users to automatically translate your forms into their preferred language using the Google Translate API

Formstack’s Salesforce app supports HTML, but it does not allow you to directly use script tags within the Salesforce form builder. Today, I’m going to show you an easy workaround. Here’s how to add a Google Translate language picklist to your form in three easy steps.

Step 1: Adding the Google Translate script to your form. 

Salesforce general text field

After you’ve built your form, we’re going to need to make a few tweaks. First, we’re going to add a General Text Field to act as a placeholder for the Google Translate button. Open up the field options and double click "Text" to edit. 

Salesforce general text field

Add the <div> element below field. Insert the phrase “Google Translate” before your <div> element. When you close your field settings, your <div> element will disappear and the “Google Translate” text will help you to locate it in the next steps. Your text should look like this: </div></div></div>

Google Translate <div id="google_translate_element"></div>

Step 2: Create the picklist with Javascript.

Next, we’re going to use Javascript to create our picklist. Don’t worry, we’re sharing the complete version below so you don’t need to write a single line of code. We’ll get started on this step by navigating to “Form Settings.”

Salesforce form settings

Within your form settings, scroll down to the section labeled “Javascript Code.” Here, we’ll dynamically create the script tag.

Salesforce Javascript code

You will need to dynamically create the script tag when the form is loaded by adding the following code to the Javascript Code area. Simply scroll to the bottom of the code as it appears and paste the following script into the box.

function googleTranslateElementInit() {

new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');

}

function FF_OnAfterRender()

{

var d = document,

     b = d.getElementById('google_translate_element'),

     js = d.createElement('script');

     js.type='text/javascript';

  /* The below source is the same as the one in the script tag in the sample  */

js.src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';

     b.appendChild(js);

}

Step 3: Publish! 

Close the Form Settings, and publish your form! Now, a Google Translate picklist and button will appear for your users to translate the form into their preferred language. Your final form should look something like this:

Salesforce form with Google Translate picklist button shown.

It’s that easy! However, if you have any issues or questions about adding Google Translate to your Salesforce app forms, don’t hesitate to reach out to our Customer Support team. They’ll be happy to assist. 

 

If you haven’t tried out Formstack for Salesforce, why not? You can access this functionality and much more by starting a free trial of our native form builder today.

TRY IT FREE

We recently shared how you can create an automated customer feedback process using Formstack for Salesforce. However, if you’re serving customers across multiple countries, you may need to translate your feedback forms into multiple languages. But creating an individual form and email campaign for each customer language is costly and time intensive. So, we’ve created a better way. With Formstack for Salesforce, you can allow users to automatically translate your forms into their preferred language using the Google Translate API

Formstack’s Salesforce app supports HTML, but it does not allow you to directly use script tags within the Salesforce form builder. Today, I’m going to show you an easy workaround. Here’s how to add a Google Translate language picklist to your form in three easy steps.

Step 1: Adding the Google Translate script to your form. 

Salesforce general text field

After you’ve built your form, we’re going to need to make a few tweaks. First, we’re going to add a General Text Field to act as a placeholder for the Google Translate button. Open up the field options and double click "Text" to edit. 

Salesforce general text field

Add the <div> element below field. Insert the phrase “Google Translate” before your <div> element. When you close your field settings, your <div> element will disappear and the “Google Translate” text will help you to locate it in the next steps. Your text should look like this: </div></div></div>

Google Translate <div id="google_translate_element"></div>

Step 2: Create the picklist with Javascript.

Next, we’re going to use Javascript to create our picklist. Don’t worry, we’re sharing the complete version below so you don’t need to write a single line of code. We’ll get started on this step by navigating to “Form Settings.”

Salesforce form settings

Within your form settings, scroll down to the section labeled “Javascript Code.” Here, we’ll dynamically create the script tag.

Salesforce Javascript code

You will need to dynamically create the script tag when the form is loaded by adding the following code to the Javascript Code area. Simply scroll to the bottom of the code as it appears and paste the following script into the box.

function googleTranslateElementInit() {

new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');

}

function FF_OnAfterRender()

{

var d = document,

     b = d.getElementById('google_translate_element'),

     js = d.createElement('script');

     js.type='text/javascript';

  /* The below source is the same as the one in the script tag in the sample  */

js.src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';

     b.appendChild(js);

}

Step 3: Publish! 

Close the Form Settings, and publish your form! Now, a Google Translate picklist and button will appear for your users to translate the form into their preferred language. Your final form should look something like this:

Salesforce form with Google Translate picklist button shown.

It’s that easy! However, if you have any issues or questions about adding Google Translate to your Salesforce app forms, don’t hesitate to reach out to our Customer Support team. They’ll be happy to assist. 

 

If you haven’t tried out Formstack for Salesforce, why not? You can access this functionality and much more by starting a free trial of our native form builder today.

TRY IT FREE

We recently shared how you can create an automated customer feedback process using Formstack for Salesforce. However, if you’re serving customers across multiple countries, you may need to translate your feedback forms into multiple languages. But creating an individual form and email campaign for each customer language is costly and time intensive. So, we’ve created a better way. With Formstack for Salesforce, you can allow users to automatically translate your forms into their preferred language using the Google Translate API

Formstack’s Salesforce app supports HTML, but it does not allow you to directly use script tags within the Salesforce form builder. Today, I’m going to show you an easy workaround. Here’s how to add a Google Translate language picklist to your form in three easy steps.

Step 1: Adding the Google Translate script to your form. 

Salesforce general text field

After you’ve built your form, we’re going to need to make a few tweaks. First, we’re going to add a General Text Field to act as a placeholder for the Google Translate button. Open up the field options and double click "Text" to edit. 

Salesforce general text field

Add the <div> element below field. Insert the phrase “Google Translate” before your <div> element. When you close your field settings, your <div> element will disappear and the “Google Translate” text will help you to locate it in the next steps. Your text should look like this: </div></div></div>

Google Translate <div id="google_translate_element"></div>

Step 2: Create the picklist with Javascript.

Next, we’re going to use Javascript to create our picklist. Don’t worry, we’re sharing the complete version below so you don’t need to write a single line of code. We’ll get started on this step by navigating to “Form Settings.”

Salesforce form settings

Within your form settings, scroll down to the section labeled “Javascript Code.” Here, we’ll dynamically create the script tag.

Salesforce Javascript code

You will need to dynamically create the script tag when the form is loaded by adding the following code to the Javascript Code area. Simply scroll to the bottom of the code as it appears and paste the following script into the box.

function googleTranslateElementInit() {

new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');

}

function FF_OnAfterRender()

{

var d = document,

     b = d.getElementById('google_translate_element'),

     js = d.createElement('script');

     js.type='text/javascript';

  /* The below source is the same as the one in the script tag in the sample  */

js.src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';

     b.appendChild(js);

}

Step 3: Publish! 

Close the Form Settings, and publish your form! Now, a Google Translate picklist and button will appear for your users to translate the form into their preferred language. Your final form should look something like this:

Salesforce form with Google Translate picklist button shown.

It’s that easy! However, if you have any issues or questions about adding Google Translate to your Salesforce app forms, don’t hesitate to reach out to our Customer Support team. They’ll be happy to assist. 

 

If you haven’t tried out Formstack for Salesforce, why not? You can access this functionality and much more by starting a free trial of our native form builder today.

TRY IT FREE

We recently shared how you can create an automated customer feedback process using Formstack for Salesforce. However, if you’re serving customers across multiple countries, you may need to translate your feedback forms into multiple languages. But creating an individual form and email campaign for each customer language is costly and time intensive. So, we’ve created a better way. With Formstack for Salesforce, you can allow users to automatically translate your forms into their preferred language using the Google Translate API

Formstack’s Salesforce app supports HTML, but it does not allow you to directly use script tags within the Salesforce form builder. Today, I’m going to show you an easy workaround. Here’s how to add a Google Translate language picklist to your form in three easy steps.

Step 1: Adding the Google Translate script to your form. 

Salesforce general text field

After you’ve built your form, we’re going to need to make a few tweaks. First, we’re going to add a General Text Field to act as a placeholder for the Google Translate button. Open up the field options and double click "Text" to edit. 

Salesforce general text field

Add the <div> element below field. Insert the phrase “Google Translate” before your <div> element. When you close your field settings, your <div> element will disappear and the “Google Translate” text will help you to locate it in the next steps. Your text should look like this: </div></div></div>

Google Translate <div id="google_translate_element"></div>

Step 2: Create the picklist with Javascript.

Next, we’re going to use Javascript to create our picklist. Don’t worry, we’re sharing the complete version below so you don’t need to write a single line of code. We’ll get started on this step by navigating to “Form Settings.”

Salesforce form settings

Within your form settings, scroll down to the section labeled “Javascript Code.” Here, we’ll dynamically create the script tag.

Salesforce Javascript code

You will need to dynamically create the script tag when the form is loaded by adding the following code to the Javascript Code area. Simply scroll to the bottom of the code as it appears and paste the following script into the box.

function googleTranslateElementInit() {

new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');

}

function FF_OnAfterRender()

{

var d = document,

     b = d.getElementById('google_translate_element'),

     js = d.createElement('script');

     js.type='text/javascript';

  /* The below source is the same as the one in the script tag in the sample  */

js.src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';

     b.appendChild(js);

}

Step 3: Publish! 

Close the Form Settings, and publish your form! Now, a Google Translate picklist and button will appear for your users to translate the form into their preferred language. Your final form should look something like this:

Salesforce form with Google Translate picklist button shown.

It’s that easy! However, if you have any issues or questions about adding Google Translate to your Salesforce app forms, don’t hesitate to reach out to our Customer Support team. They’ll be happy to assist. 

 

If you haven’t tried out Formstack for Salesforce, why not? You can access this functionality and much more by starting a free trial of our native form builder today.

TRY IT FREE

Lacey Jackson
As a Product Marketing Manager at Formstack, Lacey is dedicated to creating content that showcases the power of the Formstack platform. When she’s not creating Formstack Builders tutorials, she can be found reading, playing board games, or strolling with her dog. Lacey is a graduate of Franklin College.
More Articles
Meet The Host
CEO of
Connect
Chris is on a mission to turn people into great leaders. He's passionate about helping problem solvers see more value in the work they do every day.