From 2b5a715784c5414a95c4eba8b20e3dd47f45131b Mon Sep 17 00:00:00 2001 From: philippe_mingo Date: Thu, 15 Nov 2001 13:00:20 +0000 Subject: [PATCH] Internationalization git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1759 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/squirrelspell/INSTALL | 9 +- .../modules/crypto_badkey.mod.php | 114 +++++++++-------- .../squirrelspell/modules/edit_dic.mod.php | 121 ++++++++++-------- .../squirrelspell/modules/enc_setup.mod.php | 115 +++++++++-------- .../squirrelspell/modules/forget_me.mod.php | 99 ++++++++------ .../modules/forget_me_not.mod.php | 92 +++++++------ plugins/squirrelspell/modules/init.mod.php | 86 +++++++------ .../squirrelspell/modules/lang_change.mod.php | 118 +++++++++-------- .../squirrelspell/modules/lang_setup.mod.php | 70 ++++++---- .../modules/options_main.mod.php | 68 ++++++---- plugins/squirrelspell/sqspell_config.dist | 88 ------------- plugins/squirrelspell/sqspell_config.php | 3 +- plugins/squirrelspell/sqspell_functions.php | 21 +-- 13 files changed, 516 insertions(+), 488 deletions(-) delete mode 100644 plugins/squirrelspell/sqspell_config.dist diff --git a/plugins/squirrelspell/INSTALL b/plugins/squirrelspell/INSTALL index 87750c7b..808dec0c 100644 --- a/plugins/squirrelspell/INSTALL +++ b/plugins/squirrelspell/INSTALL @@ -1,11 +1,8 @@ SquirrelSpell-v0.3.1 --------------------- -Untar SquirrelSpell into your squirrelmail/plugins directory. Move -sqspell_config.dist to sqspell_config.php if this is a fresh install. If -upgrading, just untar over your old installation. - -Modify the sqspell_config.php file making sure you have ispell or aspell +Untar SquirrelSpell into your squirrelmail/plugins directory. Modify the +sqspell_config.php file making sure you have ispell or aspell available on your system and located in PHP's path. The squirrelspell doesn't check for that and if it is not available, you're just going to get a "No errors found" message every time. :) Quite pleasing, but not @@ -18,7 +15,7 @@ your squirrelmail install directory. Enjoy and report bugs. ;) -This is a commented sqspell_config.php +This is an options commented sqspell_config.php Your personal dictionary was erased.

"; - sqspell_makePage("Dictionary Erased", null, $msg); - } else { - $msg = "

Your personal dictionary was erased. Please close this window and - click \"Check Spelling\" button again to start your spellcheck over.

-

- -

"; - sqspell_makeWindow(null, "Dictionary Erased", null, $msg); - } - exit; - } - if ($old_key){ - // User provided another key to try and decrypt the dictionary. - // call sqspell_getWords. If this key fails, the function will - // handle it. - $words=sqspell_getWords(); - // It worked! Pinky, you're a genius! - // Write it back this time encrypted with a new key. - sqspell_writeWords($words); - // See where we are and call a necessary GUI-wrapper. - if (strstr($SCRIPT_NAME, "sqspell_options")){ - $msg="

Your personal dictionary was re-encrypted successfully. Now - return to the "SpellChecker options" menu and make your selection - again.

"; - sqspell_makePage("Successful Re-encryption", null, $msg); - } else { - $msg = "

Your personal dictionary was re-encrypted successfully. Please - close this window and click \"Check Spelling\" button again to start your - spellcheck over.

-

"; - sqspell_makeWindow(null, "Dictionary re-encrypted", null, $msg); - } - exit; - } -?> + /** + ** CRYPTO_BADKEY.MOD.PHP -- Squirrelspell module + ** + ** Copyright (c) 1999-2001 The SquirrelMail development team + ** Licensed under the GNU GPL. For full terms see the file COPYING. + ** + ** This module tries to decrypt the user dictionary with a newly provided + ** old password, or erases the file if everything else fails. :( + ** + ** $Id$ + **/ + + // Just for fidian! :) + global $delete_words, $SCRIPT_NAME, $old_key; + if ($delete_words=='ON'){ + // All attemts to decrypt the file were futile. Erase the bastard and + // hope this never happens again. + sqspell_deleteWords(); + // See where we were called from -- pop-up window or options page + // and call whichever wrapper is appropriate. + if (strstr($SCRIPT_NAME, 'sqspell_options')){ + $msg='

' . _("Your personal dictionary was erased.") . '

'; + sqspell_makePage(_("Dictionary Erased"), null, $msg); + } else { + $msg = '

' . ("Your personal dictionary was erased. Please close this window and click \"Check Spelling\" button again to start your spellcheck over." ) . + '

'. + '

'. + ''. + '

'; + sqspell_makeWindow(null, _("Dictionary Erased"), null, $msg); + } + exit; + } + + if ($old_key){ + // User provided another key to try and decrypt the dictionary. + // call sqspell_getWords. If this key fails, the function will + // handle it. + $words=sqspell_getWords(); + // It worked! Pinky, you're a genius! + // Write it back this time encrypted with a new key. + sqspell_writeWords($words); + // See where we are and call a necessary GUI-wrapper. + if (strstr($SCRIPT_NAME, 'sqspell_options')){ + $msg = '

' . + _("Your personal dictionary was re-encrypted successfully. Now " + "return to the "SpellChecker options" menu and make your selection " + "again." ) . '

'; + sqspell_makePage(_("Successful Re-encryption"), null, $msg); + } else { + $msg = '

'. + _("Your personal dictionary was re-encrypted successfully. Please " + "close this window and click \"Check Spelling\" button again to start your " + "spellcheck over.") . '

' . + '

'; + sqspell_makeWindow(null, _("Dictionary re-encrypted"), null, $msg); + } + exit; + } + +?> \ No newline at end of file diff --git a/plugins/squirrelspell/modules/edit_dic.mod.php b/plugins/squirrelspell/modules/edit_dic.mod.php index 2bb16ff6..f430e674 100644 --- a/plugins/squirrelspell/modules/edit_dic.mod.php +++ b/plugins/squirrelspell/modules/edit_dic.mod.php @@ -1,57 +1,68 @@ No words in your personal dictionary.

"); - } else { - // We're loaded with booty. - $pre_msg = "

Please check any words you wish to delete from your dictionary.

\n"; - $pre_msg .= "\n"; - $langs=sqspell_getSettings($words); - for ($i=0; $i -
$langs[$i] dictionary
-
- - - - - - \n"; - } - } - // Check if all dictionaries were empty. - if (!$msg) - $msg = "

No words in your dictionary.

"; - else $msg .= "
\n"; - $words_ary=explode("\n", $lang_words); - array_pop($words_ary); - array_shift($words_ary); - // Do some fancy stuff to separate the words into three columns. - for ($j=0; $j\n"; - $msg .= " $words_ary[$j]
"; + + /** + ** EDIT_DIC.MOD.PHP -- Squirrelspell module + ** + ** Copyright (c) 1999-2001 The SquirrelMail development team + ** Licensed under the GNU GPL. For full terms see the file COPYING. + ** + ** This module handles the encryption/decryption of the user dictionary + ** if the user so chooses from the options page. + ** + ** $Id$ + **/ + + // fidian, you owe me a pack of Guinness! :) + global $color; + $words=sqspell_getWords(); + if (!$words){ + // Agt. Smith: "You're empty." + // Neo: "So are you." + sqspell_makePage(_("Personal Dictionary"), null, '

' . _("No words in your personal dictionary.") . '

'); + } else { + // We're loaded with booty. + $pre_msg = '

' . _("Please check any words you wish to delete from your dictionary.") . "

\n"; + $pre_msg .= "\n"; + $langs=sqspell_getSettings($words); + for ($i=0; $i'. + '' . + "\n"; + } } - $msg .= " - -
" . + sprintf( _("%s dictionary"), $langs[$i] ) . '
'. + ''. + ''. + ''. + ''. + ''. + "
\n"; + $words_ary=explode("\n", $lang_words); + array_pop($words_ary); + array_shift($words_ary); + // Do some fancy stuff to separate the words into three columns. + for ($j=0; $j\n"; + $msg .= " $words_ary[$j]
"; + } + $msg .= '
". + ''. + '

'. + "
-
- -

-
"; - sqspell_makePage("Edit your Personal Dictionary", null, $msg); - } -?> + // Check if all dictionaries were empty. + if (!$msg) { + $msg = '

' . _("No words in your personal dictionary.") . '

'; + } else { + $msg .= '
'; + } + sqspell_makePage(_("Edit your Personal Dictionary"), null, $msg); + } + +?> \ No newline at end of file diff --git a/plugins/squirrelspell/modules/enc_setup.mod.php b/plugins/squirrelspell/modules/enc_setup.mod.php index b70050a3..411b544a 100644 --- a/plugins/squirrelspell/modules/enc_setup.mod.php +++ b/plugins/squirrelspell/modules/enc_setup.mod.php @@ -1,53 +1,66 @@ Your personal dictionary is currently encrypted. This - helps protect your privacy in case the web-mail system gets compromized and your - personal dictionary ends up stolen. It is currently encrypted with the password - you use to access your mailbox, making it hard for anyone to see what is stored - in your personal dictionary.

-

ATTENTION: If you forget your password, your personal dictionary - will become unaccessible, since it can no longer be decrypted. - If you change your mailbox password, SquirrelSpell will recognize it and prompt you for - your old password in order to re-encrypt the dictionary with a new key.

-
- -

Please decrypt my personal - dictionary and store it in a clear-text format.

-

-
- "; -} else { - // current format is clear text. - $msg = "

Your personal dictionary is currently not encrypted. - You may wish to encrypt your personal dictionary to protect your privacy in case - the webmail system gets compromized and your personal dictionary file gets stolen. - When encrypted, the file's contents look garbled and are hard to decrypt without - knowing the correct key (which is your mailbox password).

- ATTENTION: If you decide to encrypt your personal dictionary, - you must remember that it gets "hashed" with your mailbox password. If - you forget your mailbox password and the administrator changes it to a new value, - your personal dictionary will become useless and will have to be created anew. - However, if you or your system administrator change your mailbox password but you - still have the old password at hand, you will be able to enter the old key to - re-encrypt the dictionary with the new value.

-
- -

Please encrypt my personal - dictionary and store it in an encrypted format.

-

-
- "; -} - sqspell_makePage("Personal Dictionary Crypto Settings", "crypto_settings.js", $msg); -?> + /** + ** ENC_SETUP.MOD.PHP -- Squirrelspell module + ** + ** Copyright (c) 1999-2001 The SquirrelMail development team + ** Licensed under the GNU GPL. For full terms see the file COPYING. + ** + ** This module shows the user a nice invitation to encrypt or decypt + ** his/her personal dictionary and explains the caveats of such a decision. + ** + ** $Id$ + **/ + + // Something for our friends with E_ALL for error_reporting: + global $SQSPELL_CRYPTO; + + $words=sqspell_getWords(); + if ($SQSPELL_CRYPTO){ + // Current format is encrypted. + $msg = + _("

Your personal dictionary is currently encrypted. This " + "helps protect your privacy in case the web-mail system gets compromized and your " + "personal dictionary ends up stolen. It is currently encrypted with the password " + "you use to access your mailbox, making it hard for anyone to see what is stored " + "in your personal dictionary.

" + "

ATTENTION: If you forget your password, your personal dictionary " + "will become unaccessible, since it can no longer be decrypted. " + "If you change your mailbox password, SquirrelSpell will recognize it and prompt you for " + "your old password in order to re-encrypt the dictionary with a new key.

") . + '
'. + ''. + '

'. + _("Please decrypt my personal dictionary and store it in a clear-text format." ) . + '

'. + '

'. + '
'; + } else { + // current format is clear text. + $msg = + _("

Your personal dictionary is currently not encrypted. " + "You may wish to encrypt your personal dictionary to protect your privacy in case " + "the webmail system gets compromized and your personal dictionary file gets stolen. " + "When encrypted, the file's contents look garbled and are hard to decrypt without " + "knowing the correct key (which is your mailbox password).

" + "ATTENTION: If you decide to encrypt your personal dictionary, " + "you must remember that it gets "hashed" with your mailbox password. If " + "you forget your mailbox password and the administrator changes it to a new value, " + "your personal dictionary will become useless and will have to be created anew. " + "However, if you or your system administrator change your mailbox password but you " + "still have the old password at hand, you will be able to enter the old key to " + "re-encrypt the dictionary with the new value.

"). + '
'. + ''. + '

'. + _("Please encrypt my personal dictionary and store it in an encrypted format.") . + '

'. + '

'. + '
'; + } + sqspell_makePage(_("Personal Dictionary Crypto Settings"), "crypto_settings.js", $msg); + +?> \ No newline at end of file diff --git a/plugins/squirrelspell/modules/forget_me.mod.php b/plugins/squirrelspell/modules/forget_me.mod.php index 73444a0b..d484a1a5 100644 --- a/plugins/squirrelspell/modules/forget_me.mod.php +++ b/plugins/squirrelspell/modules/forget_me.mod.php @@ -1,44 +1,59 @@ Deleting the following entries from $sqspell_use_app dictionary:

-