I18NFool - Internationalization File Object Oriented Leech


Creating a locale directory

This toolkit is mainly targetted at Petal, but it should work with other templating language which implement the ZPT i18n specification.

First you need a locale directory somewhere for your web app.

  cd /opt/myapp
  mkdir locale
  cd locale

Extracting i18n: strings.

Then you need to extract a bunch of .pot files from your internationalized templates. I18NFool assumes that your templates are properly localized.

In the future it will include a tool to find strings which potentially need localization.

I18NFool creates one .pot file per domain which is defined in the templates. The format is <domain>.pot.

If no i18n:domain is specified, I18NFool assumes the domain is called 'default'.

  find /opt/myapp/templates |egrep '\.html$' |xargs i18nfool-extract 

Building / syncing the .po files

Create one directory for each language which will need to be translated.

  cd /opt/myapp/locale
  mkdir en_GB
  mkdir en_US
  mkdir fr_FR
  mkdir fr_CA
  mkdir ja

Then run the i18n-update tool.

  cd /opt/myapp/locale

i18n-update will *not* erase your existing .po files, it will update them nicely using gettext's msgmerge tool.

If the .po file does not exist, it will create a new one.

Building .mo files

Once you are happy with your set of .po files, it's time to build the .mo files which are going to be used by your application, for example using Locale::MakeText::Gettext.

 cd /opt/myapp/locale i18nfool-build


This is a totally *alpha* release, so I'd say 'plenty'. Bug reports are welcome. Patches will do your karma real good.


  (C) Copyright 2004 MKDoc Ltd. and Laurent Bedubourg

    Authors Jean-Michel Hiver and
    Laurent Bedubourg <>.

  This module is free software, it is distributed under the
  same license as Perl itself.