title: Php web application internationalisation with Gettext();
body: <p>I am currently developping a PHP web app that needs to be available in French and English. I looked around and found that the Gettext() functionality offers the best performance.</p>
  
  <p>I generated my .pot file with the command </p>
  
  <pre><code> xgettext PhpFileToTranslate.php -o NameOfTemplateFile.pot
  </code></pre>
  
  <p>and successfuly generated a .pot file.
  I used PoEdit to generate messages.po file and created messages.mo</p>
  
  <p>Here are my server files :</p>
  
  <pre><code>/app
      /locale
          /en_US
                /LC_MESSAGES
                messages.po
                messages.mo
          /fr_FR
                /LC_MESSAGES
                messages.po
                messages.mo
          template.pot
  </code></pre>
  
  <p>And i set the locale in the php file like this :</p>
  
  <pre><code>$language = $_SESSION['language'];  //session contains 'fr_FR.UTF-8' or 'en_US.UTF-8'
  setlocale(LC_ALL, $language);
  bindtextdomain('messages', './locale');  
  textdomain('messages');
  </code></pre>
  
  <p>but i only see the label and not the translation...
  I tried putting 'fr_FR' instead of 'fr_FR.UTF-8' and all kinds of strings but it's not working.</p>
  
  <p>Am I missing something?
  My server is Ubuntu 12.04 Server with Apache and php5</p>