title: Problem setting up gettext()
body: <p>I am working on a php application. Now I am trying to translate it into different languages.<br>
  To do it, I am using gettext(). But I have a problem on the configuration. I have the library correctly installed. I have <code>gettext(textToTranslate)</code> around the code and I have created with no problems .mo and .po files.  </p>
  
  <p>The configuration on my <code>index.php</code> is (working on xampp, Ubuntu):  </p>
  
  <pre><code>// Language
  $lang = 'es_ES';
  
  // Domain
  $text_domain = 'project';
  
  putenv('LC_ALL='.$lang);
  setlocale(LC_ALL, $lang);
  
  bindtextdomain($text_domain, './locale' );
  
  bind_textdomain_codeset($text_domain, 'UTF-8');
  
  textdomain($text_domain);
  </code></pre>
  
  <p>and my structure of files is:  </p>
  
  <pre><code>/opt/lampp/htdocs/blanca/gettext/locale/es_ES/LC_MESSAGES/project.po 
  /opt/lampp/htdocs/blanca/gettext/locale/es_ES/LC_MESSAGES/project.mo
  </code></pre>
  
  <p>But I am still seeing the code in English, qhich is the default language. Could anybody help me on this?? Thanks in advance</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>@ubuntu:~$ locale -a
  C
  es_AR.utf8
  es_BO.utf8
  es_CL.utf8
  es_CO.utf8
  es_CR.utf8
  es_DO.utf8
  es_EC.utf8
  es_ES.utf8
  es_GT.utf8
  es_HN.utf8
  es_MX.utf8
  es_NI.utf8
  es_PA.utf8
  es_PE.utf8
  es_PR.utf8
  es_PY.utf8
  es_SV.utf8
  es_US.utf8
  es_UY.utf8
  es_VE.utf8
  POSIX
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Running a little php script under <code>strace</code> comand</p>
  
  <pre><code>&lt;?php
  // Idioma
  
  $lang = 'es_ES.utf8';
  
  // Dominio
  
  $text_domain = 'blanca';
  
  // Dependiendo de tu OS putenv/setlocale configurarán tu idioma.
  
  putenv('LC_ALL='.$lang);
  
  setlocale(LC_ALL, $lang);
  
  
  
  // La ruta a los archivos de traducción
  
  bindtextdomain($text_domain, './gettext/locale' );
  // El codeset del textdomain
  
  bind_textdomain_codeset($text_domain, 'UTF-8');
  
  // El Textdomain
  textdomain($text_domain);
  
  // Print a test message
  echo gettext("User");
  
  
  // Or use the alias _() for gettext()
  echo _("User");
  ?&gt; 
  </code></pre>
  
  <p>Command: <code>strace -e trace=file -o test.txt  php prog.php</code>  </p>
  
  <blockquote>
    <p>getcwd("/opt/lampp/htdocs/blanca",
    4096) = 25
    lstat("/opt/lampp/htdocs/blanca/prog.php",
    {st_mode=S_IFREG|0644, st_size=521,
    ...}) = 0
    lstat("/opt/lampp/htdocs/blanca",
    {st_mode=S_IFDIR|0777, st_size=4096,
    ...}) = 0 lstat("/opt/lampp/htdocs",
    {st_mode=S_IFDIR|0755, st_size=4096,
    ...}) = 0 lstat("/opt/lampp",
    {st_mode=S_IFDIR|0755, st_size=4096,
    ...}) = 0 lstat("/opt",
    {st_mode=S_IFDIR|0755, st_size=4096,
    ...}) = 0
    getcwd("/opt/lampp/htdocs/blanca",
    4096) = 25
    lstat("/opt/lampp/htdocs/blanca/./locale",
    0x7fffb2c1a670) = -1 ENOENT (No such
    file or directory)
    open("/usr/share/locale/locale.alias",
    O_RDONLY) = 3
    open("/usr/share/locale/es_ES.utf8/LC_MESSAGES/blanca/gettext.mo",
    O_RDONLY) = -1 ENOENT (No such file or
    directory)
    open("/usr/share/locale/es_ES/LC_MESSAGES/blanca/gettext.mo",
    O_RDONLY) = -1 ENOENT (No such file or
    directory)
    open("/usr/share/locale/es.utf8/LC_MESSAGES/blanca/gettext.mo",
    O_RDONLY) = -1 ENOENT (No such file or
    directory)
    open("/usr/share/locale/es/LC_MESSAGES/blanca/gettext.mo",
    O_RDONLY) = -1 ENOENT (No such file or
    directory)
    open("/usr/share/locale-langpack/es_ES.utf8/LC_MESSAGES/blanca/gettext.mo",
    O_RDONLY) = -1 ENOENT (No such file or
    directory)
    open("/usr/share/locale-langpack/es_ES/LC_MESSAGES/blanca/gettext.mo",
    O_RDONLY) = -1 ENOENT (No such file or
    directory)
    open("/usr/share/locale-langpack/es.utf8/LC_MESSAGES/blanca/gettext.mo",
    O_RDONLY) = -1 ENOENT (No such file or
    directory)
    open("/usr/share/locale-langpack/es/LC_MESSAGES/blanca/gettext.mo",
    O_RDONLY) = -1 ENOENT (No such file or
    directory)</p>
  </blockquote>
  
  <pre><code>prog.php is located in my application directory.
  </code></pre>