Added systran.otenet.gr Hellenic translations.
[squirrelmail.git] / plugins / translate / options.php
CommitLineData
849bdf42 1<?php
849bdf42 2
8d6a115b 3/**
4 * options.php
5 *
76911253 6 * Copyright (c) 1999-2003 The SquirrelMail Project Team
8d6a115b 7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * Pick your translator to translate the body of incoming mail messages
10 *
11 * $Id$
12 */
aa7fb30c 13
8d6a115b 14/* Path for SquirrelMail required files. */
92219031 15define('SM_PATH','../../');
8d6a115b 16
17/* SquirrelMail required files. */
18require_once(SM_PATH . 'include/validate.php');
19require_once(SM_PATH . 'functions/strings.php');
20require_once(SM_PATH . 'functions/page_header.php');
21require_once(SM_PATH . 'functions/display_messages.php');
22require_once(SM_PATH . 'functions/imap.php');
8d6a115b 23require_once(SM_PATH . 'include/load_prefs.php');
24
25 displayPageHeader($color, 'None');
849bdf42 26
04f6008a 27 if (isset($_POST['submit_translate']) && $_POST['submit_translate'] ) {
28 if (isset($_POST['translate_translate_server'])) {
29 setPref($data_dir, $username, 'translate_server', $_POST['translate_translate_server']);
e38ebf4d 30 } else {
31 setPref($data_dir, $username, 'translate_server', 'babelfish');
32 }
33
04f6008a 34 if (isset($_POST['translate_translate_location'])) {
35 setPref($data_dir, $username, 'translate_location', $_POST['translate_translate_location']);
e38ebf4d 36 } else {
37 setPref($data_dir, $username, 'translate_location', 'center');
38 }
39
04f6008a 40 if (isset($_POST['translate_translate_show_read'])) {
e38ebf4d 41 setPref($data_dir, $username, 'translate_show_read', '1');
42 } else {
43 setPref($data_dir, $username, 'translate_show_read', '');
44 }
45
04f6008a 46 if (isset($_POST['translate_translate_show_send'])) {
e38ebf4d 47 setPref($data_dir, $username, 'translate_show_send', '1');
48 } else {
49 setPref($data_dir, $username, 'translate_show_send', '');
50 }
51
04f6008a 52 if (isset($_POST['translate_translate_same_window'])) {
e38ebf4d 53 setPref($data_dir, $username, 'translate_same_window', '1');
54 } else {
55 setPref($data_dir, $username, 'translate_same_window', '');
56 }
57 }
58
59 $translate_server = getPref($data_dir, $username, 'translate_server');
60 if ($translate_server == '') {
849bdf42 61 $translate_server = 'babelfish';
e38ebf4d 62 }
63 $translate_location = getPref($data_dir, $username, 'translate_location');
64 if ($translate_location == '') {
849bdf42 65 $translate_location = 'center';
e38ebf4d 66 }
67 $translate_show_read = getPref($data_dir, $username, 'translate_show_read');
68 $translate_show_send = getPref($data_dir, $username, 'translate_show_send');
69 $translate_same_window = getPref($data_dir, $username, 'translate_same_window');
70
849bdf42 71
72 function ShowOption($Var, $value, $Desc)
73 {
74 $Var = 'translate_' . $Var;
38a7b6a0 75
849bdf42 76 global $$Var;
38a7b6a0 77
849bdf42 78 echo '<option value="' . $value . '"';
79 if ($$Var == $value)
80 {
81 echo ' SELECTED';
82 }
83 echo '>' . $Desc . "</option>\n";
84 }
38a7b6a0 85
86 function ShowTrad( $tit, $com, $url ) {
87
88 echo "<li><b>$tit</b> - ".
89 $com .
90 "[ <a href=\"$url\" target=\"_blank\">$tit</a> ]</li>";
91
92 }
849bdf42 93
94?>
6206f6c4 95 <table width="95%" align=center border=0 cellpadding=1 cellspacing=0><tr><td bgcolor="<?php echo $color[0] ?>">
38a7b6a0 96 <center><b><?php echo _("Options") . ' - '. _("Translator"); ?></b></center>
849bdf42 97 </td></tr></table>
98
04f6008a 99 <?php if (isset($_POST['submit_translate']) && $_POST['submit_translate'] ) {
100 print "<center><h4>"._("Saved Translation Options")."</h4></center>\n";
101 }?>
102
38a7b6a0 103 <p><?php echo _("Your server options are as follows:"); ?></p>
849bdf42 104
38a7b6a0 105 <ul>
106<?php
107 ShowTrad( 'Babelfish',
108 _("13 language pairs, maximum of 1000 characters translated, powered by Systran"),
109 'http://babelfish.altavista.com/' );
90dbea5c 110// ShowTrad( 'Translator.Go.com',
111// _("10 language pairs, maximum of 25 kilobytes translated, powered by Systran"),
112// 'http://translator.go.com/' );
38a7b6a0 113 ShowTrad( 'Dictionary.com',
114 _("12 language pairs, no known limits, powered by Systran"),
115 'http://www.dictionary.com/translate' );
116 ShowTrad( 'InterTran',
117 _("767 language pairs, no known limits, powered by Translation Experts's InterTran"),
118 'http://www.tranexp.com/' );
119 ShowTrad( 'GPLTrans',
120 _("8 language pairs, no known limits, powered by GPLTrans (free, open source)"),
121 'http://www.translator.cx/' );
122?>
849bdf42 123 </ul>
38a7b6a0 124 <p>
125<?php
e38ebf4d 126 echo _("You also decide if you want the translation box displayed, and where it will be located.") .
127 "<form action=\"$PHP_SELF\" method=post>".
128 '<table border=0 cellpadding=0 cellspacing=2>'.
129 '<tr><td align=right nowrap>' .
130 _("Select your translator:") .
131 '</td>'.
132 '<td><select name="translate_translate_server">';
133
849bdf42 134 ShowOption('server', 'babelfish', 'Babelfish');
90dbea5c 135// ShowOption('server', 'go', 'Go.com');
849bdf42 136 ShowOption('server', 'dictionary', 'Dictionary.com');
137 ShowOption('server', 'intertran', 'Intertran');
138 ShowOption('server', 'gpltrans', 'GPLTrans');
38a7b6a0 139 echo '</select>' .
140 '</td></tr>' .
141 '<tr><td align=right nowrap>' .
142 _("When reading:") .
143 '</td>'.
144 '<td><input type=checkbox name="translate_translate_show_read"';
145 if ($translate_show_read)
146 echo " CHECKED";
147 echo '> - ' . _("Show translation box") .
148 ' <select name="translate_translate_location">';
149 ShowOption('location', 'left', _("to the left"));
150 ShowOption('location', 'center', _("in the center"));
151 ShowOption('location', 'right', _("to the right"));
152 echo '</select><br>'.
153 '<input type=checkbox name="translate_translate_same_window"';
154 if ($translate_same_window)
155 echo " CHECKED";
156 echo '> - ' . _("Translate inside the SquirrelMail frames").
157 '</td></tr>'.
158 '<tr><td align=right nowrap>'.
159 _("When composing:") . '</td>'.
160 '<td><input type=checkbox name="translate_translate_show_send"';
849bdf42 161 if ($translate_show_send)
162 echo " CHECKED";
38a7b6a0 163 echo '> - ' . _("Not yet functional, currently does nothing") .
164 '</td></tr>'.
165 '<tr><td></td><td>'.
166 '<input type="submit" value="' . _("Submit") . '" name="submit_translate">'.
167 '</td></tr>'.
168 '</table>'.
169 '</form>'.
170"</body></html>\n";
e38ebf4d 171
15e6162e 172?>