title: PHP gettext on Windows
body: <p>There are some tutorials out there for gettext (with Poedit)... unfortunately, it's mostly for a UNIX environment. And even more unfortunate is that I am running my WAMP server on Windows XP (but I am developing for a UNIX environment) and none of the tutorials can get gettext working properly for me. From the <a href="https://www.php.net/manual/en/book.gettext.php" rel="nofollow noreferrer">manual page</a>, it appears that it's a different process on a Windows environment. I've tried out some of the solutions in the comments but I still can't get it to work! I've spent many hours on this, hopefully someone can point me in the right direction to get this thing to work! (And I'm sure there are others out there who share my frustration.) So far with my setup, I'm only getting output "Hello World!" whereas I should be getting the translated string.</p>
  
  <p>Here is my setup/code so far:</p>
  
  <pre><code>// test.php
  if (!defined('LC_MESSAGES')) {
      define('LC_MESSAGES', 6);
  }
  
  $locale = "deu_DEU"; // apparently the locales are different on a WINDOWS platform
  
  putenv("LC_ALL=$locale");
  setlocale(LC_ALL, $locale);
  bindtextdomain("greetings", ".\locale");
  textdomain("greetings");
  
  echo _("Hello World"); 
  </code></pre>
  
  <p>Folder structure</p>
  
  <pre>
  root:     C:\Program Files\WampServer 2\www
  test.php: C:\Program Files\WampServer 2\www\site
  .po:      C:\Program Files\WampServer 2\www\site\locale\deu_DEU\LC_MESSAGES\greetings.po
  .mo:      C:\Program Files\WampServer 2\www\site\locale\deu_DEU\LC_MESSAGES\greetings.mo
  </pre>