You're right Bunzo 8)
[squirrelmail.git] / plugins / translate / options.php
CommitLineData
849bdf42 1<?php
2 /**
3 ** options.php
4 **
5 ** Pick your translator to translate the body of incoming mail messages
6 **
7 **/
8
9 chdir("..");
10
11 session_start();
12
13 if (!isset($config_php))
14 include("../config/config.php");
15 if (!isset($strings_php))
16 include("../functions/strings.php");
17 if (!isset($page_header_php))
18 include("../functions/page_header.php");
19 if (!isset($display_messages_php))
20 include("../functions/display_messages.php");
21 if (!isset($imap_php))
22 include("../functions/imap.php");
23 if (!isset($array_php))
24 include("../functions/array.php");
25 if (!isset($i18n_php))
26 include("../functions/i18n.php");
27
28
29 include("../src/load_prefs.php");
30 displayPageHeader($color, "None");
31
32 $translate_server = getPref($data_dir, $username, "translate_server");
33 if ($translate_server == '')
34 $translate_server = 'babelfish';
35 $translate_location = getPref($data_dir, $username, "translate_location");
36 if ($translate_location == '')
37 $translate_location = 'center';
38 $translate_show_read = getPref($data_dir, $username, 'translate_show_read');
39 $translate_show_send = getPref($data_dir, $username, 'translate_show_send');
40 $translate_same_window = getPref($data_dir, $username, 'translate_same_window');
41
42 function ShowOption($Var, $value, $Desc)
43 {
44 $Var = 'translate_' . $Var;
45
46 global $$Var;
47
48 echo '<option value="' . $value . '"';
49 if ($$Var == $value)
50 {
51 echo ' SELECTED';
52 }
53 echo '>' . $Desc . "</option>\n";
54 }
55
56
57?>
58 <br>
59 <table width=95% align=center border=0 cellpadding=2 cellspacing=0><tr><td bgcolor="<?php echo $color[0] ?>">
60 <center><b><?php echo _("Options") ?> - Translator</b></center>
61 </td></tr></table>
62
63 <p>Your server options are as follows:</p>
64
65 <ul>
66
67 <li><b>Babelfish</b> -
68 13 language pairs,
69 maximum of 1000 characters translated,
70 powered by Systran
71 [ <a href="http://babelfish.altavista.com/"
72 target="_blank">Babelfish</a> ]</li>
73
74 <li><b>Go.com</b> -
75 10 language pairs,
76 maximum of 25 kilobytes translated,
77 powered by Systran
78 [ <a href="http://translator.go.com/"
79 target="_blank">Translator.Go.com</a> ]</li>
80
81 <li><b>Dictionary.com</b> -
82 12 language pairs,
83 no known limits,
84 powered by Systran
85 [ <a href="http://www.dictionary.com/translate"
86 target="_blank">Dictionary.com</a> ]</li>
87
88 <li><b>InterTran</b> -
89 767 language pairs,
90 no known limits,
91 powered by Translation Experts's InterTran
92 [ <a href="http://www.tranexp.com/"
93 target="_blank">Translation Experts</a> ]</li>
94
95 <li><b>GPLTrans</b> -
96 8 language pairs,
97 no known limits,
98 powered by GPLTrans (free, open source)
99 [ <a href="http://www.translator.cx/"
100 target="_blank">GPLTrans</a> ]</li>
101
102 </ul>
103
104 <p>You also decide if you want the translation box displayed,
105 and where it will be located.</p>
106
107 <form action="../../src/options.php" method=post>
108 <table border=0 cellpadding=0 cellspacing=2>
109 <tr><td align=right nowrap>Select your translator:</td>
110 <td><select name="translate_translate_server">
111<?PHP
112 ShowOption('server', 'babelfish', 'Babelfish');
113 ShowOption('server', 'go', 'Go.com');
114 ShowOption('server', 'dictionary', 'Dictionary.com');
115 ShowOption('server', 'intertran', 'Intertran');
116 ShowOption('server', 'gpltrans', 'GPLTrans');
117?> </select>
118 </td></tr>
119 <tr><td align=right nowrap valign="top">When reading:</td>
120 <td><input type=checkbox name="translate_translate_show_read"<?PHP
121 if ($translate_show_read)
122 echo " CHECKED";
123 ?>> - Show translation box
124 <select name="translate_translate_location">
125<?PHP
126 ShowOption('location', 'left', 'to the left');
127 ShowOption('location', 'center', 'in the center');
128 ShowOption('location', 'right', 'to the right');
129?> </select><br>
130 <input type=checkbox name="translate_translate_same_window"<?PHP
131 if ($translate_same_window)
132 echo " CHECKED";
133 ?>> - Translate inside the SquirrelMail frames</td></tr>
134 <tr><td align=right nowrap>When composing:</td>
135 <td><input type=checkbox name="translate_translate_show_send"<?PHP
136 if ($translate_show_send)
137 echo " CHECKED";
138 ?>> - Not yet functional, currently does nothing</td></tr>
139 <tr><td></td><td>
140 <input type="submit" value="Submit" name="submit_translate">
141 </td></tr>
142 </table>
143 </form>
144</body></html>