NAME

Krang::Localization - Krang localization module


SYNOPSIS

   use Krang::ClassLoader Localization => qw(localize);
   $localized_string = localize('some string');
   # All AvailableLanguages set in conf/krang.conf are available via
   # the exported %LANG hash, with keys being arbitrary language tags
   # and values being the corresponding language names.
   my $lang = $LANG{en}; # yields 'English';
   # install a localization distribution
   pkg('Localization')->install(src => '/path/to/Krang-Localization-Deutsch-3.01.tar.gz');
   # uninstall a localization distribution
   pkg('Localization')->uninstall(lang => de);


DESCRIPTION

This module provides localization to Krang by exporting the functions localize() and localize_template(). The latter is primarily used in lang/bin/krang_localize_templates to pre-compile localized templates. For this to work, wrap any static template strings in

   <tmpl_lang SomeSTRING>

tags.

Lexicons are Krang::ConfigApacheFormat objects accessible through the class method

  pkg('Localization')->get_lexicon($language_tag);

Direct access to lexicons should be rarely necessary. Use the exported localize() function instead which honors the logged in user's language preference.


INTERFACE