Le 29 oct. 05 à 21:29, Birgit Kellner a écrit :

A small question: I'd like to use Template::Multilingual for bilingual (German/English) templates.

This is the example code from the documentation:

   use Template::Multilingual;

   my $template = Template::Multilingual->new();
   $template->language('en');
   $template->process('example.ttml');

And this is the template example given there:
<t>
     <en>Hello!</en>
     <fr>Bonjour !</fr>
   </t>

What's the point of the <t>-element? If I add it, the module prints out code instead of content:
[% SWITCH language %][% CASE 'de' %]Heim[% CASE 'eng' %]Home[% END %]

That looks correct, the appropriate output will be selected at runtime depending on the value of 'language'. If this is not working like you think it should then please post a complete test case.

If I omit it, all content is printed, and the language selection is not made.

Template::Multilingual's parser looks for <t>...</t> so you really need to include them.

In addition: I used to start up the Template module like this:
$tt = Template->new ( { INCLUDE_PATH => "/path/to/templatedir" , TAG_STYLE => 'asp', ANYCASE => 1}) || &cgierr("no template dir");

Can the options INCLUDE_PATH and TAG_STYLE also be used with Template::Multilingual? The first seems to be recognised because the module does actually process the template, but what about TAG_STYLE?

Right, T:M is a Template subclass so INCLUDE_PATH just works, however its parser doesn't take TAG_STYLE into account. I'll see if I can add that in.

--
Eric Cholet
The best way to predict the future is to invent it -- Alan Kay




_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to