title: How can I debug php gettext?
body: <p>Some gettext keys aren't working for me - they show the key instead of the translation, though there is one. I'm making .mo file with PHP <code>File_Gettext</code> Pear library, and it seems to be working ok, so I've made the following script to try out, which keys aren't working fine:</p>
  
  <pre><code>$locale = 'en_GB';
  $domain = 'messages';
  
  setlocale(LC_ALL, $locale);
  putenv("LC_ALL=".$locale);
  bindtextdomain($domain, "D:/_gt");
  bind_textdomain_codeset($domain, 'UTF-8');
  textdomain($domain);
  
  $mocreator = new File_Gettext_MO();
  $mocreator-&gt;load('D:/_gt/en_GB/LC_MESSAGES/messages.mo');
  
  foreach ($mocreator-&gt;strings as $key =&gt; $value) {
      if ($value == gettext($key)) {
          var_dump("ok");
      } else {
          var_dump($key, $value, gettext($key));
      }
  }
  </code></pre>
  
  <p>From the output of the above I see that some keys work - I see a lot of <code>ok</code>s - and some don't, yielding the following:</p>
  
  <pre><code>string 'Cancelled' (length=9)
  string 'Storniert' (length=9)
  string 'Cancelled' (length=9)
  </code></pre>
  
  <p>So there is translation in the file, but gettext fails to use them for some reason.</p>