Re: [PHP] multilanguage site: performance question: included file with cases?

2003-09-19 Thread daniel hahler
on Wed, 17 Sep 2003 21:08:31 + 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. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] multilanguage site: performance question: included file with cases?

2003-09-17 Thread daniel hahler
Hello listmembers,

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.

This works good, but this file is growing and I thought about how to
handle this.

Two things came in mind:
1. Split the content parts and use a different include file for each
section.
2. Do a switch ($site-curMenu) in the lang_xx.php and define only
what is needed for current section.

The first option is not so good, as I would have up to 10 new files.
And when thinking of the second option, I thought that it could be
even more performant, if you had a static included file, as this could
be cached somehow.

So, what to do?

And: hello to all, it's my first post here. :)


-- 
shinE!
http://www.thequod.de ICQ#152282665
I'm sitting in silence. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] multilanguage site: performance question: included file with cases?

2003-09-17 Thread Curt Zirzow
* Thus wrote daniel hahler ([EMAIL PROTECTED]):
 Hello listmembers,
 
 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.
 
 This works good, but this file is growing and I thought about how to
 handle this.
 
 Two things came in mind:
 1. Split the content parts and use a different include file for each
 section.
 2. Do a switch ($site-curMenu) in the lang_xx.php and define only
 what is needed for current section.


 
 The first option is not so good, as I would have up to 10 new files.
 And when thinking of the second option, I thought that it could be
 even more performant, if you had a static included file, as this could
 be cached somehow.
 
 So, what to do?
 

I would suggest using gettext it will make the application real
flexible. I havn't used it but from what I've seen it really is
simple to use. Plus it keeps your translations completely seperate
from your program.

http://php.net/manual/en/ref.gettext.php


 And: hello to all, it's my first post here. :)

Hello and Welcome.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php