Smarty and I18N
| From: | Thomas Lamy | Date: | Thu, 17 Oct 2002 00:56:45 +0000 |
| Subject: | Smarty and I18N | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6180@lists.php.net to get a copy of this message | ||
Hi,
I'm using smarty for 3 weeks now, and have only an idea of how I would
create a site with internationalisation.
I'd like to have different levels of i18n: words/phrases (like table
headings or input labels), and text blocks (about more than 1 sentence worth
of text).
I have a similar project (single language) up and running for 2 years, and
get about 200 SQL queries/sec peak, so adding addition load by using a
(relationsl) database is not really an option.
I thought of implementing the words/phrases thing with simple PHP arrays,
and text blocks using some smart include() function, which either includes
the "right" template (say "login_en.tpl"), and, if that file doesn't exist,
fall back to include a generic template (eg "login.tpl").
I'm not really sure if my approach is really The Right Thing (tm), and how
to do that with smarty (especially auto-including language templates with
fallback), by not breaking caching.
Any help out there?
Thomas