smarty and GNU gettext

From: Date: Tue, 30 May 2006 12:11:05 +0000
Subject: smarty and GNU gettext
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-13440@lists.php.net to get a copy of this message
hi list - there is a great GNU library for dealing with localisation, that has a php function gettext() http://www.php.net/manual/en/function.gettext.php many high-end PHP projects use this (wordpress, drupal). I was wondering if there is a way to use this with smarty? basically gettext is a php function, so if this is used in the middle of a smarty template, it will make templates really ugly. I think! Unless there is a clean way to inline php funcs inside smarty... also, since a php funciton is being called in the middle of a template, i imagine this stops smarty from being able to pre-compie/ cache the template itself? So, any suggested approaches? Can a modifier function work directly on a string? eg if i created a localize() modifier that called gettext, then: had a template like this: { "message list" | localize } rather than puttig the english "message list" in a separate tag to be passed to smarty: {$messageListTag|localize} this would require all the tags to be read in ahead of time, and another level of indirection + probably reading lots of irrelevant tags per page. thanks for any help as always! /dc -- _______________________________________________ David "DC" Collier dc@pikkle.com skype: callto://d3ntaku http://www.pikkle.com +81 (0)80 6521 9559 http://charajam.com 【★キャラ♪ジャム★】 人気キャラとJ-POP最新ヒット曲を自分で組み合わせて 待受Flashや着Flashを作っちゃおう! _______________________________________________

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