title: How do I create ICU resource files for use in PHP?
body: <p>I'm following the instructions from BryanH's answer here: <a href="https://stackoverflow.com/questions/5644412/gettext-equivalent-in-intl-library">gettext() equivalent in Intl library?</a> and trying to implement localization (translation) with php-intl, but I keep getting the same problem this person had: <a href="https://stackoverflow.com/questions/6256937/resourcebundle-returns-null-without-any-errors-being-raised">ResourceBundle returns NULL without any errors being raised</a></p>
  
  <p>He mentions he created the dat files with a tool (which I cannot figure out how to work) while the person in the former answer simply appears to be using txt files with a .res extension.</p>
  
  <p>How do I properly implement localization with php-intl and ResourceBundle, and what am I doing wrong?</p>
  
  <p>The goal is to have various data files with different languages so I can do something similar to </p>
  
  <pre><code>$t = new Translator();
  $t-&gt;setResource(new \ResourceBundle('es', 'locales_folder/'));
  $t-&gt;echo("somestring"); // "el stringo"
  </code></pre>
  
  <p>..much like the person in the first answer had. Also, the aim is to have easily editable files, so I can give them to translators for fixes, updates, and so on. I realize I could easily do this with custom solution through a simple text file which gets parsed and saved into memcache on first request, where it then persists and gets served from without having to re-read the .dat files, but I'd rather take the suggested route here.</p>
  
  <p>Edit: Just to get it out there - I implemented the same thing with gettext successfully and it was dead easy - save for one bug that persists across linux systems (<a href="http://www.php.net/manual/en/book.gettext.php#91187" rel="nofollow noreferrer">http://www.php.net/manual/en/book.gettext.php#91187</a>) - but I'd like to rely on the more modern and all-inclusive intl extension if possible.</p>