Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Template Toolkit problem

Status
Not open for further replies.

jj0914

Programmer
Aug 4, 2006
33
CA
I am using Perl template toolkit to build a English/French Guestbook webpage, right now I am having trouble display country and province name in french, it always display english. I do have translated country and province name in my DB. here is what I did:

$c->stash->{ entry } = $c->model( 'GuestBook::Entry')->create( $c->form );

In the template file:

<p><strong>[% loc('Country') %] :</strong> [%entry.country.name ) %] </p>

Can any one help me on this? many thanks
 
I've done quite a lot of work with TT2 so I can probably help you. I might need a bit more info, however. In the meantime, can you confirm that you pasted this rather than typed it in, as it seems to have an extra ')' and TT2 can be a bit fussy about parsing...
Code:
<p><strong>[% loc('Country') %] :</strong> [%entry.country.name [red])[/red] %] </p>

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
thanks steve, i have fixed the problem.
thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top