fixed some bugs in url parsing, and in conf.pl
[squirrelmail.git] / functions / i18n.php
index 13c31124365584694603cd980ba861ca7ba07c5a..889affd28fa245a24db14d3482451bb4a2b6c461 100644 (file)
@@ -1,4 +1,4 @@
-<?
+<?php
 
 /**
  ** i18n.php
@@ -6,8 +6,8 @@
  ** This file contains variuos functions that are needed to do
  ** internationalization of SquirrelMail.
  **
- ** Internally iso-8859-1 is used as character set. Other characters
- ** are encoded using Unicode entities according to HTML 4.0.
+ ** Internally the output character set is used. Other characters are
+ ** encoded using Unicode entities according to HTML 4.0.
  **
  **/
 
    $languages["en"]["NAME"]    = "English";
    $languages["no"]["NAME"]    = "Norsk";
    $languages["no"]["CHARSET"] = "iso-8859-1";
-   $languages["de"]["NAME"]    = "Deutcsh";
+   $languages["de"]["NAME"]    = "Deutsch";
    $languages["de"]["CHARSET"] = "iso-8859-1";
    $languages["ru"]["NAME"]    = "Russian KOI8-R";
    $languages["ru"]["CHARSET"] = "koi8-r";
+   $languages["pl"]["NAME"]    = "Polish";
+   $languages["pl"]["CHARSET"] = "iso-8859-2";
+   $languages["sv"]["NAME"]    = "Swedish";
+   $languages["sv"]["CHARSET"] = "iso-8859-1";
+   $languages["nl"]["NAME"]    = "Dutch";
+   $languages["nl"]["CHARSET"] = "iso-8859-1";
+   $languages["pt_BR"]["NAME"] = "Portugese (Brazil)";
+   $languages["pt_BR"]["CHARSET"] = "iso-8859-1";
 
    // Decodes a string to the internal encoding from the given charset
    function charset_decode ($charset, $string) {
+      global $debug_mime;
+
       // All HTML special characters are 7 bit and can be replaced first
       $string = htmlspecialchars ($string);
 
       $charset = strtolower($charset);
 
+      if ($debug_mime) $string = $charset.":".$string;
+
       if (ereg("iso-8859-(.*)", $charset, $res)) {
          if ($res[1] == "1")
             return charset_decode_iso_8859_1 ($string);