1. added non anonymous ldap binding patch. (thanks to Ilyak Kasnacheev <ilyak at...
[squirrelmail.git] / plugins / translate / setup.php
CommitLineData
849bdf42 1<?php
2
15e6162e 3/**
4 * setup.php
5 *
76911253 6 * Copyright (c) 1999-2003 The SquirrelMail Project Team
15e6162e 7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * $Id$
ea5f4b8e 10 * @package plugins
11 * @subpackage translate
15e6162e 12 */
13
849bdf42 14/* Easy plugin that sends the body of the message to a new browser
15window using the specified translator. It can also translate your
16outgoing message if you send it to someone in a different country.
17
18 Languages from i18n, incorporated in the auto-language selection:
19 en - English
20 no - Norwegian (Bokm&aring;l)
21 no_NO_ny - Norwegian (Nynorsk)
22 de - Deutsch
23 ru - Russian KOI8-R
24 pl - Polish
25 sv - Swedish
26 nl - Dutch
27 pt_BR - Portuguese (Brazil)
28 fr - French
29 it - Italian
30 cs - Czech
31 es - Spanish
32 ko - Korean
33*/
34
35
ea5f4b8e 36/**
37 * Initialize the translation plugin
38 * @return void
39 */
849bdf42 40function squirrelmail_plugin_init_translate() {
41 global $squirrelmail_plugin_hooks;
42
43 $squirrelmail_plugin_hooks['read_body_bottom']['translate'] = 'translate_read_form';
cbe5423b 44 $squirrelmail_plugin_hooks['optpage_register_block']['translate'] = 'translate_optpage_register_block';
849bdf42 45 $squirrelmail_plugin_hooks['loading_prefs']['translate'] = 'translate_pref';
46 $squirrelmail_plugin_hooks['compose_button_row']['translate'] = 'translate_button';
47}
48
49
50/* Show the translation for a message you're reading */
51function translate_read_form() {
52 global $color, $translate_server;
03c13808 53 global $message, $translate_dir;
849bdf42 54 global $translate_show_read;
03c13808 55 global $imapConnection, $wrap_at, $passed_id, $mailbox;
849bdf42 56
57 if (!$translate_show_read) {
58 return;
59 }
60
61 $translate_dir = 'to';
03c13808 62
63$trans_ar = $message->findDisplayEntity(array(), array('text/plain'));
64$body = '';
65if ($trans_ar[0] != '') {
66 for ($i = 0; $i < count($trans_ar); $i++) {
67 $body .= formatBody($imapConnection, $message, $color, $wrap_at, $trans_ar[$i], $passed_id, $mailbox);
68 }
69 $hookResults = do_hook('message_body', $body);
70 $body = $hookResults[1];
71 } else {
72 $body = 'Message can\'t be translated';
73}
74
849bdf42 75 $new_body = $body;
76 $pos = strpos($new_body,
1ba8cd6b 77 '">'. _("Download this as a file") . '</A></CENTER><BR></SMALL>');
849bdf42 78 if (is_int($pos)) {
79 $new_body = substr($new_body, 0, $pos);
80 }
dec2dcf1 81
82 $trans = get_html_translation_table(HTML_ENTITIES);
849bdf42 83 $trans[' '] = '&nbsp;';
84 $trans = array_flip($trans);
85 $new_body = strtr($new_body, $trans);
86
87 $new_body = urldecode($new_body);
88 $new_body = strip_tags($new_body);
89
90 /* I really don't like this next part ... */
91 $new_body = str_replace('"', "''", $new_body);
92 $new_body = strtr($new_body, "\n", ' ');
93
94 $function = 'translate_form_' . $translate_server;
95 $function($new_body);
96}
97
98function translate_table_end() {
99 ?></td>
100 </tr>
101 </table>
102 </td>
103 </tr>
104 </table>
105 </form>
106 <?php
107}
108
109
110function translate_button() {
111 global $translate_show_send;
112
113 if (! $translate_show_send) {
114 return;
115 }
116}
117
118
cbe5423b 119function translate_optpage_register_block() {
120 global $optpage_blocks;
121 $optpage_blocks[] = array(
38a7b6a0 122 'name' => _("Translation Options"),
849bdf42 123 'url' => '../plugins/translate/options.php',
38a7b6a0 124 'desc' => _("Which translator should be used when you get messages in a different language?"),
849bdf42 125 'js' => false
126 );
127}
128
849bdf42 129function translate_pref() {
130 global $username, $data_dir;
131 global $translate_server, $translate_location;
132 global $translate_show_send, $translate_show_read;
133 global $translate_same_window;
134
135 $translate_server = getPref($data_dir, $username, 'translate_server');
136 if ($translate_server == '') {
137 $translate_server = 'babelfish';
138 }
139
140 $translate_location = getPref($data_dir, $username, 'translate_location');
141 if ($translate_location == '') {
142 $translate_location = 'center';
143 }
144
145 $translate_show_send = getPref($data_dir, $username, 'translate_show_send');
146 $translate_show_read = getPref($data_dir, $username, 'translate_show_read');
147 $translate_same_window = getPref($data_dir, $username, 'translate_same_window');
148}
149
150
151/**
152 * This function could be sped up.
153 * It basically negates the process if a ! is found in the beginning and
154 * matches a * at the end with 0 or more characters.
155 */
156function translate_does_it_match_language($test) {
157 global $squirrelmail_language;
158 $true = 1;
159 $false = 0;
160 $index = 0;
161 $smindex = 0;
162
163 if (! $test || ! $squirrelmail_language) {
164 return $false;
165 }
166
167 if ($test[$index] == '!') {
168 $index ++;
169 $true = 0;
170 $false = 1;
171 }
172
173 if (($index == 0) && ($test == $squirrelmail_language)) {
174 return $true;
175 }
176
008ca1ad 177 while (isset($test[$index]) && $test[$index]) {
849bdf42 178 if ($test[$index] == '*') {
179 return $true;
180 }
181 if ($test[$index] != $squirrelmail_language[$smindex]) {
182 return $false;
183 }
184 $index ++;
185 $smindex ++;
186 }
187
188 return $false;
189}
190
191
192function translate_lang_opt($from, $to, $value, $text) {
193 global $translate_dir;
38a7b6a0 194
195 $ret = ' <option value="' . $value . '"';
196
849bdf42 197 if (translate_does_it_match_language($to) && ($translate_dir == 'to')) {
38a7b6a0 198 $ret .= ' SELECTED';
849bdf42 199 }
200
201 if (translate_does_it_match_language($from) && ($translate_dir == 'from')) {
38a7b6a0 202 $ret .= ' SELECTED';
849bdf42 203 }
38a7b6a0 204
205 $ret .= '>' . $text . "</option>\n";
206
207 return( $ret );
849bdf42 208}
209
210
211function translate_new_form($action) {
212 global $translate_dir, $translate_new_window, $translate_location;
213 global $color, $translate_same_window;
214
215 echo '<form action="';
216
217 if ($translate_dir == 'to') {
218 echo $action;
219 } else {
220 echo 'translate.php';
221 }
222
223 echo '" method="post"';
224
225 if (!$translate_same_window) {
226 echo ' target="_blank"';
227 }
38a7b6a0 228
849bdf42 229 echo ">\n";
230
231 ?><table align="<?php echo $translate_location ?>" cellpadding=3 cellspacing=0 border=0 bgcolor=<?php echo $color[10] ?>>
232 <tr>
233 <td>
234 <table cellpadding=2 cellspacing=1 border=0 bgcolor="<?php echo $color[5] ?>">
235 <tr>
236 <td><?php
237}
238
239function translate_form_babelfish($message) {
03c13808 240 translate_new_form('http://babelfish.altavista.com/babelfish/tr');
849bdf42 241?>
242 <input type="hidden" name="doit" value="done">
03c13808 243 <input type="hidden" name="intl" value="1">
244 <input type="hidden" name="tt" value="urltext">
849bdf42 245 <input type="hidden" name="urltext" value="<?php echo $message; ?>">
246 <select name="lp"><?php
03c13808 247 echo translate_lang_opt('en', 'zh', 'en_zh',
248 sprintf( _("%s to %s"),
249 _("English"),
250 _("Chinese"))) .
251 translate_lang_opt('en', 'fr', 'en_fr',
38a7b6a0 252 sprintf( _("%s to %s"),
253 _("English"),
254 _("French"))) .
255 translate_lang_opt('', 'de', 'en_de',
256 sprintf( _("%s to %s"),
257 _("English"),
258 _("German"))) .
259 translate_lang_opt('', 'it', 'en_it',
260 sprintf( _("%s to %s"),
261 _("English"),
262 _("Italian"))) .
03c13808 263 translate_lang_opt('en', 'ja', 'en_ja',
264 sprintf( _("%s to %s"),
265 _("English"),
266 _("Japanese"))) .
267 translate_lang_opt('en', 'ko', 'en_ko',
268 sprintf( _("%s to %s"),
269 _("English"),
270 _("Korean"))) .
38a7b6a0 271 translate_lang_opt('', 'pt*', 'en_pt',
272 sprintf( _("%s to %s"),
273 _("English"),
274 _("Portuguese"))) .
275 translate_lang_opt('', 'es', 'en_es',
276 sprintf( _("%s to %s"),
277 _("English"),
278 _("Spanish"))) .
03c13808 279 translate_lang_opt('zh', 'en', 'zh_en',
280 sprintf( _("%s to %s"),
281 _("Chinese"),
282 _("English"))) .
38a7b6a0 283 translate_lang_opt('fr', 'en', 'fr_en',
284 sprintf( _("%s to %s"),
285 _("French"),
286 _("English"))) .
287 translate_lang_opt('de', '', 'de_en',
288 sprintf( _("%s to %s"),
289 _("German"),
290 _("English"))) .
291 translate_lang_opt('it', '', 'it_en',
292 sprintf( _("%s to %s"),
293 _("Italian"),
294 _("English"))) .
03c13808 295 translate_lang_opt('ja', 'en', 'ja_en',
296 sprintf( _("%s to %s"),
297 _("Japanese"),
298 _("English"))) .
299 translate_lang_opt('ko', 'en', 'ko_en',
300 sprintf( _("%s to %s"),
301 _("Korean"),
302 _("English"))) .
38a7b6a0 303 translate_lang_opt('pt*', '', 'pt_en',
304 sprintf( _("%s to %s"),
305 _("Portuguese"),
306 _("English"))) .
307 translate_lang_opt('es', '', 'es_en',
308 sprintf( _("%s to %s"),
309 _("Spanish"),
310 _("English"))) .
311 translate_lang_opt('', '', 'de_fr',
312 sprintf( _("%s to %s"),
313 _("German"),
314 _("French"))) .
315 translate_lang_opt('', '', 'fr_de',
316 sprintf( _("%s to %s"),
317 _("French"),
318 _("German"))) .
319 translate_lang_opt('ru', '', 'ru_en',
320 sprintf( _("%s to %s"),
321 _("Russian"),
322 _("English")));
323 echo '</select>'.
324 'Babelfish: <input type="Submit" value="' . _("Translate") . '">';
325
849bdf42 326 translate_table_end();
327}
328
329function translate_form_go($message) {
330 translate_new_form('http://translator.go.com/cb/trans_entry');
331?>
332 <input type=hidden name=input_type value=text>
333 <select name=lp><?php
38a7b6a0 334 echo translate_lang_opt('en', 'es', 'en_sp',
335 sprintf( _("%s to %s"),
336 _("English"),
337 _("Spanish"))) .
338 translate_lang_opt('', 'fr', 'en_fr',
339 sprintf( _("%s to %s"),
340 _("English"),
341 _("French"))) .
342 translate_lang_opt('', 'de', 'en_ge',
343 sprintf( _("%s to %s"),
344 _("English"),
345 _("German"))) .
346 translate_lang_opt('', 'it', 'en_it',
347 sprintf( _("%s to %s"),
348 _("English"),
349 _("Italian"))) .
350 translate_lang_opt('', 'pt', 'en_pt',
351 sprintf( _("%s to %s"),
352 _("English"),
353 _("Portuguese"))) .
354 translate_lang_opt('es', 'en', 'sp_en',
355 sprintf( _("%s to %s"),
356 _("Spanish"),
357 _("English"))) .
358 translate_lang_opt('fr', '', 'fr_en',
359 sprintf( _("%s to %s"),
360 _("French"),
361 _("English"))) .
362 translate_lang_opt('de', '', 'ge_en',
363 sprintf( _("%s to %s"),
364 _("German"),
365 _("English"))) .
366 translate_lang_opt('it', '', 'it_en',
367 sprintf( _("%s to %s"),
368 _("Italian"),
369 _("English"))) .
370 translate_lang_opt('pt', '', 'pt_en',
371 sprintf( _("%s to %s"),
372 _("Portuguese"),
373 _("English")));
374 echo '</select>'.
375 "<input type=\"hidden\" name=\"text\" value=\"$message\">".
376 'Go.com: <input type="Submit" value="' . _("Translate") . '">';
377
849bdf42 378 translate_table_end();
379}
380
381function translate_form_intertran($message) {
382 translate_new_form('http://www.tranexp.com:2000/InterTran');
38a7b6a0 383 echo '<INPUT TYPE="hidden" NAME="topframe" VALUE="yes">'.
384 '<INPUT TYPE="hidden" NAME="type" VALUE="text">'.
385 "<input type=\"hidden\" name=\"text\" value=\"$message\">";
386
387 $left = '<SELECT name="from">' .
388 translate_lang_opt('pt_BR', '', 'pob', _("Brazilian Portuguese")).
389 translate_lang_opt('', '', 'bul', _("Bulgarian") . ' (CP 1251)').
390 translate_lang_opt('', '', 'cro', _("Croatian") . ' (CP 1250)').
391 translate_lang_opt('cs', '', 'che', _("Czech") . ' (CP 1250)').
392 translate_lang_opt('', '', 'dan', _("Danish")).
393 translate_lang_opt('nl', '', 'dut', _("Dutch")).
394 translate_lang_opt('en', '!en', 'eng', _("English")).
395 translate_lang_opt('', '', 'spe', _("European Spanish")).
396 translate_lang_opt('', '', 'fin', _("Finnish")).
397 translate_lang_opt('fr', '', 'fre', _("French")).
398 translate_lang_opt('de', '', 'ger', _("German")).
399 translate_lang_opt('', '', 'grk', _("Greek")).
400 translate_lang_opt('', '', 'hun', _("Hungarian") . ' (CP 1250)').
401 translate_lang_opt('', '', 'ice', _("Icelandic")).
402 translate_lang_opt('it', '', 'ita', _("Italian")).
403 translate_lang_opt('', '', 'jpn', _("Japanese") . ' (Shift JIS)').
404 translate_lang_opt('', '', 'spl', _("Latin American Spanish")).
405 translate_lang_opt('no*', '', 'nor', _("Norwegian")).
406 translate_lang_opt('pl', '', 'pol', _("Polish") . ' (ISO 8859-2)').
407 translate_lang_opt('', '', 'poe', _("Portuguese")).
408 translate_lang_opt('', '', 'rom', _("Romanian") . ' (CP 1250)').
409 translate_lang_opt('ru', '', 'rus', _("Russian") . ' (CP 1251)').
410 translate_lang_opt('', '', 'sel', _("Serbian") . ' (CP 1250)').
411 translate_lang_opt('', '', 'slo', _("Slovenian") . ' (CP 1250)').
412 translate_lang_opt('es', '', 'spa', _("Spanish")).
413 translate_lang_opt('sv', '', 'swe', _("Swedish")).
5cfb96b9 414 translate_lang_opt('', '', 'tur', _("Turkish") . ' (CP 1254)').
38a7b6a0 415 translate_lang_opt('', '', 'wel', _("Welsh")).
416 '</SELECT>';
417
418 $right = '<SELECT name="to">'.
419 translate_lang_opt('', 'pt_BR', 'pob', _("Brazilian Portuguese")).
420 translate_lang_opt('', '', 'bul', _("Bulgarian") . ' (CP 1251)').
421 translate_lang_opt('', '', 'cro', _("Croatian") . ' (CP 1250)').
422 translate_lang_opt('', 'cs', 'che', _("Czech") . ' (CP 1250)').
423 translate_lang_opt('', '', 'dan', _("Danish")).
424 translate_lang_opt('', 'nl', 'dut', _("Dutch")).
425 translate_lang_opt('!en', 'en', 'eng', _("English")).
426 translate_lang_opt('', '', 'spe', _("European Spanish")).
427 translate_lang_opt('', '', 'fin', _("Finnish")).
428 translate_lang_opt('', 'fr', 'fre', _("French")).
429 translate_lang_opt('', 'de', 'ger', _("German")).
430 translate_lang_opt('', '', 'grk', _("Greek")).
431 translate_lang_opt('', '', 'hun', _("Hungarian") . ' (CP 1250)').
432 translate_lang_opt('', '', 'ice', _("Icelandic")).
433 translate_lang_opt('', 'it', 'ita', _("Italian")).
434 translate_lang_opt('', '', 'jpn', _("Japanese") . ' (Shift JIS)').
435 translate_lang_opt('', '', 'spl', _("Latin American Spanish")).
436 translate_lang_opt('', 'no*', 'nor', _("Norwegian")).
437 translate_lang_opt('', 'pl', 'pol', _("Polish") . ' (ISO 8859-2)').
438 translate_lang_opt('', '', 'poe', _("Portuguese")).
439 translate_lang_opt('', '', 'rom', _("Romanian") . ' (CP 1250)').
440 translate_lang_opt('', 'ru', 'rus', _("Russian") . ' (CP 1251)').
441 translate_lang_opt('', '', 'sel', _("Serbian") . ' (CP 1250)').
442 translate_lang_opt('', '', 'slo', _("Slovenian") . ' (CP 1250)').
443 translate_lang_opt('', 'es', 'spa', _("Spanish")).
444 translate_lang_opt('', 'sv', 'swe', _("Swedish")).
5cfb96b9 445 translate_lang_opt('', '', 'tur', _("Turkish") . ' (CP 1254)').
38a7b6a0 446 translate_lang_opt('', '', 'wel', _("Welsh")).
447 '</SELECT>';
448 printf( _("%s to %s"), $left, $right );
449 echo 'InterTran: <input type=submit value="' . _("Translate") . '">';
450
849bdf42 451 translate_table_end();
452}
453
454function translate_form_gpltrans($message) {
455 translate_new_form('http://www.translator.cx/cgi-bin/gplTrans');
03c13808 456 echo '<select name="language">'.
38a7b6a0 457 translate_lang_opt('nl', 'nl', 'dutch_dict', _("Dutch")).
458 translate_lang_opt('fr', 'fr', 'french_dict', _("French")).
459 translate_lang_opt('de', 'de', 'german_dict', _("German")).
460 translate_lang_opt('', '', 'indonesian_dict', _("Indonesian")).
461 translate_lang_opt('it', 'it', 'italian_dict', _("Italian")).
462 translate_lang_opt('', '', 'latin_dict', _("Latin")).
463 translate_lang_opt('pt', 'pt', 'portuguese_dict', _("Portuguese")).
464 translate_lang_opt('es', 'es', 'spanish_dict', _("Spanish")).
03c13808 465 '</select>';
466 echo '<select name="toenglish">';
467 echo '<option value="yes" >'. _("to English") . '</option>';
468 echo '<option value="no" selected>' . _("from English") . '</option></select>';
469 echo "<input type=hidden name=text value=\"$message\">".
38a7b6a0 470 'GPLTrans: <input type="submit" value="' . _("Translate") . '">';
471
849bdf42 472 translate_table_end();
473}
474
475function translate_form_dictionary($message) {
03c13808 476 translate_new_form('http://dictionary.reference.com/translate/text.html');
477 list($usec, $sec) = explode(" ",microtime());
478 $time = $sec . (float)$usec*100000000;
479 echo "<input type=hidden name=text value=\"$message\">".
480 "<input type=hidden name=r value=\"$time\">".
38a7b6a0 481 '<SELECT NAME="lp">'.
482 translate_lang_opt('en', 'fr', 'en_fr',
483 sprintf( _("%s to %s"),
484 _("English"),
485 _("French"))) .
03c13808 486 translate_lang_opt('', 'ge', 'en_ge',
38a7b6a0 487 sprintf( _("%s to %s"),
488 _("English"),
489 _("German"))) .
490 translate_lang_opt('', 'it', 'en_it',
491 sprintf( _("%s to %s"),
492 _("English"),
493 _("Italian"))) .
494 translate_lang_opt('', 'pt*', 'en_pt',
495 sprintf( _("%s to %s"),
496 _("English"),
497 _("Portuguese"))) .
03c13808 498 translate_lang_opt('', 'es', 'en_es',
38a7b6a0 499 sprintf( _("%s to %s"),
500 _("English"),
501 _("Spanish"))) .
502 translate_lang_opt('fr', '', 'fr_en',
503 sprintf( _("%s to %s"),
504 _("French"),
505 _("English"))) .
506 translate_lang_opt('', '', 'fr_ge',
507 sprintf( _("%s to %s"),
508 _("French"),
509 _("German"))) .
510 translate_lang_opt('', '', 'ge_fr',
511 sprintf( _("%s to %s"),
512 _("German"),
513 _("French"))) .
03c13808 514 translate_lang_opt('de', '', 'ge_en',
38a7b6a0 515 sprintf( _("%s to %s"),
516 _("German"),
517 _("English"))) .
518 translate_lang_opt('it', '', 'it_en',
519 sprintf( _("%s to %s"),
520 _("Italian"),
521 _("English"))) .
522 translate_lang_opt('pt*', '', 'pt_en',
523 sprintf( _("%s to %s"),
524 _("Portuguese"),
525 _("English"))) .
03c13808 526 translate_lang_opt('es', '', 'es_en',
38a7b6a0 527 sprintf( _("%s to %s"),
528 _("Spanish"),
529 _("English"))) .
04f6008a 530 '</SELECT>'.
38a7b6a0 531 'Dictionary.com: <INPUT TYPE="submit" VALUE="'._("Translate").'">';
532
849bdf42 533 translate_table_end();
534}
702272dc 535
536function translate_form_otenet($message) {
537 translate_new_form('http://systran.otenet.gr/cgi-bin/systran.cgi');
538?>
539 <input type="hidden" name="doit" value="done">
540 <INPUT NAME="partner" VALUE="OTEnet-en" type="hidden">
541 <input type="hidden" name="urltext" value="<?php echo $message; ?>">
542 <select name="lp" size="1"><?php
543 echo translate_lang_opt('en', 'el', 'en_el',
544 sprintf( _("%s to %s"),
545 _("English"),
546 _("Greek"))) .
547 translate_lang_opt('el', 'en', 'el_en',
548 sprintf( _("%s to %s"),
549 _("Greek"),
550 _("English"))) .
551 translate_lang_opt('fr', 'el', 'fr_el',
552 sprintf( _("%s to %s"),
553 _("French"),
554 _("Greek"))) .
555 translate_lang_opt('el', 'fr', 'el_fr',
556 sprintf( _("%s to %s"),
557 _("Greek"),
60b628ea 558 _("French"))) .
559 translate_lang_opt('#', '', '', "----------------") .
560 translate_lang_opt('en', 'fr', 'en_fr',
561 sprintf( _("%s to %s"),
562 _("English"),
563 _("French"))) .
564 translate_lang_opt('fr', 'en', 'fr_en',
565 sprintf( _("%s to %s"),
566 _("French"),
567 _("English"))) .
568 translate_lang_opt('en', 'de', 'en_de',
569 sprintf( _("%s to %s"),
570 _("English"),
571 _("German"))) .
572 translate_lang_opt('de', 'en', 'de_en',
573 sprintf( _("%s to %s"),
574 _("German"),
575 _("English"))) .
576 translate_lang_opt('en', 'es', 'en_es',
577 sprintf( _("%s to %s"),
578 _("English"),
579 _("Spanish"))) .
580 translate_lang_opt('es', 'en', 'es_en',
581 sprintf( _("%s to %s"),
582 _("Spanish"),
583 _("English"))) .
584 translate_lang_opt('en', 'it', 'en_it',
585 sprintf( _("%s to %s"),
586 _("English"),
587 _("Italian"))) .
588 translate_lang_opt('it', 'en', 'it_en',
589 sprintf( _("%s to %s"),
590 _("Italian"),
591 _("English"))) .
592 translate_lang_opt('en', 'pt', 'en_pt',
593 sprintf( _("%s to %s"),
594 _("English"),
595 _("Portuguese"))) .
596 translate_lang_opt('pt', 'en', 'pt_en',
597 sprintf( _("%s to %s"),
598 _("Portuguese"),
599 _("English"))) .
600 translate_lang_opt('fr', 'de', 'fr_de',
601 sprintf( _("%s to %s"),
602 _("French"),
603 _("German"))) .
604 translate_lang_opt('de', 'fr', 'de_fr',
605 sprintf( _("%s to %s"),
606 _("German"),
607 _("French"))) .
608 translate_lang_opt('fr', 'es', 'fr_es',
609 sprintf( _("%s to %s"),
610 _("French"),
611 _("Spanish"))) .
612 translate_lang_opt('es', 'fr', 'es_fr',
613 sprintf( _("%s to %s"),
614 _("Spanish"),
615 _("French"))) .
616 translate_lang_opt('fr', 'nl', 'fr_nl',
617 sprintf( _("%s to %s"),
618 _("French"),
619 _("Dutch"))) .
620 translate_lang_opt('nl', 'fr', 'nl_fr',
621 sprintf( _("%s to %s"),
622 _("Dutch"),
702272dc 623 _("French"))) ;
624 echo '</select>'.
625 'OTEnet: <input type="Submit" value="' . _("Translate") . '">';
626 translate_table_end();
627
628}
b0abf4b1 629
630function translate_form_promt($message) {
631 translate_new_form('http://www.translate.ru/text.asp#tr_form');
632 echo '<input type="hidden" name="status" value="translate">';
633 echo "<input type=\"hidden\" name=\"source\" value=\"$message\">";
634 echo _("Interface language")." : ";
635 echo "<select size=\"1\" name=\"lang\">\n";
636 echo "<option value=\"en\">" . _("English") . "</option>\n";
637 echo "<option value=\"ru\">" . _("Russian") . "</option>\n";
638 echo "<option value=\"de\">" . _("German") . "</option>\n";
639 echo "<option value=\"fr\">" . _("French") . "</option>\n";
640 echo "<option value=\"es\">" . _("Spanish") . "</option>\n";
641 echo "</select><br>\n";
642 echo _("Translation direction")." : ";
643 echo '<select size="1" id="direction" name="direction">';
644 echo translate_lang_opt('en', 'ru', 'er',
645 sprintf( _("%s to %s"),
646 _("English"),
647 _("Russian"))) .
648 translate_lang_opt('ru', 'en', 're',
649 sprintf( _("%s to %s"),
650 _("Russian"),
651 _("English"))) .
652 translate_lang_opt('de', 'ru', 'gr',
653 sprintf( _("%s to %s"),
654 _("German"),
655 _("Russian"))) .
656 translate_lang_opt('ru', 'de', 'rg',
657 sprintf( _("%s to %s"),
658 _("Russian"),
659 _("German"))) .
660 translate_lang_opt('fr', 'ru', 'fr',
661 sprintf( _("%s to %s"),
662 _("French"),
663 _("Russian"))) .
664 translate_lang_opt('ru', 'fr', 'rf',
665 sprintf( _("%s to %s"),
666 _("Russian"),
667 _("French"))) .
668 translate_lang_opt('es', 'ru', 'sr',
669 sprintf( _("%s to %s"),
670 _("Spanish"),
671 _("Russian"))) .
672 translate_lang_opt('it', 'ru', 'ir',
673 sprintf( _("%s to %s"),
674 _("Italian"),
675 _("Russian"))) .
676 translate_lang_opt('en', 'de', 'eg',
677 sprintf( _("%s to %s"),
678 _("English"),
679 _("German"))) .
680 translate_lang_opt('de', 'en', 'ge',
681 sprintf( _("%s to %s"),
682 _("German"),
683 _("English"))) .
684 translate_lang_opt('en', 'es', 'es',
685 sprintf( _("%s to %s"),
686 _("English"),
687 _("Spanish"))) .
688 translate_lang_opt('es', 'en', 'se',
689 sprintf( _("%s to %s"),
690 _("Spanish"),
691 _("English"))) ;
692 echo "</select><br>\n";
693 echo "<input type=\"hidden\" name=\"template\" value=\"General\">\n";
694 echo 'PROMT: <input type="submit" value="' . _("Translate") . '">';
695
696 translate_table_end();
697}
698
849bdf42 699?>