1

I have a mo file

/data/lang/en_US/LC_MESSAGES/test.mo (translate foo => bar)

and use the following code to echo it

$locale = 'en_US'; 
$locale_dir = '/data/lang';
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain('test', $locale_dir);
textdomain('test');
echo _("foo"); // print foo

However, if I change

$locale = 'en_US.utf8'; 

Then it print the corrected answer, bar

And my system locale information:

locale -a
..
en_US
en_US.utf8
..

What would be the reason?

Ryan
  • 10,041
  • 27
  • 91
  • 156
  • For what it's worth - I can't reproduce this on either Mac or Linux. Perhaps you could post the PO source? – Tim May 13 '13 at 17:48

0 Answers0