1TRANSLATE(1)                   translate Manual                   TRANSLATE(1)
2
3
4

NAME

6       translate - translate a text or web page
7

SYNOPSIS

9       translate {-? | -v | --list-services}
10
11       translate [-s services] [-f lang] [-t lang] {-l}
12
13       translate [-s services] [-f lang] [-t lang] {http_url | https_url}
14
15       translate [-s services] [-f lang] [-t lang] [--max-threads=n]
16                 [--max-retries=n] [file]
17
18

DESCRIPTION

20       translate translates a text or web page.
21
22
23       If the first synopsis form is used, translate prints a quick help,  the
24       version  information  or  the list of available translation services to
25       standard output.
26
27
28       If the second synopsis form is  used,  translate  prints  the  list  of
29       available language pairs to standard output.
30
31
32       If  the  third synopsis form is used, translate translates the web page
33       pointed to by http_url or https_url, and prints the URL of  the  trans‐
34       lated  web  page to standard output (http_url must be a string starting
35       with http://, and https_url must be a string starting with https://).
36
37
38       If the fourth synopsis form is used, translate translates the text con‐
39       tained  in file, and prints the translation to standard output (if file
40       is omitted or given as a single dash, standard input is used instead).
41
42

OPTIONS

44       -?, --help
45              Prints a quick help to standard output.
46
47
48       -v, --version
49              Prints version information to standard output.
50
51
52       --list-services
53              Lists the available translation services.
54
55
56       -s services, --services=services
57              Specifies the translation services to use. The services argument
58              must  be a comma-separated list of service names (default value:
59              all the available services).
60
61              The list of services determines the  available  language  pairs.
62              The  order  of  the  list is important, as libtranslate iterates
63              over the list until the requested translation can be performed.
64
65
66       -l, --list-pairs
67              Lists the available language pairs.
68
69              The -f and -t options can be used to  specify  a  source  and/or
70              destination  language filter. If neither -f nor -t is specified,
71              all the pairs are listed.
72
73
74       -f lang, --from=lang
75              Specifies the source language of a translation. The  lang  argu‐
76              ment  must  be  a RFC 3066 language tag such as en or zh-TW (de‐
77              fault value: see Language Selection).
78
79
80       -t lang, --to=lang
81              Specifies the destination language of a  translation.  The  lang
82              argument  must  be  a  RFC 3066 language tag such as en or zh-TW
83              (default value: see Language Selection).
84
85
86       --max-threads=n
87              Specifies the maximum number of concurrent threads  to  use  for
88              translating text (default value: 8).
89
90
91       --max-retries=n
92              Specifies  the maximum number of retries per text chunk (default
93              value: 3).
94
95

LANGUAGE SELECTION

97       Definitions: in this section, default_from is defined as  the  contents
98       of  the  environment variable TRANSLATE_DEFAULT_FROM, or, if that vari‐
99       able is not set, en; default_to is defined as the contents of the envi‐
100       ronment variable TRANSLATE_DEFAULT_TO, or, if that variable is not set,
101       fr.
102
103
104       If the source language is not specified, it defaults  to  default_from,
105       or, if the destination language is equal to default_from, default_to.
106
107
108       If  the  destination  language  is  not  specified,  it defaults to de‐
109       fault_to, or, if the  source  language  is  equal  to  default_to,  de‐
110       fault_from.
111
112

CHARACTER SET HANDLING

114       Internally, libtranslate uses the UTF-8 encoding.
115
116
117       If  the input text is not encoded in UTF-8, translate assumes it is en‐
118       coded in the character set of the current locale, and attempts to  con‐
119       vert  it to UTF-8. If the conversion fails, translate exits with an er‐
120       ror.
121
122
123       The output text is converted to the character set of the current locale
124       before printing.
125
126

EXAMPLES

128       In the following examples, it is assumed that TRANSLATE_DEFAULT_FROM is
129       set to es and that TRANSLATE_DEFAULT_TO is set to de.
130
131
132       translate -f fr -l
133              Lists all the available language pairs where the source language
134              is French.
135
136
137       translate document1
138              Translates  the  contents  of the file document1 from Spanish to
139              German and prints the result to standard output.
140
141
142       translate -s babelfish,freetranslation document1
143              Translates the contents of the file document1  from  Spanish  to
144              German,  only using the Babel Fish and FreeTranslation services,
145              and prints the result to standard output.
146
147
148       translate -f de document1
149              Translates the contents of the file  document1  from  German  to
150              Spanish and prints the result to standard output.
151
152
153       echo "Le problème est résolu." | translate -f fr -t en
154              Translates  the text given on standard input from French to Eng‐
155              lish and prints the result to standard output.
156
157
158       translate -t en http://www.freebsd.org/es/index.html
159              Translates  the  web  page  pointed   to   by   http://www.free
160              bsd.org/es/index.html  from Spanish to English and prints an URL
161              pointing to the result to standard output.
162
163

DIAGNOSTICS

165       The translate utility exits with a status of 0 on success, and >0 if an
166       error occurs.
167
168

ENVIRONMENT

170       The following environment variables affect the execution of translate:
171
172
173       HTTP_PROXY
174              The URL of the proxy to use for HTTP requests.
175
176
177       http_proxy
178              Same as HTTP_PROXY, for compatibility.
179
180
181       TRANSLATE_DEFAULT_FROM
182              The default source language (see Language Selection).
183
184
185       TRANSLATE_DEFAULT_TO
186              The default destination language (see Language Selection).
187
188

SEE ALSO

190       The libtranslate Reference Manual
191
192

AUTHOR

194       Jean-Yves Lefort.
195
196
197
198libtranslate 0.99              January 15, 2005                   TRANSLATE(1)
Impressum