Internationalization
[squirrelmail.git] / plugins / squirrelspell / modules / init.mod.php
1 <?php
2
3 /**
4 ** INIT.MOD.PHP -- Squirrelspell module
5 **
6 ** Copyright (c) 1999-2001 The SquirrelMail development team
7 ** Licensed under the GNU GPL. For full terms see the file COPYING.
8 **
9 ** Initial loading of the popup window interface.
10 **
11 ** $Id$
12 **/
13
14 // See if we need to give user the option of choosing which dictionary
15 // he wants to use to spellcheck his message.
16 $langs=sqspell_getSettings(null);
17 $msg = '<form method="post">'.
18 '<input type="hidden" name="MOD" value="check_me">'.
19 '<input type="hidden" name="sqspell_text">'.
20 '<p align="center">';
21 if (sizeof($langs)==1){
22 // only one dictionary defined by the users. Submit the form
23 // automatically.
24 $onload="sqspell_init(true)";
25 $msg .= _("Please wait, communicating with the server...") .
26 '</p>'.
27 "<input type=\"hidden\" name=\"sqspell_use_app\" value=\"$langs[0]\">";
28 } else {
29 // more than one dictionary. Let the user choose the dictionary first
30 // then manually submit the form.
31 $onload="sqspell_init(false)";
32 $msg .= _("Please choose which dictionary you would like to use to spellcheck this message:").
33 '</p><p align="center">' .
34 '<select name="sqspell_use_app">';
35 for ($i=0; $i<sizeof($langs); $i++){
36 $msg .= "<option";
37 if (!$i) {
38 $msg .= ' selected';
39 }
40 $msg .= " value=\"$langs[$i]\"> " . _($langs[$i]) . "</option>\n";
41 }
42
43 $msg .= ' </select>'.
44 '<input type="submit" value="' . _("Go") . '">'.
45 '</p>';
46 }
47 $msg .="</form>\n";
48 sqspell_makeWindow($onload, _("SquirrelSpell Initiating"), "init.js", $msg);
49
50 ?>