I work on a website, written in PHP, and I included translations via PoEdit/Gettext. On my local MAMP Server on my Mac everything is working fine. When I upload it to the Linux server of my Webhoster it is not working. Safe Mode is off and Gettext is enabled - I already checked that.
I do the following:
if (isset($_GET['lang'])) {
$language = $_GET['lang'];
} else {
$language = "en_EN";
}
putenv("LANG=" . $language);
setlocale(LC_ALL, $language);
// Set the text domain as "s5m"
$domain = "s5m";
bindtextdomain($domain, "languages");
bind_textdomain_codeset($domain, 'UTF-8');
textdomain($domain);
.mo / .po file is stored at and are named s5m.po / s5m.mo
/languages/en_EN/LC_MESSAGES/
Does anybody know why it is working on my local, but not on my poster's web server? My internal links after the language has been switched are file.php?lang=en_EN
Any suggestions? Thanks!
I have the solutiion. The web server does not support "en_EN" - the server supports "en_US". I had to change this in the coding and in the folder structure. Thats it...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.