Does anyone happen to know why a call to setlocale
would fail for a reason other than the locale package not existing. The following code:
$language = 'fr_CA.utf8';
//putenv("LANG=" . $language);
var_dump(setlocale(LC_ALL, $language));
// Set the text domain as "messages"
$domain = "messages";
$result = bindtextdomain($domain, ROOT_DIR . "../locale/");
bind_textdomain_codeset($domain, 'UTF-8');
$result = textdomain($domain);
echo _("IAMSOMETEXT");
echo $result;die;
outputs bool(false)
from the var_dump
. We are running the site in Vagrant, however I ran locale -a
on the VM, and fr_CA.utf8 was indeed in the output. I have tried other variations that were listed such as simply fr_CA.
Setting the locale to en_US.utf8 works perfectly however. POSIX does seem to work as well. Has anyone ran into this issue? We are running Ubuntu 12.04 on the VM.