DBIx::BabelKit - Universal Multilingual Code Table Interface


  use DBIx::BabelKit;
  my $bk = new DBIx::BabelKit($dbh,
                 table     => 'bk_code',
                 getparam  => sub { $cgi->param(shift) },
                 getparams => sub { $cgi->param(shift.'[]') }

Get code descriptions safe for HTML display

  $str = $bk->desc(   $code_set, $code_lang, $code_code);
  $str = $bk->ucfirst($code_set, $code_lang, $code_code);
  $str = $bk->ucwords($code_set, $code_lang, $code_code);

Get code descriptions not safe for HTML display

  $str = $bk->render($code_set, $code_lang, $code_code);
  $str = $bk->data(  $code_set, $code_lang, $code_code);
  $str = $bk->param( $code_set, $code_code)

HTML select common options

         var_name      => 'start_day'
         value         => $start_day
         default       => 1
         subset        => [ 1, 2, 3, 4, 5 ]
         options       => 'onchange="submit()"'

HTML select single value methods

  $str = $bk->select($code_set, $code_lang,
         select_prompt => "Code set description?",
         blank_prompt  => "None"
  $str = $bk->radio($code_set, $code_lang,
         blank_prompt  => "None",
         sep           => "<br>\n"

HTML select multiple value methods

  $str = $bk->multiple($code_set, $code_lang,
         size          => 10
  $str = $bk->checkbox($code_set, $code_lang,
         sep           => "<br>\n"

Code sets

  $rows = $bk->lang_set($code_set, $code_lang);
  $rows = $bk->full_set($code_set, $code_lang);

Code table updates

  $bk->slave($code_set, $code_code, $code_desc);
  $bk->remove($code_set, $code_code);
  ( $code_desc, $code_order, $code_flag ) =
    $bk->get($code_set, $code_lang, $code_code);
  $bk->put($code_set, $code_lang, $code_code,
           $code_desc, $code_order, $code_flag);


BabelKit is an interface to a universal multilingual database code table. BabelKit takes all of the programming work out of maintaining multiple database code definition sets in multiple languages.

The code administration and translation page lets you define new virtual code tables, new languages, enter all codes and their descriptions and then translate them into all languages of interest.

Perl and PHP classes retrieve the code descriptions and automatically generate HTML code selection elements in the user's language. This makes internationalization and localization of web sites and database interfaces much easier.

For news and updates visit the BabelKit home page:

For a simpler unilingual universal code table visit the CodeKit home page:


Contact John Gorman at to report bugs, request features, or for database design and programming assistance.


Copyright (C) 2003 John Gorman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the Lesser GNU General Public License (LGPL) of the Free Software Foundation. This means that you can use it for any project. If you do, send me a note saying how it went!