SYSTRANBox is called either through GET or POST, using the following options:
- systran_id
-
Your ID.
- systran_lg
-
The ISO-639 code of the language of the interface. When it is not specified,
SYSTRANBox assumes the default interface language corresponding to your ID.
- systran_lp
-
The language pair xx_yy that specifies both
the source (xx) and target (yy)
languages. The languages are designated by their ISO-639 two-letter code. For
example, en_fr
specifies that the given text should be translated from English to French.
The source document can be a file, a Web page or plain text. Its type is
specified by the choice of the option name:
- systran_file
-
The name of the file to upload. The form encoding must be set to multipart/form-data
.
- systran_url
-
The URL of a Web page. Protocol can be HTTP, HTTPS or FTP.
- systran_text
-
A plain text sequence.
- systran_urltext
-
Either a URL or a plain text sequence. SYSTRANBox automatically detects the
type.
When a request contains more than one of these options, the priority order used
is as follows: systran_file, systran_text,
systran_urltext, systran_url.
However, it is possible to specify the option used by using the option
systran_ttype, the values of which can be: file
, url or text
.
Example 1. HTML translation box
If the ID is xxxx and
the interface is in English (en
). Here is a very simple HTML page that both presents the translation and
allows the user to do another translation.
<html><head>
<meta http-equiv="Content-Type" content="text/html;
charset=SYSTRAN_TARGET_CHARSET">
</head><body>
<font color="red">SYSTRAN_MESSAGE</font><br>
Translate with SYSTRANBox!<br>
<form action="SYSTRAN_URL" method="POST">
<input type="hidden" name="systran_id" value="xxxx">
<input type="hidden" name="systran_lg" value="en">
<textarea name="systran_urltext" wrap"virtual">
SYSTRAN_SOURCE_TEXT(Type your text or URL here)
</textarea><br>
From SYSTRAN_LP <input type="submit" value="Translate">
</form><br><hr>
Translated text:<br>
SYSTRAN_TARGET_TEXT
</body></html>
|