Enabling Google Translation on Your Website

Here you will find instructions on how to update your header file to enable Google translation on your website.

How it works:

We are using the Google translation software. What you will see once you make your code change is a button in the statewide nav bar that reads "Translate." If you click it, a disclaimer window appears with a Select Disclaimer language drop down. The user may select from Spanish, Chinese - Simplifie, and Chinese - Traditional. Two buttons at the bottom of the disclaimer will either take you to the selected language (Spanish, Chinese - Simplified, Chinese - Traditional) version of the pages, or Cancel to close the disclaimer window.

The disclaimer explains that while we recognize that the Google translation feature is not perfect, the benefits outweigh its shortcomings.

How to set it up:

Download the Translate button:

Download image by right-clicking the following and selecting "Save image as": Translate button

Copy the downloaded image to the exact path of the website root folder: \egov\img\translate_button.png

Find this code in the heading of your site:

Screen shot of the code segment you'll need to edit

Replace the line:


with the the following:

Locate and verify that the translate function is enabled.  The following line:

document.getElementById('mdgov_sliverRight').innerHTML = showStatewideNavigation("white");

Should be replaced with this one:

document.getElementById('mdgov_sliverRight').innerHTML = showStatewideNavigationWithTranslate("white");

How to get help:

DoIT staff can assist with code changes and troubleshooting. Please submit requests as always to the Help Desk service.desk@maryland.gov