X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fi18n.php;h=2ce457b1f144020b2dfb771ae0a6f10a29749d50;hb=cb48c2455cde2cf6ba67944c45decc4eca7df306;hp=e9605a2761db8d094c928077579ae28de30eb7be;hpb=b80a4da620166bc689d8cdb1973fb29f54202725;p=squirrelmail.git diff --git a/functions/i18n.php b/functions/i18n.php index e9605a27..2ce457b1 100644 --- a/functions/i18n.php +++ b/functions/i18n.php @@ -1,57 +1,150 @@ + + function set_my_charset(){ + // + // There can be a $default_charset setting in the + // config.php file, but the user may have a different language + // selected for a user interface. This function checks the + // language selected by the user and tags the outgoing messages + // with the appropriate charset corresponding to the language + // selection. This is "more right" (tm), than just stamping the + // message blindly with the system-wide $default_charset. + // + global $data_dir, $username, $default_charset, $languages; + $my_language = getPref($data_dir, $username, "language"); + if (!$my_language) return; + while (isset($languages[$my_language]['ALIAS'])) + $my_language = $languages[$my_language]['ALIAS']; + $my_charset=$languages[$my_language]['CHARSET']; + if ($my_charset) $default_charset=$my_charset; + } + +?> \ No newline at end of file