Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: PerlScript and Localization

by Lexicon (Chaplain)
on May 11, 2001 at 10:49 UTC ( #79653=note: print w/ replies, xml ) Need Help??


in reply to PerlScript and Localization

Well, it wasn't what I was looking for, but this is the best solution I could find:

sub UserError { my $msg = shift; my $serialcode = shift; my $email = shift; open JAPANERROR, $japanerrorfile or die "Can not open $japanerrorfile: $!"; my @JapanArray = <JAPANERROR>; close JAPANERROR or die "Can not close $japanerrorfile: $!"; chomp @JapanArray; my ($j_invalidcode, $j_badcodelength, $j_invalidemail, $j_expiredtrial, $j_unknownerror) = @JapanArray; $Response->Write("<html><body><h3>"); if ( $msg =~ /Bad code length/ ) { $Response->Write( "$j_badcodelength ($serialcode)" ) } elsif ( $msg =~ /Not a valid code/ ) { $Response->Write( "$j_invalidcode ($serialcode)" ) } elsif ( $msg =~ /Not a valid Email/ ) { $Response->Write( "$j_invalidemail ($email)" ) } elsif ( $msg =~ /You already used your 3 trial time/ ) { $Response->Write( "$j_expiredtrial ($email)" ) } else { $Response->Write( "$j_unknownerror" ) } $Response->Write("</h3></body></html>"); exit(1); }
And here's an example of the error file, not yet translated:
ERROR : Bad code length ERROR : Not a valid code ERROR : Not a valid Email ERROR : You already used your 3 trial time ERROR : Unknown Error

-Lexicon


Comment on Re: PerlScript and Localization
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://79653]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2014-08-23 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (173 votes), past polls