On Thu, Jan 12, 2006 at 03:44:55PM +0000, me said:
> Now all I need to do is change the translate() function to actually
> translate using gettext and then somehow get the current language from a
> Template::Plugin::Translate, presumably by dicking around with $context;
I now have this working.
Given a standard Locale::MakeText lexicon called (for the purposes of
illustration 'MyTranslation') with the item _GREETING_ set in it then
[%- USE Localisation('MyTranslation') -%]
[%- SET foo = "_GREETING_" -%]
[% foo %]
[% "_GREETING_" %]
prints
Hello
Hello
and changing the first line to
[%- USE Localisation('MyTranslation','fr') -%]
prints
Bonjour
Bonjour
There's still a couple of issues to be sorted out and I'm not convinced
that Locale::MakeText is the right il8n module to use for various
reasons but I think this could be really useful for doing multi language
websites.
Simon
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates