Re: gettext: changed .mo file, caching issue

From: Date: Mon, 29 Sep 2003 08:24:09 +0000
Subject: Re: gettext: changed .mo file, caching issue
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-164204@lists.php.net to get a copy of this message
daniel hahler wrote:
This works good, but if the .mo file gets changed the old content is returned by calls to gettext, until I restart Apache.
gettext uses a caching method to speed up looking translation strings, which explain why Apache must be reloaded [1] Setting all LANG, LANGUAGE and LC_ALL _seems_ mandatory to avoid problems with some servers (I saw this with win2000 and linux). That's really poorly documented in [2], like the path used to find the .mo files Ex for french: wich of fr/ fr_BE/, fr_FR/, french/ ? Answer depend on OS (win/unix), server (locale config, env vars, ...) and I dont know what (sometimes uses fr when fr_BE dont exist)... Perhaps you can try php-i18n mailing list, which is really low traffic. [1] GNU gettext info manual GNU `gettext' caches previous translation results. When the same translation is requested twice, with no new message catalogs being loaded in between, `gettext' will, the second time, find the result through a single cache lookup. [2] PHP Manual http://www.php.net/manual/en/function.gettext.php Christophe

« previous php.general (#164204) next »