|
From: Todd O. <to...@da...> - 2001-03-23 21:37:41
|
As an ongoing project we should think about a better way to make phpWebSite multi-lingual on demand. We are only multi-lingual before installation. I'd like to see the user profile containing his/her default language preference. Large case statements are too slow. phpmyadmin using the following language include file scheme: english.inc.php $strAPrimaryKey = "A primary key has been added on "; $strAccessDenied = "Access denied"; german.inc.php $strAPrimaryKey = "Ein Primarschlssel wurde fur folgendes Feld hinzugefegt: "; $strAccessDenied = "Zugriff verweigert."; Has anyone used this many DEFINE statements in an include file? Were there any performance issues? The php code would have to pull the user's session_id and get his/her language preference from the user database before including the appropriate language "define" file. Who would like to toss ideas in on this one? --Todd |
|
From: Jason C. <cam...@xp...> - 2001-03-23 21:49:53
|
I was looking at a source of another portal that implemented languages on demand. I'll look at the source and see how its fully implemented throughout the code. > As an ongoing project we should think about a better way to make > phpWebSite multi-lingual on demand. We are only multi-lingual before > installation. I'd like to see the user profile containing his/her > default language preference. > > Large case statements are too slow. > > phpmyadmin using the following language include file scheme: > > english.inc.php > $strAPrimaryKey = "A primary key has been added on "; > $strAccessDenied = "Access denied"; > > german.inc.php > $strAPrimaryKey = "Ein Primarschlssel wurde fur folgendes Feld > hinzugefegt: "; > $strAccessDenied = "Zugriff verweigert."; > > Has anyone used this many DEFINE statements in an include file? Were > there any performance issues? > > The php code would have to pull the user's session_id and get his/her > language preference from the user database before including the > appropriate language "define" file. > > Who would like to toss ideas in on this one? > > --Todd > > > > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > http://lists.sourceforge.net/lists/listinfo/phpwebsite-developers |
|
From: Karsten D. <k.d...@tu...> - 2001-03-26 14:17:28
|
On Fri, Mar 23, 2001 at 04:36:55PM -0500, Todd Owen wrote: > As an ongoing project we should think about a better way to make phpWebSi= te > multi-lingual on demand. We are only multi-lingual before installation. > I'd like to see the user profile containing his/her default language > preference. I like the current way of doing this. I disliked it at first, but the reasons for the current approach are good (if you don't have to have multiple languages, it is (a lot) faster). But I see the need for on demand language switching. > phpmyadmin using the following language include file scheme: >=20 > english.inc.php > [...] > german.inc.php > [...] > Has anyone used this many DEFINE statements in an include file? Were the= re > any performance issues? I think this is the most common approach. To me it seems to have no deep impact on speed. But I would use a different scheme. I would include the appropriate language file, which would contain statements like $TRANSLATE["xxx"]=3D"fgdsfhsk"; This way we could introduce this very easily into the existing code base. In fact I am going to code this, and make it available as one more "language" when running makedistro.sh. Does anyone object on this? I think we should at least try this... Combined with a new theme engine, which really should have cacheing abilities, you could minimise the performance impact some more. And if you switch language files on the fly by using a prefix, you could even use the same prefix as databse prefix, theme prefix, whatever. This way you could even have language specific colours, content, ... Regards, Karsten --=20 Why do we have to hide from the police, daddy? Because we use emacs, son. They use vi. ----------------------------- mailto:k.d...@tu... w=B3: http://www.k-fish.de/ gpg: http://www.k-fish.de/mykeys.gpg |
|
From: Karsten D. <k.d...@tu...> - 2001-03-26 18:44:19
|
On Mon, Mar 26, 2001 at 02:41:50PM +0200, Karsten Dambekalns wrote: > impact on speed. But I would use a different scheme. I would include the > appropriate language file, which would contain statements like > $TRANSLATE["xxx"]=3D"fgdsfhsk"; OK, I did that. I am able to produce an appropriate sed file and the corresponding *.lang files. > This way we could introduce this very easily into the existing code base.= In > fact I am going to code this, and make it available as one more "language" > when running makedistro.sh. Does anyone object on this? I think we should= at > least try this... Here I have been too fast. It is in fact easy to let sed do the work. But there are 2 cases: 1. We have something like echo "TRANSLATE[[Login]]" This could be replaced by echo "".$TRANSLATE["Login"]."" very easily, and all should be well. But this would break if there was one statement like echo TRANSLATE[[something]] (note the missing quotes) which is unlikely (I think) but would come out of the process as echo "$TRANSLATE["something"]" (note the wrong quotes) All in all not very nice, but it would work (read: until we have a better solution) 2. We have something like <?php ... ?> <p>TRANSLATE[[Login]]</p> <?php ... ?> Now this breaks about everything. This doesn't work. Sigh. Please consider my steeping forward to be grinded to a unwanted halt. That is - unless someone has a very bright idea... besides seperating code and presentation very cleanly. Regards, Karsten --=20 Why do we have to hide from the police, daddy? Because we use emacs, son. They use vi. ----------------------------- mailto:k.d...@tu... w=B3: http://www.k-fish.de/ gpg: http://www.k-fish.de/mykeys.gpg |
|
From: Todd O. <to...@da...> - 2001-03-26 19:47:44
|
Karsten, your idea is GREAT! I would have never thought of creating this scheme as another language and leaving the existing TRANSLATE statements in the code, which will make it much faster for single language users. As we code, the group needs to remember your caveats for not breaking the translations. --Todd |
|
From: Jason C. <cam...@xp...> - 2001-03-26 20:00:29
|
That method is actually the same one that PHP-Nuke uses :) I was looking at the code of that a few weeks ago and thats how they do multi-language. > Karsten, your idea is GREAT! I would have never thought of creating > this scheme as another language and leaving the existing TRANSLATE > statements in the code, which will make it much faster for single > language users. > > As we code, the group needs to remember your caveats for not breaking > the translations. > > --Todd > > > > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > http://lists.sourceforge.net/lists/listinfo/phpwebsite-developers |
|
From: Karsten D. <k.d...@tu...> - 2001-03-27 10:51:25
|
On Mon, Mar 26, 2001 at 03:09:02PM -0500, Jason Campbell wrote: > That method is actually the same one that PHP-Nuke uses :) I was looking= =20 > at the code of that a few weeks ago and thats how they do multi-language. I din't know that! Really! It just seemed to be the fastest and easiest solution :-) But alas... Regards, Karsten --=20 Why do we have to hide from the police, daddy? Because we use emacs, son. They use vi. ----------------------------- mailto:k.d...@tu... w=B3: http://www.k-fish.de/ gpg: http://www.k-fish.de/mykeys.gpg |
|
From: Karsten D. <k.d...@tu...> - 2001-03-27 10:51:25
|
On Mon, Mar 26, 2001 at 02:46:43PM -0500, Todd Owen wrote: > Karsten, your idea is GREAT! I would have never thought of creating this > scheme as another language and leaving the existing TRANSLATE statements = in > the code, which will make it much faster for single language users. Thanks! :o) > As we code, the group needs to remember your caveats for not breaking the > translations. Yes, definitely :-/ Any idea on how many TRANSLATE statements are in static HTML actually? Maybe my idea was not to far from being successful, but I didn't try after I wrote my email yesterday... Regards, Karsten --=20 Why do we have to hide from the police, daddy? Because we use emacs, son. They use vi. ----------------------------- mailto:k.d...@tu... w=B3: http://www.k-fish.de/ gpg: http://www.k-fish.de/mykeys.gpg |
|
From: Alain F. <al...@va...> - 2001-03-26 20:23:19
|
Hi, There is a very nice translation system for PHP around that is called stPHP. It can use one or several text files as a string table, or DBM style 'database' files. As for a template system, I really love the "Smarty" template system. It is the fastest and most flexible I have yet seen. The combination of these two systems is as dynamic as dynamic can get ! :) Relevant links: http://sourceforge.net/projects/stphp http://www.phpinsider.com/php/code/Smarty/ Talk to you later ! |
|
From: Christian S. <chr...@sc...> - 2001-03-26 20:38:23
|
Alain Fontaine schrieb: > There is a very nice translation system for PHP around that is called stPHP. > It can use one or several text files as a string table, or DBM style > 'database' files. > > As for a template system, I really love the "Smarty" template system. It is > the fastest and most flexible I have yet seen. > > The combination of these two systems is as dynamic as dynamic can get ! :) Let me give my two cents: We should be *very* careful with dynamic functions that aren't absolutely necessary. Just a few weeks ago I have seen a large server (Sun's 4-digit E-Series!) handling an Oracle database and six load balanced Apache web servers collapsing because of excessive dynamic and personalisation functions. This combination was expected to handle a minimum 12 million page impressions per month. In fact it wasn't able to handle one million! On a normal Pentium/Linux Server you can easily reach this point of collapse with less than a hundred requests per hour. I'm wondering, if Nuke's bad performance might have something to do with dynamic language processing. Just a question, not a theory. Chris |
|
From: Alain F. <al...@va...> - 2001-03-27 08:52:49
|
Hi Christian and the rest of the world :) I agree that you make a point there, however, I can't imagine how a configuration like the one you are describing could be doing so bad. I guess it's because 1. it was badly programmed 2. it was using Oracle? :). We are currently running www.luxusbuerg.lu, which is a 100% PHP4 / mySQL solution, on a bi-pentium3 800 box with 1 GB of ram and a raid5 disk array. Single server, that is. We are handling 4 million page views a month without a single problem. Of course it all depends on what you are customizing, etc. Anyway, I was just pointing out the existence of these two tools for those who didn't know them yet. As to whether we include them in phpWebSite or not is open to public discussion of course ! Anyway, as far as the languages go, I think the first minimum enhancement that needs to be somehow done is to give the webmasters the possibility to set/fix/enhance their translations themselves, maybe by giving them instructions on how to "compile" the translated version themselves, with their own string tables. I am currently waiting for a clue on how to fix the french translation of phpWebSite for a customer of my company, for instance. We have spent a great deal of time customizing his phpWebSite as he wanted it, but we can't take it to production just yet because the french translation needs to be fixed. If someone tells me how to do that, you'll have a great french translation up in no time :) For those who wonder: I am from Luxembourg, and this makes that I speak Luxembourgish, German, French, English, and a very little bit of spanish. Translations needed, anyone ? :) I wonder what the demand for a Luxembourgish phpWebSite would look like... 2 or 3 users world-wide ? :)) > -----Message d'origine----- > De : php...@li... > [mailto:php...@li...]De la part de > Christian Schims > Envoye : lundi 26 mars 2001 22:40 > A : php...@li... > Objet : Re: [Phpwebsite-developers] Templates, multi-language > > > Alain Fontaine schrieb: > > > There is a very nice translation system for PHP around that is > called stPHP. > > It can use one or several text files as a string table, or DBM style > > 'database' files. > > > > As for a template system, I really love the "Smarty" template > system. It is > > the fastest and most flexible I have yet seen. > > > > The combination of these two systems is as dynamic as dynamic > can get ! :) > > Let me give my two cents: We should be *very* careful with > dynamic functions > that aren't absolutely necessary. Just a few weeks ago I have seen a large > server (Sun's 4-digit E-Series!) handling an Oracle database and six load > balanced Apache web servers collapsing because of excessive dynamic and > personalisation functions. This combination was expected to > handle a minimum > 12 million page impressions per month. In fact it wasn't able to > handle one > million! > > On a normal Pentium/Linux Server you can easily reach this point > of collapse > with less than a hundred requests per hour. I'm wondering, if Nuke's bad > performance might have something to do with dynamic language processing. > Just a question, not a theory. > > Chris > > > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > http://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > |
|
From: RODRIGUES N. <nu...@pt...> - 2001-03-27 10:13:00
|
Letzebuerg :-) -----Original Message----- From: php...@li... [mailto:php...@li...]On Behalf Of Alain Fontaine Sent: Tuesday, March 27, 2001 10:53 AM To: php...@li... Subject: RE: [Phpwebsite-developers] Templates, multi-language Hi Christian and the rest of the world :) I agree that you make a point there, however, I can't imagine how a configuration like the one you are describing could be doing so bad. I guess it's because 1. it was badly programmed 2. it was using Oracle? :). We are currently running www.luxusbuerg.lu, which is a 100% PHP4 / mySQL solution, on a bi-pentium3 800 box with 1 GB of ram and a raid5 disk array. Single server, that is. We are handling 4 million page views a month without a single problem. Of course it all depends on what you are customizing, etc. Anyway, I was just pointing out the existence of these two tools for those who didn't know them yet. As to whether we include them in phpWebSite or not is open to public discussion of course ! Anyway, as far as the languages go, I think the first minimum enhancement that needs to be somehow done is to give the webmasters the possibility to set/fix/enhance their translations themselves, maybe by giving them instructions on how to "compile" the translated version themselves, with their own string tables. I am currently waiting for a clue on how to fix the french translation of phpWebSite for a customer of my company, for instance. We have spent a great deal of time customizing his phpWebSite as he wanted it, but we can't take it to production just yet because the french translation needs to be fixed. If someone tells me how to do that, you'll have a great french translation up in no time :) For those who wonder: I am from Luxembourg, and this makes that I speak Luxembourgish, German, French, English, and a very little bit of spanish. Translations needed, anyone ? :) I wonder what the demand for a Luxembourgish phpWebSite would look like... 2 or 3 users world-wide ? :)) > -----Message d'origine----- > De : php...@li... > [mailto:php...@li...]De la part de > Christian Schims > Envoye : lundi 26 mars 2001 22:40 > A : php...@li... > Objet : Re: [Phpwebsite-developers] Templates, multi-language > > > Alain Fontaine schrieb: > > > There is a very nice translation system for PHP around that is > called stPHP. > > It can use one or several text files as a string table, or DBM style > > 'database' files. > > > > As for a template system, I really love the "Smarty" template > system. It is > > the fastest and most flexible I have yet seen. > > > > The combination of these two systems is as dynamic as dynamic > can get ! :) > > Let me give my two cents: We should be *very* careful with > dynamic functions > that aren't absolutely necessary. Just a few weeks ago I have seen a large > server (Sun's 4-digit E-Series!) handling an Oracle database and six load > balanced Apache web servers collapsing because of excessive dynamic and > personalisation functions. This combination was expected to > handle a minimum > 12 million page impressions per month. In fact it wasn't able to > handle one > million! > > On a normal Pentium/Linux Server you can easily reach this point > of collapse > with less than a hundred requests per hour. I'm wondering, if Nuke's bad > performance might have something to do with dynamic language processing. > Just a question, not a theory. > > Chris > > > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > http://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > _______________________________________________ Phpwebsite-developers mailing list Php...@li... http://lists.sourceforge.net/lists/listinfo/phpwebsite-developers |
|
From: Christian S. <chr...@sc...> - 2001-03-27 17:02:50
|
RODRIGUES Nuno wrote: > > I agree that you make a point there, however, I can't imagine how a > configuration like the one you are describing could be doing so bad. I guess > it's because 1. it was badly programmed 2. it was using Oracle? :). We are > currently running www.luxusbuerg.lu, which is a 100% PHP4 / mySQL solution, > on a bi-pentium3 800 box with 1 GB of ram and a raid5 disk array. Single > server, that is. We are handling 4 million page views a month without a > single problem. Of course it all depends on what you are customizing, etc. > Anyway, I was just pointing out the existence of these two tools for those > who didn't know them yet. As to whether we include them in phpWebSite or not > is open to public discussion of course ! No, it was because the content management system (Open Market) had to generate 33 database requests (ok, including stock modules and other complicated personalized stuff), wait for them to be completed and then parse all information through the specific template in order to generate dynamic HTML content. That's all I wanted to say: Shall we parse every single page of phpWS in order to say: "hey, we're a little slow, but we are multi-lingual". Or say it the other way around: Shall we generate such server load although maybe 90% of all sites will have an output of more than 90% in one single language? Again: Just a question, not a statement. If you have seen the Sun dying, it's hard to believe the penguin will survive... ;-) Chris |
|
From: Alain F. <al...@va...> - 2001-03-27 17:48:10
|
Hi, How about offering the two versions? One multi-language template based, and the other "pre-compiled". That way the user could chose what best suits him. > -----Message d'origine----- > De : php...@li... > [mailto:php...@li...]De la part de > Christian Schims > Envoye : mardi 27 mars 2001 19:02 > A : php...@li... > Objet : Re: [Phpwebsite-developers] Templates, multi-language > > > RODRIGUES Nuno wrote: > > > > I agree that you make a point there, however, I can't imagine how a > > configuration like the one you are describing could be doing so > bad. I guess > > it's because 1. it was badly programmed 2. it was using Oracle? > :). We are > > currently running www.luxusbuerg.lu, which is a 100% PHP4 / > mySQL solution, > > on a bi-pentium3 800 box with 1 GB of ram and a raid5 disk array. Single > > server, that is. We are handling 4 million page views a month without a > > single problem. Of course it all depends on what you are > customizing, etc. > > Anyway, I was just pointing out the existence of these two > tools for those > > who didn't know them yet. As to whether we include them in > phpWebSite or not > > is open to public discussion of course ! > > No, it was because the content management system (Open Market) had to > generate 33 database requests (ok, including stock modules and other > complicated personalized stuff), wait for them to be completed and then > parse all information through the specific template in order to generate > dynamic HTML content. > > That's all I wanted to say: Shall we parse every single page of phpWS in > order to say: "hey, we're a little slow, but we are multi-lingual". Or > say it the other way around: Shall we generate such server load although > maybe 90% of all sites will have an output of more than 90% in one > single language? Again: Just a question, not a statement. > > If you have seen the Sun dying, it's hard to believe the penguin will > survive... ;-) > > Chris > > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > http://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > |
|
From: Karsten D. <k.d...@tu...> - 2001-03-27 10:51:27
|
On Tue, Mar 27, 2001 at 10:52:45AM +0200, Alain Fontaine wrote: > We have spent a great deal of time customizing his phpWebSite as he wanted > it, but we can't take it to production just yet because the french > translation needs to be fixed. If someone tells me how to do that, you'll > have a great french translation up in no time :) Check out the README.makedistro (from CVS, go to the phpWebSite download page), it is the docs directory. This should help you. Regards, Karsten --=20 Why do we have to hide from the police, daddy? Because we use emacs, son. They use vi. ----------------------------- mailto:k.d...@tu... w=B3: http://www.k-fish.de/ gpg: http://www.k-fish.de/mykeys.gpg |
|
From: Mike W. <wi...@ce...> - 2001-03-26 20:53:22
|
I don't know if any of you follow nuke at all but someone there came up with a multilingual switching code. You can read the article at http://www.phpnuke.org/article.php?sid=1355&mode=thread&order=0&thold=0 and see his code at http://www.openbsd.org.mx/~santana/diff Mike From: "Alain Fontaine" <al...@va...> To: <php...@li...> Sent: Monday, March 26, 2001 2:22 PM Subject: [Phpwebsite-developers] Templates, multi-language > Hi, > > There is a very nice translation system for PHP around that is called stPHP. > It can use one or several text files as a string table, or DBM style > 'database' files. > > As for a template system, I really love the "Smarty" template system. It is > the fastest and most flexible I have yet seen. > > The combination of these two systems is as dynamic as dynamic can get ! :) > > Relevant links: > > http://sourceforge.net/projects/stphp > > http://www.phpinsider.com/php/code/Smarty/ > > Talk to you later ! > > > > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > http://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > > |