Some gettext keys aren't working for me - they show the key instead of the translation, though there is one. I'm making .mo file with PHP File_Gettext
Pear library, and it seems to be working ok, so I've made the following script to try out, which keys aren't working fine:
$locale = 'en_GB';
$domain = 'messages';
setlocale(LC_ALL, $locale);
putenv("LC_ALL=".$locale);
bindtextdomain($domain, "D:/_gt");
bind_textdomain_codeset($domain, 'UTF-8');
textdomain($domain);
$mocreator = new File_Gettext_MO();
$mocreator->load('D:/_gt/en_GB/LC_MESSAGES/messages.mo');
foreach ($mocreator->strings as $key => $value) {
if ($value == gettext($key)) {
var_dump("ok");
} else {
var_dump($key, $value, gettext($key));
}
}
From the output of the above I see that some keys work - I see a lot of ok
s - and some don't, yielding the following:
string 'Cancelled' (length=9)
string 'Storniert' (length=9)
string 'Cancelled' (length=9)
So there is translation in the file, but gettext fails to use them for some reason.