title: Read local file in Phonegap
body: <p>I'm trying to read a local file in Phonegap to load the language strings for the application and I can't make it work :(</p>
  
  <p>The code is pretty straightforward:</p>
  
  <pre><code>var pathToLocalFile = "/home/user/android/assets/www/js/";
  var langCache = new FileReader();
  langCache.onload = function(data){
    col = JSON.parse(data);
    refreshAllStrings();
  };
  langCache.onerror = function(err){
    debug.error(err);
  };
  langCache.readAsText(pathToLocalFile+currentLang+'.json');
  </code></pre>
  
  <p>This code doesn't work on the Ripple emulator and I replaced it with</p>
  
  <pre><code>var pathToLocalFile = "file:///android_asset/www/js/";
  </code></pre>
  
  <p>in case of android, with the same result:</p>
  
  <pre><code>Uncaught TypeError: Object #&lt;Console&gt; has no method 'warning' cordova-2.4.0.js:2616
  initRead cordova-2.4.0.js:2616
  FileReader.readAsText cordova-2.4.0.js:2660    
  loadLanguage
  </code></pre>
  
  <p>In the Ripple emulator, I started Chrome with <code>google-chrome -–allow-file-access-from-files</code> and the Android config and manifest has all the permissions for and the plugins set.</p>
  
  <p>Of course I'm missing something, but any idea what this could be?</p>
  
  <p>Regards.</p>