Rosetta::Engine::Generic::L::en - Localization of Rosetta::Engine::Generic for English


Rosetta-Engine-Generic documentation Contained in the Rosetta-Engine-Generic distribution.

Index


Code Index:

NAME

Top

Rosetta::Engine::Generic::L::en - Localization of Rosetta::Engine::Generic for English

VERSION

Top

This document describes Rosetta::Engine::Generic::L::en version 0.14.0.

SYNOPSIS

Top

    use Locale::KeyedText;
    use Rosetta;

    # do work ...

    my $translator = Locale::KeyedText->new_translator(
        ['Rosetta::Engine::Generic::L::', 'Rosetta::Utility::SQLBuilder::L::',
        'Rosetta::Utility::SQLParser::L::', 'Rosetta::L::', 'Rosetta::Model::L::'], ['en'] );

    # do work ...

    eval {
        # do work with Rosetta, 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 Rosetta some more ...

DESCRIPTION

Top

The Rosetta::Engine::Generic::L::en Perl 5 module contains localization data for the Rosetta::Engine::Generic module. It complements the Rosetta::L::en module, which should interpret most messages that Generic throws; Generic::L just contains extra or overridden messages specific to Generic. It is designed to be interpreted by Locale::KeyedText.

This class is optional and you can still use Rosetta::Engine::Generic 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".

FUNCTIONS

Top

get_text_by_key( MSG_KEY )

    my $user_text_template = Rosetta::Engine::Generic::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.

DEPENDENCIES

Top

This module requires any version of Perl 5.x.y that is at least 5.8.1.

It also requires the Perl module version, which would conceptually be built-in to Perl, but isn't, so it is on CPAN instead.

This module has no enforced dependencies on Locale::KeyedText, which is on CPAN, or on Rosetta::Engine::Generic, which is in the current distribution, but it is designed to be used in conjunction with them.

INCOMPATIBILITIES

Top

None reported.

SEE ALSO

Top

perl(1), Locale::KeyedText, Rosetta::Engine::Generic.

BUGS AND LIMITATIONS

Top

The structure of this module is trivially simple and has no known bugs.

However, the locale data that this module contains may be subject to large changes in the future; you can determine the likeliness of this by examining the development status and/or BUGS AND LIMITATIONS documentation of the other module that this one is localizing; there tends to be a high correlation in the rate of change between that module and this one.

AUTHOR

Top

Darren R. Duncan (perl@DarrenDuncan.net)

LICENCE AND COPYRIGHT

Top


Rosetta-Engine-Generic documentation Contained in the Rosetta-Engine-Generic distribution.

#!perl
use 5.008001; use utf8; use strict; use warnings;

package Rosetta::Engine::Generic::L::en;
use version; our $VERSION = qv('0.14.0');

######################################################################

my $CG = 'Rosetta::Engine::Generic';

my %text_strings = (
    'ROS_G_NO_DBI_DRIVER_HINT_MATCH' =>
        $CG . q[ - can't find any installed DBI driver with a name like "{NAME}"],

    'ROS_G_RAW_SQLSTATE' =>
        $CG . q[ - following the most recent externally invocated procedure, the returned ]
        . q["SQLSTATE" 5-character-string value was "{SQLSTATE_NUM}" (zero is success)],
);

######################################################################

sub get_text_by_key {
    my (undef, $msg_key) = @_;
    return $text_strings{$msg_key};
}

######################################################################

1;
__END__