| ACME-Error-Translate documentation | Contained in the ACME-Error-Translate distribution. |
ACME::Error::Translate - Language Translating Backend for ACME::Error
use ACME::Error Translate => de; die "Stop!"; # Anschlag!
Translates error messages from the default English to the language of your choice using Lingua::Translate. As long as the backend used by Lingua::Translage understands your two letter language code, you're ok.
By default the backend is Babelfish.
Casey West <casey@geeknest.com>
perl(1), ACME::Error, Lingua::Translate.
| ACME-Error-Translate documentation | Contained in the ACME-Error-Translate distribution. |
package ACME::Error::Translate; use strict; no strict 'refs'; use vars qw[$VERSION]; $VERSION = '0.01'; use Lingua::Translate; { my $translator = undef; sub import { my $class = shift; $translator = Lingua::Translate->new( src => 'en', dest => shift ); } *die_handler = *warn_handler = sub { if ( $translator ) { return map $translator->translate( $_ ), @_; } else { return @_; } }; } 1; __END__