- CONFIGURATION FUNCTIONS
- A Note on default port numbers
- SEE ALSO
Lingua::Translate::SysTrans - Translation back-end for SysTran's enterprise translation server, version 0.01 (European languages only)
use Lingua::Translate; Lingua::Translate::config ( back_end => "SysTran", host => "babelfish.mydomainname.com", ); my $xl8r = Lingua::Translate->new(src => "de", dest => "en"); # prints "My hovercraft is full of eels" print $xl8r->translate("Mein Luftkissenfahrzeug ist voll von den Aalen");
Lingua::Translate::SysTran is a translation back-end for Lingua::Translate that contacts a SysTran translation server to do the real work.
You should try to avoid putting the config() command that sets the location of the server in all of your scripts; make a little configuration module or put it in a script you can `require'.
Creates a new translation handle. This won't initiate a connection until you try to translate something.
Source language, in RFC-3066 form. See I18N::LangTags for a discussion of RFC-3066 language tags.
Specify the host to contact
Specify the port number
The following methods may be called on Lingua::Translate::SysTran objects.
Translates the given text. die's on any kind of error.
Returns a list of available language pairs, in the form of "XX_YY", where XX is the source language and YY is the destination. If you want the english name of a language tag, call I18N::LangTags::List::name() on it. See I18N::LangTags::List.
If you call this function without configuring the package, it returns all of the languages that there are known back-ends for.
This function sets defaults for use when constructing objects.
Defines the hostname to use if no hostname/port is defined for a language pair. The default value is "localhost". Do not specify a port number.
The value to this configuration option must be a hash reference from a language pair (in XX_YY form) to a hostname, optionally followed by a colon and a port number.
If this configuration option is defined, then attempts to translate undefined languages will fail. There is no default value for this option.
Returns the host name and port number for the given language pair.
To determine the default port number, take the one-letter code for the language from the below table, express as a number in base 25 (A=0, B=1, etc) and then add 10000 decimal. Eg en => de would be EG, which is 106 decimal, or port 10106.
en => E de => G it => I fr => F pt => P es => S el => K
No support for non-ISO-8859-1 character sets - with the software I have, there is no option.
Sam Vilain, <firstname.lastname@example.org>