Object::Relation::Language - Object::Relation localization class
# 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);
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.
add_to_lexicon()
Those who wish to add new localizations to the Object::Relation framework should consult the en subclass for a full lexicon.
en
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.
This method is used internally by Locale::Maketext to set up failed localization key lookups to throw exceptions.
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.
To install Object::Relation, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Object::Relation
CPAN shell
perl -MCPAN -e shell install Object::Relation
For more information on module installation, please visit the detailed CPAN module installation guide.