While mainly an issue in web application frameworks, the need to have text strings generated in a mulitplicity of languages, be they natural or otherwise, can often crop up.

The one way to know you aren't handling the job right is when you are using a bunch of if-thens in a large number of isolated places.

One right way for databases, which I have discussed at length, is DBIx::Recordset. One right way for language would be Locale::Maketext or within web application frameworks, Apache::Pagekit and the Ralf Engelschall's Web Metalanguage have good support for this.

However, two CPAN modules which don't seem to get a lot of attention but go a long way toward solving both of these problems in a very agnostic way are Phrasebook (for natural language) and Phrasebook::SQL for database query languages.

Since this is just a meditation, I can slip out the door having said just this much. I would love to provide a review of these at some point in the future, showing how they can add these features to web application frameworks that currently lack them.

  • Comment on Phrasebooks - Natural and Database Language Demultiplexers