[cgiapp] Internationalization with Locale::Maketext

Jani-Hur jani-hur at jani-hur.net
Wed May 26 14:00:56 EDT 2010


Hello all,

I'm new to web programming. Thanks to economical turmoil I've plenty of 
free time so I have started to work on a hobby Perl web app project :)

I've been fighting my way through Mark Rajcok's Perl MVC CGI-Application 
Tutorial / Jumpstart Application 
(http://docs.google.com/Doc?id=dd363fg9_77gb4hdh7b). It has been a great 
journey and I'm planning to use this framework for my hobby project.

Unfortunately the tutorial is missing internationalization that is a 
critical feature for me.

I'm aware of CGI::Application::Plugin::I18N and I gave it a try some 
time ago, but I just couldn't get the example to work. Maybe I should 
give it a second try now when I'm much more comfortable with 
CGI::Application & al.

Meanwhile I've come up with two examples where I use Locale::Maketext to 
localize Template::Toolkit templates:

http://metsankulma.homelinux.net/cgi-bin/l10n_example_2.cgi
http://metsankulma.homelinux.net/cgi-bin/l10n_example_3.cgi

(source code tarball is available for download from those links)

The examples should be identical except in example 3 I have moved the 
localization code to L10nExample3/CGIApplicationPluginLocaleMaketext.pm 
plugin.

The examples shows how I'm planning to implement i18n in my hobby project.

I'd appreciate any comments (also on other issues than i18n) from you as 
I'm a newcomer in the field. If you think I'm on a right track I'm also 
interested to implement i18n in Mark's tutorial (but that's a subject of 
another debate and i18n is not in the to-be-done list).


More information about the cgiapp mailing list