Re: Translation

From: Date: Fri, 22 Mar 2002 15:14:53 +0000
Subject: Re: Translation
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3279@lists.php.net to get a copy of this message
Will this solution scale? I mean, you could have hundreds or even thousands of words per language that would have to be loaded. config_load loads the _entire_ config file into memory on the first hit, meaning it would load every word for every language. Maybe splitting out each language into a separate config file would scale better. But even so, you would still conceivably load thousands of words in a single language. So probably the best solution would be a plugin that pulls the translations from a faster datasource, such as a database or dbm file. Monte programisci_listy wrote: > > On 16 marca 2002 at 05:25:58 > olivier hericord <ohericord@free.fr> > wrote: > > > There's a lot of way to achieve a translation of a page... > > The text that has to be translated can be > > -Static > > -Dynamic > > > > An already given solution is to achieve the translation by creating a .conf > > file containing something like that: > > > > [en] > > hello="hello" > > other=... > > > > [de] > > hello="Bonjour" > > other=... > > > > The template will look like this: > > > > {config_load file="language.conf" section="$language"} > > <html> > > <body> > > {#hello#} > > </body> > > </html> > > > > It would be possible to use this way to translate a dynamic text if it was > > possible to write something like that in a Template : {#$TEXT#} > > $TEXT is a variable containing the name of the config variable that contains > > the text u want to translate.... > > I agree with you with 100%. > > -- > Jarek > > --- > You are currently subscribed to smarty as: monte@ispi.net > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at > http://www.phpinsider.com/php/code/Smarty/ -- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.

« previous php.smarty.general (#3279) next »