title: Automatically Translate Website based on URL Parameter using Google Translate
body: <p>I have a Website which currently is only in English. However, we have a Google Translate widget which will translate the website to any language selected by the user. Here's the small snippet: </p>
  
  <pre><code>&lt;div id="google_translate_element"&gt;&lt;/div&gt;
  &lt;script type="text/javascript"&gt;
  function googleTranslateElementInit() {
      new google.translate.TranslateElement(
       {  pageLanguage: 'en', 
          layout: google.translate.TranslateElement.InlineLayout.SIMPLE
       }, 'google_translate_element');
  }
  &lt;/script&gt;
  &lt;script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Now, I will be routing some traffic from Spanish speaking users to the site. Considering I know these <strong>are</strong> spanish speaking users, is there any call I can make on the code to Automatically translate the website to Spanish (i.e to <strong>simulate</strong> a user selecting a given option on the Translate)? I'd be using a specific URL param, such as for example <strong>lang=spa</strong>. </p>
  
  <p>I tried browsing the code that gets inserted when the DIV is loaded, but it was just a very messy code to even look at. </p>
  
  <p>Has anyone tried such thing, can you provide a code bit to follow up from? </p>
  
  <p>Thanks.  </p>