.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "TRANSLATE" 1 "January 15, 2005" "libtranslate 0.99" "translate Manual" .SH NAME translate \- translate a text or web page .SH "SYNOPSIS" .ad l .hy 0 .HP 10 \fBtranslate\fR {\fB\-?\fR | \fB\-v\fR | \fB\-\-list\-services\fR} .ad .hy .ad l .hy 0 .HP 10 \fBtranslate\fR [\-s\ \fIservices\fR] [\-f\ \fIlang\fR] [\-t\ \fIlang\fR] {\-l} .ad .hy .ad l .hy 0 .HP 10 \fBtranslate\fR [\-s\ \fIservices\fR] [\-f\ \fIlang\fR] [\-t\ \fIlang\fR] {\fB\fIhttp_url\fR\fR | \fB\fIhttps_url\fR\fR} .ad .hy .ad l .hy 0 .HP 10 \fBtranslate\fR [\-s\ \fIservices\fR] [\-f\ \fIlang\fR] [\-t\ \fIlang\fR] [\-\-max\-threads=\fIn\fR] [\-\-max\-retries=\fIn\fR] [\fIfile\fR] .ad .hy .SH "DESCRIPTION" .PP \fBtranslate\fR translates a text or web page\&. .PP If the first synopsis form is used, \fBtranslate\fR prints a quick help, the version information or the list of available translation services to standard output\&. .PP If the second synopsis form is used, \fBtranslate\fR prints the list of available language pairs to standard output\&. .PP If the third synopsis form is used, \fBtranslate\fR translates the web page pointed to by \fIhttp_url\fR or \fIhttps_url\fR, and prints the URL of the translated web page to standard output (\fIhttp_url\fR must be a string starting with http://, and \fIhttps_url\fR must be a string starting with https://)\&. .PP If the fourth synopsis form is used, \fBtranslate\fR translates the text contained in \fIfile\fR, and prints the translation to standard output (if \fIfile\fR is omitted or given as a single dash, standard input is used instead)\&. .SH "OPTIONS" .TP \fB\-?\fR, \fB\-\-help\fR Prints a quick help to standard output\&. .TP \fB\-v\fR, \fB\-\-version\fR Prints version information to standard output\&. .TP \fB\-\-list\-services\fR Lists the available translation services\&. .TP \fB\-s\fR \fIservices\fR, \fB\-\-services\fR=\fIservices\fR Specifies the translation services to use\&. The \fIservices\fR argument must be a comma\-separated list of service names (default value: all the available services)\&. The list of services determines the available language pairs\&. The order of the list is important, as libtranslate iterates over the list until the requested translation can be performed\&. .TP \fB\-l\fR, \fB\-\-list\-pairs\fR Lists the available language pairs\&. The \fB\-f\fR and \fB\-t\fR options can be used to specify a source and/or destination language filter\&. If neither \fB\-f\fR nor \fB\-t\fR is specified, all the pairs are listed\&. .TP \fB\-f\fR \fIlang\fR, \fB\-\-from\fR=\fIlang\fR Specifies the source language of a translation\&. The \fIlang\fR argument must be a RFC 3066 language tag such as en or zh\-TW (default value: see Language Selection)\&. .TP \fB\-t\fR \fIlang\fR, \fB\-\-to\fR=\fIlang\fR Specifies the destination language of a translation\&. The \fIlang\fR argument must be a RFC 3066 language tag such as en or zh\-TW (default value: see Language Selection)\&. .TP \fB\-\-max\-threads\fR=\fIn\fR Specifies the maximum number of concurrent threads to use for translating text (default value: 8)\&. .TP \fB\-\-max\-retries\fR=\fIn\fR Specifies the maximum number of retries per text chunk (default value: 3)\&. .SH "LANGUAGE SELECTION" .PP Definitions: in this section, \fIdefault_from\fR is defined as the contents of the environment variable \fBTRANSLATE_DEFAULT_FROM\fR, or, if that variable is not set, en; \fIdefault_to\fR is defined as the contents of the environment variable \fBTRANSLATE_DEFAULT_TO\fR, or, if that variable is not set, fr\&. .PP If the source language is not specified, it defaults to \fIdefault_from\fR, or, if the destination language is equal to \fIdefault_from\fR, \fIdefault_to\fR\&. .PP If the destination language is not specified, it defaults to \fIdefault_to\fR, or, if the source language is equal to \fIdefault_to\fR, \fIdefault_from\fR\&. .SH "CHARACTER SET HANDLING" .PP Internally, libtranslate uses the UTF\-8 encoding\&. .PP If the input text is not encoded in UTF\-8, \fBtranslate\fR assumes it is encoded in the character set of the current locale, and attempts to convert it to UTF\-8\&. If the conversion fails, \fBtranslate\fR exits with an error\&. .PP The output text is converted to the character set of the current locale before printing\&. .SH "EXAMPLES" .PP In the following examples, it is assumed that \fBTRANSLATE_DEFAULT_FROM\fR is set to es and that \fBTRANSLATE_DEFAULT_TO\fR is set to de\&. .TP \fBtranslate\fR \fB\-f\fR fr \fB\-l\fR Lists all the available language pairs where the source language is French\&. .TP \fBtranslate\fR document1 Translates the contents of the file document1 from Spanish to German and prints the result to standard output\&. .TP \fBtranslate\fR \fB\-s\fR babelfish,freetranslation document1 Translates the contents of the file document1 from Spanish to German, only using the Babel Fish and FreeTranslation services, and prints the result to standard output\&. .TP \fBtranslate\fR \fB\-f\fR de document1 Translates the contents of the file document1 from German to Spanish and prints the result to standard output\&. .TP \fBecho\fR "Le problème est résolu\&." | \fBtranslate\fR \fB\-f\fR fr \fB\-t\fR en Translates the text given on standard input from French to English and prints the result to standard output\&. .TP \fBtranslate\fR \fB\-t\fR en http://www\&.freebsd\&.org/es/index\&.html Translates the web page pointed to by http://www\&.freebsd\&.org/es/index\&.html from Spanish to English and prints an URL pointing to the result to standard output\&. .SH "DIAGNOSTICS" .PP The \fBtranslate\fR utility exits with a status of 0 on success, and >0 if an error occurs\&. .SH "ENVIRONMENT" .PP The following environment variables affect the execution of \fBtranslate\fR: .TP \fBHTTP_PROXY\fR The URL of the proxy to use for HTTP requests\&. .TP \fBhttp_proxy\fR Same as HTTP_PROXY, for compatibility\&. .TP \fBTRANSLATE_DEFAULT_FROM\fR The default source language (see Language Selection)\&. .TP \fBTRANSLATE_DEFAULT_TO\fR The default destination language (see Language Selection)\&. .SH "SEE ALSO" .PP The libtranslate Reference Manual .SH AUTHOR Jean\-Yves Lefort.