title: conditional statement that checks current url root directory (/en/ or /cn/ languages in this case)
body: <p>My Magento website is bilingual (English default and Chinese), and has the Zopim livechat. Apparently, Zopim has language detection, but it didn't work for our website... I had a colleage use a Chinese computer with a Chinese IP and a Chinese browser visit the Chinese side of our website, and the Zopim live chat was STILL in English. So wtf? </p>
  
  <p>I contacted the Zopim support team and they gave me some code to "put on all the Chinese pages." However, that's not how my website actually operates. I have a language plug-in/extension that translates certain words on the default-English webpages by replacing those words with their Chinese counterparts in .CSV translation docs on the server, but the phtml pages themselves are not technically Chinese. They are still the default pages which run the translation function, when the root is /ch/ instead of /en/</p>
  
  <p>I thought maybe just putting it on the header.phtml block or the footer.phtml block might work, but actually those blocks are also just default blocks with the root-check-launches-translate feature built into it.</p>
  
  <p>This is the code the Zopim support rep gave me:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script type="text/javascript"&gt;
  $zopim(function(){
  $zopim.livechat.setLanguage('en');
  $zopim.livechat.bubble.setText('Click here for livechat!’);
  $zopim.livechat.badge.setText('test');
  $zopim.livechat.window.setTitle('Zopim Chat Support');
  $zopim.livechat.concierge.setTitle('Zopim Chat Support');
  $zopim.livechat.setGreetings({
  'online': ['online short message', 'online long message'],
  'offline': ['offline short message', 'offline long message']
  });
  });
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>So, can a simple conditional [IF] statement be added to the top of this that can check if the root is /ch/... [THEN] apply all the following code? Also, am I allowed to put that on the footer or header (which appear on all pages), or do I have to do add it to index.html (which for some reason I can't even find in the server)?</p>