The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

Object::Relation::Language - Object::Relation localization class

Synopsis

  # Add localization strings.
  package MyApp::Language::en;
  use Object::Relation::Language::en;
  Object::Relation::Language::en->add_to_lexicon(
    'Thingy' => 'Thingy',
    'Thingies' => 'Thingies',
  );

  # Use directly.
  use Object::Relation::Language;
  my $lang = Object::Relation::Language->get_handle('en_us');
  print $lang->maketext($msg);

Description

This class handles Object::Relation localization. To add this functionality, it subclasses Locale::Maketext and adds a few other features. One of these features is that failure to find a localization string will result in the throwing of a Object::Relation::Exception::Fatal::Language exception.

But since the Object::Relation framework is just that, a framework, this class functions as the base class for the localization libraries of all Object::Relation applications. Those applications can add their own localization strings libraries via the add_to_lexicon() method.

Those who wish to add new localizations to the Object::Relation framework should consult the en subclass for a full lexicon.

Class Interface

Class Methods

add_to_lexicon

  Object::Relation::Language::en->add_to_lexicon(
    'Thingy' => 'Thingy',
    'Thingies' => 'Thingies',
  );

Adds new entries to the lexicon of the class. This method is intended to be used by the localization libraries of Object::Relation applications, which will have their own strings that need localizing.

Instance Interface

Instance Methods

init

This method is used internally by Locale::Maketext to set up failed localization key lookups to throw exceptions.

Copyright and License

Copyright (c) 2004-2006 Kineticode, Inc. <info@obj_relode.com>

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.