in reply to Writing multilingual perl applications?

I make my Perl apps multilingual too. I have a Dictionary.pm module, which I wrote myself that works something like:

my $dict = new Dictionary(); # Dictionary is made a singleton. $some_string = $dict->trans("word");

My dictionary also has methods like $dict->check_in("word") that changes the meaning of a word if it exists or adds a new one.

Once you have a module you can implement the methods the way you want and you can change them later if you don't like it. I had two options for Dictionary internals when I started working on it:

First. Have XML dictionary files for each language: en_dictionary.xml, lt_dictionary.xml etc. Load the needed in the Dictionary constructor or change it at run-time. The problem with this option was that my app uses a windows-1257 charset and not utf-8. And the XML::Simple and other XML modules work only with utf-8 so far. So I dropped this option.

Second. Have a database table dictionary with fields: word, en, lt for it. The dictionary justs loads the needed field values when needed.

So, my way of doing might have been a reinvention of the wheel. However, my quick research on dictionary modules out there didn't give me good results. Conclusion: write a simple Dictionary wrapper around and choose a way to access your dictionary words inside it. You will be able to change it later when need. In your code you'll have delegation to the dictionary module: $dict->trans("word").

I thought about finishing my module properly and putting it on CPAN. Don't know yet if it's good enough and really needed for Perl community.