I have created the translation files using poedit and generated the mo files and kept them in their respective folders. But somehow I can only access the translations which are in en_GB and en_US folders. even I place DE translation in these folders it works.
Why It is unable to work with other locale? Is there any configration which I need to make or I am missing something?
this is the code which I am using.
switch ($_GET['language']) {
case 'de' : $locale = 'de_DE'; break;
case 'us' : $locale = 'en_US'; break;
case 'fr' : $locale = 'fr_FR'; break;
case 'es' : $locale = 'es_ES'; break;
case 'it' : $locale = 'it_IT'; break;
default : $locale = 'en_GB'; break;
}
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale . '.UTF-8');
$domname = 'default';
bindtextdomain($domname, 'locale');
textdomain($domname);
bind_textdomain_codeset($domname, 'UTF-8');
echo gettext ("test123");
echo gettext ("hello every one");