7 require 'Sesse::GettextizeTemplates.pm';
9 # Common short macro to get non-templatized gettext stuff working
11 return Locale::gettext::gettext(@_);
15 POSIX::setlocale(&POSIX::LC_CTYPE, "");
16 POSIX::setlocale(&POSIX::LC_MESSAGES, "");
17 Locale::gettext::bindtextdomain("myproject", ".");
18 Locale::gettext::textdomain("myproject");
20 # Do a test message with no templates
21 print _("Test message from outside a template.\n");
23 # Process the test template and print it to stdout
24 my $template = Template->new({ FACTORY => 'Sesse::GettextizeTemplates' });
26 $template->process('test.tmpl', { foo => int(rand 2) }, \$output)
27 or die $template->error();