7 * Copyright (c) 1999-2005 The SquirrelMail Project Team
8 * Licensed under the GNU GPL. For full terms see the file COPYING.
10 * This module changes the international dictionaries selection
11 * for the user. Called after LANG_SETUP module.
13 * @author Konstantin Riabitsev <icon@duke.edu>
16 * @subpackage squirrelspell
19 global $SQSPELL_APP_DEFAULT;
21 if (! sqgetGlobalVar('use_langs',$use_langs,SQ_POST)) {
22 $use_langs = array($SQSPELL_APP_DEFAULT);
25 if (! sqgetGlobalVar('lang_default',$lang_default,SQ_POST)) {
26 $lang_default = $SQSPELL_APP_DEFAULT;
30 * Rebuild languages. Default language is first one.
32 $new_langs = array($lang_default);
33 foreach ($use_langs as $lang) {
34 if (! in_array($lang,$new_langs)) {
39 if (sizeof($new_langs)>1) {
41 foreach( $new_langs as $a) {
42 $dsp_string .= _(trim($a)) . ', ';
44 // remove last comma and space
45 $dsp_string = substr( $dsp_string, 0, -2 );
48 * i18n: first %s is comma separated list of languages, second %s - default language.
49 * Language names are translated, if they are present in squirrelmail.po file.
50 * make sure that you don't use html codes in language name translations
53 . sprintf(_("Settings adjusted to: %s with %s as default dictionary."),
54 '<strong>'.htmlspecialchars($dsp_string).'</strong>',
55 '<strong>'.htmlspecialchars(_($lang_default)).'</strong>')
59 * Only one dictionary is selected.
62 . sprintf(_("Using %s dictionary for spellcheck." ), '<strong>'.htmlspecialchars(_($new_langs[0])).'</strong>')
67 sqspell_saveSettings($new_langs);
69 sqspell_makePage(_("International Dictionaries Preferences Updated"),