troubleshooting Question

Smarty include paramater not translating

Avatar of Matthew_Way
Matthew_Way asked on
PHP
12 Comments1 Solution1009 ViewsLast Modified:
PHP 5.2.0, Apache 2.0, Smarty 2.6.18

I'm working on a multilingual PHP application, using the Smarty / Gettext extension (available on source forge).

The gettext extension works well and allows phrases within smarty templates to be translated.
for example;
<span> {t}Hello World{/t}</span>
becomes (in French)
<span>bonjour monde</span>

The problem is we have a number of custom functions and included templates we need to pass translated parameter text.
for example;
{include file="operations/include/contact_list.tpl" table_tile="{t}Company Contacts{/t}" }

generates this error;
Fatal error: Smarty error: [in operations/company/company_detail.tpl line 72]: syntax error: mismatched tag {/t}. (Smarty_Compiler.class.php, line 2300)

Any ideas on how to fix this?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 12 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros