removed language codes from conf.pl. List is too big.
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 31 Aug 2004 17:27:10 +0000 (17:27 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 31 Aug 2004 17:27:10 +0000 (17:27 +0000)
$default_charset can be used to change charset of English translation.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7993 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
config/conf.pl
config/config_default.php
functions/i18n.php

index 9dcfe87e3b9ae0d08f08486f7843719b9ae1d624..d02a34ee903ad6b18e9224aa818af931f337c735 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -93,6 +93,8 @@ Version 1.5.1 -- CVS
   - $agresive_decoding configuration option changed to $aggressive_decoding.
     Fixed spelling.
   - Added $loosy_encoding option (provides fix for #806698)
+  - Reenabled use of $default_charset option. Option works only with en_US 
+    translation in order to prevent language/charset misconfiguration.
 
 Version 1.5.0
 --------------------
index 64a48fd64eff83965c2dcad4f8b52d98b31fc00a..5fb802bc3575fed9d656fb146eb50c3da331d225 100755 (executable)
@@ -2784,13 +2784,10 @@ sub commandA1 {
 }
 # Default Charset
 sub commandA2 {
-#    print "This option controls what character set is used when sending\n";
-#    print "mail and when sending HTML to the browser.  Do not set this\n";
-#    print "to US-ASCII, use ISO-8859-1 instead.  For cyrillic, it is best\n";
-#    print "to use KOI8-R, since this implementation is faster than most\n";
-#    print "of the alternatives\n";
-    print "This option is obsolate. Default charset depends on language\n";
-    print "you have selected in \"Default language\" option.\n";
+    print "This option controls what character set is used when sending\n";
+    print "mail and when sending HTML to the browser. Option works only\n";
+    print "with US English (en_US) translation. Other translations use\n";
+    print "charsets that are set in functions/i18n.php.\n";
     print "\n";
 
     print "[$WHT$default_charset$NRM]: $WHT";
@@ -2834,18 +2831,7 @@ sub commandA4 {
     print "listed. If you enter special key \'none\' - user won't be able to change";
     print "language and interface will use language set it \"Default language\" option.\n";
     print "\n";
-    print "Valid language names are:\n";
-    print " ar (Arabic), bg_BG (Bulgarian), ca_ES (Catalan), cy_GB (Welsh)\n";
-    print " cs_CZ (Chech), da_DK (Danish), de_DE (German), el_GR (Greek),\n";
-    print " en_US (English), es_ES (Spanish), et_EE (Estonian), fi_FI (Finnish),\n";
-    print " fo_FO (Faroese), fr_FR (French), he_IL (Hebrew), hr_HR (Croatian),\n";
-    print " hu_HU (Hungarian), id_ID (Indonesian), is_IS (Icelandic), it_IT (Italian),\n";
-    print " ja_JP (Japanese), ko_KR (Korean), lt_LT (Lithuanian), ms_MY (Malay),\n";
-    print " nl_NL (Dutch), nn_NO (Norwegian (Nynorsk)), no_NO (Norwegian (Bokmal)),\n";
-    print " pl_PL (Polish), pt_BR (Portuguese (Brazil)), pt_PT (Portuguese (Portugal)),\n";
-    print " ro_RO (Romanian), ru_RU (Russian), sk_SK (Slovak), sl_SI (Slovenian),\n";
-    print " sr_YU (Serbian), sv_SE (Swedish), th_TH (Thai), tr_TR (Turkish),\n";
-    print " zh_CN (Chinese Simplified), zh_TW (Chinese Traditional).\n";
+    print "You can find valid language names in doc/i18n.txt.\n";
     print "\n";
     print "[$WHT$available_languages$NRM]: $WHT";
     $new_available_languages = <STDIN>;
index b93b36c60ed37187d676e799a0f02f9ba7a97a2a..cb69b50e7a8d3f2793e08c92b9f5689e0f6c42b0 100644 (file)
@@ -803,13 +803,11 @@ $squirrelmail_default_language = 'en_US';
 /**
  * Default Charset
  *
- * This option controls what character set is used when sending mail
- * and when sending HTML to the browser. Do not set this to US-ASCII,
- * use ISO-8859-1 instead.
- * 
- * You can set this option, only if $squirrelmail_default_language setting
- * contains 'en_US' string. In any other case system does not allow 
- * making mistakes with incorrect language and charset combinations.
+ * This option controls what character set is used when sending
+ * mail and when sending HTML to the browser. Option works only
+ * with US English (en_US) translation. Other translations use
+ * charsets that are set in functions/i18n.php.
+ *
  * @global string $default_charset
  */
 $default_charset = 'iso-8859-1';
index fd8502295da37d29cf74a88272eaf4c5ac7ed394..5d5d818ec25745a71791abae5fc681b277863cd5 100644 (file)
@@ -196,7 +196,7 @@ function set_up_language($sm_language, $do_search = false, $default = false) {
 
     static $SetupAlready = 0;
     global $use_gettext, $languages,
-           $squirrelmail_language, $squirrelmail_default_language,
+           $squirrelmail_language, $squirrelmail_default_language, $default_charset,
            $sm_notAlias, $username, $data_dir;
 
     if ($SetupAlready) {
@@ -296,10 +296,12 @@ function set_up_language($sm_language, $do_search = false, $default = false) {
             }
             mb_internal_encoding('EUC-JP');
             mb_http_output('pass');
+        } elseif ($squirrelmail_language == 'en_US') {
+            header( 'Content-Type: text/html; charset=' . $default_charset );
         } else {
-        header( 'Content-Type: text/html; charset=' . $languages[$sm_notAlias]['CHARSET'] );
+            header( 'Content-Type: text/html; charset=' . $languages[$sm_notAlias]['CHARSET'] );
+        }
     }
-}
     return 0;
 }
 
@@ -333,7 +335,7 @@ function set_my_charset(){
         $my_language = $languages[$my_language]['ALIAS'];
     }
     $my_charset = $languages[$my_language]['CHARSET'];
-    if ($my_charset) {
+    if ($my_language!='en_US') {
         $default_charset = $my_charset;
     }
 }