NAME
SQL::SyntaxModel::ByTree::L::en - Localization of SQL::SyntaxModel::ByTree for English
DEPENDENCIES
Perl Version: 5.006
Standard Modules: none
Nonstandard Modules: This module has no enforced dependencies, but it is designed to be used by Locale::KeyedText when that module localizes error messages generated by SQL::SyntaxModel::ByTree.
COPYRIGHT AND LICENSE
This module is Copyright (c) 1999-2004, Darren R. Duncan. All rights reserved. Address comments, suggestions, and bug reports to perl@DarrenDuncan.net, or visit "http://www.DarrenDuncan.net" for more information.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl 5.8 itself.
Any versions of this module that you modify and distribute must carry prominent notices stating that you changed the files and the date of any changes, in addition to preserving this original copyright notice and other credits. This module is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SYNOPSIS
use Locale::KeyedText;
use SQL::SyntaxModel::ByTree;
# do work ...
my $translator = Locale::KeyedText->new_translator(
['SQL::SyntaxModel::ByTree::L::', 'SQL::SyntaxModel::L::'], ['en'] );
# do work ...
eval {
# do work with SQL::SyntaxModel::ByTree, which may throw an exception ...
};
if( my $error_message_object = $@ ) {
# examine object here if you want and programmatically recover...
# or otherwise do the next few lines...
my $error_user_text = $translator->translate_message( $error_message_object );
# display $error_user_text to user by some appropriate means
}
# continue working, which may involve using SQL::SyntaxModel::ByTree some more ...
DESCRIPTION
The SQL::SyntaxModel::ByTree::L::en Perl 5 module contains localization data for SQL::SyntaxModel::ByTree. It is designed to be interpreted by Locale::KeyedText.
This class is optional and you can still use SQL::SyntaxModel::ByTree effectively without it, especially if you plan to either show users different error messages than this class defines, or not show them anything because you are "handling it".
SYNTAX
This class does not export any functions or methods, so you need to call them using object notation. This means using Class->function() for functions and $object->method() for methods. If you are inheriting this class for your own modules, then that often means something like $self->method().
FUNCTIONS
get_text_by_key( MSG_KEY )
my $user_text_template = SQL::SyntaxModel::ByTree::L::en->get_text_by_key( 'foo' );
This function takes a Message Key string in MSG_KEY and returns the associated user text template string, if there is one, or undef if not.
SEE ALSO
perl(1), Locale::KeyedText, SQL::SyntaxModel::ByTree, SQL::SyntaxModel::L::*.