Re: multilanguage site: performance question: included file with cases?

From: Date: Fri, 19 Sep 2003 12:04:41 +0000
Subject: Re: multilanguage site: performance question: included file with cases?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-163127@lists.php.net to get a copy of this message
on Wed, 17 Sep 2003 21:08:31 +0000 Curt Zirzow wrote: >> I'm building up a site which should be german and english. So I have a >> site object which remembers this choice during the session and do a >> include('lang_'.$site->lang.'.php'); >> in my topmost.php. CZ> I would suggest using gettext it will make the application real CZ> flexible. I havn't used it but from what I've seen it really is CZ> simple to use. Plus it keeps your translations completely seperate CZ> from your program. CZ> http://php.net/manual/en/ref.gettext.php Thanks for your suggestion. I looked around, but did not get it working properly at first, because of strange behaviour of setlocale and no documentation (just many different comments on php.net) what is used to initialize gettext. after some hours I'm down to this code: putenv('LANGUAGE='.$site->lang); bindtextdomain ("tqV2", "./locale"); textdomain ("tqV2"); and it works.. :) But the same performance question resists: should I put all strings in one .po file or seperate them? Regarding collecting of already entered strings: there exists a tool called xgettext, which can parse the .php files and creates a .po file with all strings, but I'm unable to find a port for win32.. :/ -- shinE! http://www.thequod.de ICQ#152282665 PGP 8.0 key: http://thequod.de/danielhahler.asc Apollo Four Forty - Alcatraz Within The Joint Remix vs. @440 rocks.

« previous php.general (#163127) next »