Image

Imagekriona wrote in Imagephp

Gettext

I have gettext up and running on my local machine without issue. It displays the pages in the correct language. However, when I upload it to the server, it displays text in English. Everything seems to be set up properly - the environment variable contains the language, textdomain() returns the correct file. The server is running PHP 4.3.9 while I am running PHP 5.2.8. There's also a difference in gettext verions: on server: msgfmt (GNU gettext-tools) 0.14.1, on local: msgfmt (GNU gettext-tools) 0.14.4. The MO files generated on the server are different from the ones generated on my local machine.

Does anybody know offhand what might be causing this? I don't have control over the server settings, so I'm going to have to ask the Apache admin to help, but I don't know what I should tell them.

This is the code I'm using the set up the environment:
/**
 * Set site language
 */
function language() {
	// Set locale
	putenv('LC_ALL='.$this->lang);
	setlocale(LC_ALL, $this->lang);
	$trans = 'site.'.$this->lang.'.'.$this->supportedLangs[$this->lang];
	// Specify location of translation tables
	bindtextdomain($trans, GBL.$this->locale);
	// Choose domain
	textdomain($trans);
}

Just to be clear, $this->lang will be the 2 character language (en, de) which specifies which language to use. $this->supportedLangs contains a version number (integer) to help me avoid Apache caching the MO files.