Recent searches
No recent searches
Insert Google Translate widget to your Helpcenter
Posted Oct 24, 2017
If manually translating 250 articles of your help center to 6 different (or more) languages is not an option for you, here is a quick guide on how to insert the free Google translate widget to your help center and providing a “good enough” automated translation.
Keep in mind that Google Translate widget does not cover the translation of search nor of the screenshots (obviously..).
You can check out what it looks like and how it works here: https://support.aodocs.com
Note:
The following steps are done from the newest version of the Guite Theme editor.
We are going to go it in 4 steps:
1. Insert the script to your Help Center |
2. Insert the button in the Guide Header |
3. Modify the look of the Button |
4. Modify the look of the Dropdown menu |
1. Insert the script in the Guide document_head.hbs
- Access your Guide admin interface
- Open your theme
- Access the templates
- Select the document_head.hbs
- Add the following code:
<!-- Load the Google Translate Widget --> |
2. Insert the button in the Guide Header
Once this the script is added, the script will launch every time the page loads and adds the widget (we are not done yet). We are going to insert it in the Header of the Guide interface so that it is always visible to the users.
- Access your Guide admin interface
- Open your theme
- Access the templates
- Select the header.hbs
- Add the following code at the location in the header where you want the widget to be:
<div id="google_translate_element" class="dropdown"></div> |
In the standard Copenhagen theme it would look like this when added to the nav-wrapper:
<header class="header"> |
3. Modify the look of the Button
Then you will probably want to customize the look and feel of the Google Translate widget from the CSS file.
Here is I have configured it:
- Access your Guide admin interface
- Open your theme
- Access the style.css
- Add the following code at the bottom of the CSS file
/**************** Google Translate widget ***********/ |
4. Modify the look of the Dropdown menu
Also you will perhaps want to customize the look of the drop-down (it is an iFrame)
For that you will need to add some javascript:
Here is I have configured it:
- Access your Guide admin interface
- Open your theme
- Access the script.js
- Add the following code at the bottom of the Script file
Note:
In the following example the style to inject in the iFrame is store as a Zendesk Asset:
//p4.zdassets.com/hc/theme_assets/549775/200068704/google-translate-override.css
To customize it:
1. create your own .css file
- upload it in your zendesk assets
- Replace the href value with your asset link
// Customize the Google Translate dropdown style |
0
34 comments
Vivian Piloto
Hi!
That's an awesome post. Thanks for the tips and great explanation.
I'm heaving some trouble here and was wondering if somebody can help me.
I just implemented in my site but i need to block the translations for some words that appears constantly like products name. How can I do that? Which code or function is better? I want something that i can apply directly in the Theme, and not in every article HTML.
0
Viktor Osetrov
Thanks for your feedback. For disabling Google Translate from translating specific words or blocks you should modify Help Center CSS. For example, you can built-in the CSS class “notranslate” which will prevent Google from translating any words wrapped within that class.
Hope it helps,
0
Vivian Piloto
Hi @...
Thanks for the tip! I read this and tried the class but the thing is that in this solution i I'll have to put the "notranslate" in every article one by one in the article HTML right? I was wondering if there's a solution were I can put the code in the Theme and block for all the pages since there are more than 300 articles in my Helpcenter.
0
Viktor Osetrov
Did you try updating entire HTML blocks via div or span class?
For example,
<span
class=”notranslate”><p>Don’t Translate Me</p></span>
Please follow Help center templating cookbook and Customizing your help center theme
Hope it helps,
0