title: How do I use ResourceBundle::getLocales()?
body: <p>Given I have a directory <code>/locales</code> with the files <code>root.res</code> and <code>es.res</code>, which have been generated (using <code>genrb</code>) from the text files as follows:</p>
  
  <p>File: <code>root.txt</code></p>
  
  <pre><code>root:table {
      test:string { "My test text" }
  }
  </code></pre>
  
  <p>File: <code>es.txt</code></p>
  
  <pre><code>es:table {
      test:string { "Mi texto de prueba" }
  }
  </code></pre>
  
  <p>When I run the following code:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  $bundleName = 'locale';
  $resourceBundle = new ResourceBundle('es', $bundleName);
  echo join("\n", $resourceBundle-&gt;getLocales($bundleName));
  </code></pre>
  
  <p>I should see:</p>
  
  <pre><code>es
  root
  </code></pre>
  
  <p>However, the code produces:</p>
  
  <pre class="lang-none prettyprint-override"><code>Warning: join(): Invalid arguments passed...
  </code></pre>
  
  <p>This happens because <code>$resourceBundle -&gt;getLocales($bundleName)</code> returns <code>bool(false)</code>, but running the following code for locale <em>es</em>:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  $bundleName = 'locale';
  $resourceBundle = new ResourceBundle('es', $bundleName);
  echo ($resourceBundle-&gt;get('test') . "\n");
  </code></pre>
  
  <p>correctly outputs:</p>
  
  <pre class="lang-none prettyprint-override"><code>Mi texto de prueba
  </code></pre>
  
  <p>And running for locale <em>root</em>:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  $bundleName = 'locale';
  $resourceBundle = new ResourceBundle('root', $bundleName);
  echo ($resourceBundle-&gt;get('test') . "\n");
  </code></pre>
  
  <p>correctly outputs:</p>
  
  <pre class="lang-none prettyprint-override"><code>My test text
  </code></pre>
  
  <p>What do I need to do to make <code>getLocales()</code> work?</p>