Re: [SMARTY] smarty and GNU gettext

[email protected] ("Vicente Werner") Tue, 30 May 2006 17:14:56 +0200
Newsgroups php.smarty.general
Message-ID <[email protected]>
On 5/30/06, D_C <[email protected]> wrote:
>
> is this really the case? Wordpress and Drupal both use gettext and PO
> files, and yet I cant imagine people in shared hosting restarting
> apache...


From the php manual:
winXP, PHP 4.3.5 as Apache1.3.29 module

Two hints for Windows users.

I found setting locale is neither sufficient nor nessecery. To get it work I
needed to set either LC_ALL or LANG enviroment variable to my locale. Anyway
this value must be proper for setlocale so it is good to test with it. In my
case it was bgr_BGR for bulgarian according to
http://www.unicode.org/onlinedat/countries.html

gettext checks for files once and keeps them in cashe. Especially it means
that if it doesn't find your files it won't search again, so restart Apache
after any directory changes!!

I know it's a windows specific issue, but I've seen similar issues on linux
machines.

mean that smarty cannot pre-compile the templates?


Not at all, my system just uses such marks to store the string for future
translation , which is done as a last step, after everything is rendered.

also, for performance and clean templates, what about just using config
> files?
>
> {#someString#}


They're clumsy and unmanageable when the ammount of translation items and
languages goes beyond a certain limit. A db is much more manageable.

of course, some kind of management GUI would be needed for building
> the config files, but this isnt too big a deal.
>

You can have  a q&d web front end in less than an hour, adapted to your
needs.

-- 
Vicente Werner y Sánchez