Re: SV: translation patch

From: Date: Thu, 10 May 2001 12:19:37 +0000
Subject: Re: SV: translation patch
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-719@lists.php.net to get a copy of this message
Hi, On Thu, May 10, 2001 at 12:37:20PM +0200, Tomas Sanchez Romani wrote: > -in the script: > $smarty->assign("locLang", "sv"); > $smarty->assign("locMech", "internalfile"); > $smarty->assign("locPath", "c:/program/apache > group/apache/htdocs/cz2/inc/locale/"); > -in the template: > {translate strId="hello" locLang=$locLang locMech=$locMech locPath=$locPath} > Ok, this is problably not even close to the best solution, so is some one > feels like helping me out on this one, please do. Hmm, this way the whole translation thing is not more then additional variables that are included in the template. If the translated strings would be cached in their own directory, you could save a lot of function calls. (I'm not sure how the translating engine you use stores the translations; if it's in a database, this method would correspond to one database call per string that has to be translated. Caching translated strings could would give a substantial performance gain.) Just my thoughts ofcourse. cheers, roel

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