using gettext with smarty
| From: | James E. Flemer | Date: | Fri, 14 Mar 2003 01:22:16 +0000 |
| Subject: | using gettext with smarty | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-8631@lists.php.net to get a copy of this message | ||
Has anyone used GNU Gettext in conjunction with Smarty? I see
several ways of doing this. One is to use a function/block etc,
so the string look-up is done at run time, or to use a
prefilter. The prefilter would need to compile different
versions for each language setting. For now I was just trying
to use the first approach, since it is much easier. However, I
want to preserve the standard gettext style, like:
_("Smarty doesn't like this style.") or
gettext("Smarty doesn't like this style.")
The problem is that functions have to look like:
{gettext msg="Smarty is fine with this."} or even
{_ _="Smarty is fine with this."} or
{"This is ok, too."|gettext} etc.
If I use something that Smarty likes, then the gettext tools
don't work (to extract the message catalog). Does anyone have
suggestions, or better yet something already implemented? I'd
rather do this with a plugin, tho modifying Smarty is an option.
-James