title: How to change language for DataTable passing javascript variable
body: <p><a href="https://stackoverflow.com/questions/13342494/how-to-change-language-for-datatable?rq=1">how to change language for DataTable</a>
  We could use following code from the server end.</p>
  
  <pre><code>"oLanguage": {
    "sUrl": "media/language/custom_lang_&lt;?php echo $language ?&gt;.txt"
  }
  </code></pre>
  
  <p>Now I am using data table inside pentaho. I don't have access to the server side code. 
  Is it possible to change the url dynamically using a java script variable ?
  The following script is not working as the code is converted to a string. </p>
  
  <pre><code>if(locale=='sv'){
      return {"url": "/pentaho/api/repos/pentaho-cdf-dd/lang/rinjan/messages_sv.json"};
  }else{
      return {"url": "/pentaho/api/repos/pentaho-cdf-dd/lang/rinjan/messages_ge.json"}
  } 
  </code></pre>