Home > Enterprise >  How do I add a google translate button in browser address bar in html CSS website?
How do I add a google translate button in browser address bar in html CSS website?

Time:10-26

Can anyone please suggest me how to add translate button in my HTML,CSS website so that the costumer can easily choose the language as their preference.. Please refer the following image.. Refer this image

I am creating a website for the client in French language but I've created the whole website in English language so please enlighten me how I can make it readable by the French users.

CodePudding user response:

Just incase, you could use the Google Translate API Reference like this

    <script type ="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

CodePudding user response:

Maybe this can help you find the answer: How to add google translate button

CodePudding user response:

you can't add it in the browser address bar but you can add it to your site

<div id="google_translate_element"></div>
<script>
    function googleTranslateElementInit() {
        new google.translate.TranslateElement(
            {pageLanguage: 'en'},
            'google_translate_element'
        );
    }
</script>
<script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
  • Related