Stevan Bajić wrote:
On Wed, 17 Mar 2010 21:51:42 +0000
Carlo Rodrigues <[email protected]> wrote:

Hey Stevan.

On Mar 17, 2010, at 19:07 , Stevan Bajić wrote:

On Wed, 17 Mar 2010 18:22:25 +0000
Carlo Rodrigues <[email protected]> wrote:

Hello all,

Hallo,


Is anyone having problems with non-english languages in webui?
Every time I try to change the language from the drop-down menu, I always get a blank page, and no errors in apache log.

This happens on all templates of dspam.cgi and admin.cgi.
I'm using latest git, but this is something that has never worked for me before.

Invoking dspam.cgi?language=en works but, for example, invoking dspam.cgi?language=fr doesn't.

for me it is working. But I don't use Apache. Anyway... are you able to post 
how you have implemented the web-ui in Apache?

Sure.

My  /etc/httpd/conf.d/dspam.conf:

<VirtualHost *:80>
        ServerName 10.0.9.1
        HostnameLookups Off
        UseCanonicalName Off
        ServerSignature On
        SuexecUserGroup dspam dspam
        RewriteEngine on
        RewriteRule ^/$ /cgi-bin/dspam.cgi [R]

        DocumentRoot "/var/www/dspam/htdocs"
        <Directory /var/www/dspam/htdocs>
                Options All +Multiviews FollowSymLinks
                Order deny,allow
                Allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /var/www/dspam/cgi-bin/
        <Directory /var/www/dspam/cgi-bin/>
                Options FollowSymLinks ExecCGI
                AddHandler cgi-script .cgi
                AllowOverride None
                Order deny,allow
                Allow from all
                AuthType Basic
                AuthName "DSPAM Control Center"
                AuthUserFile "/var/www/dspam/users"
                require valid-user
        </Directory>
</VirtualHost>

Could you send your configure.pl as well? And the output of "dspam --version"? And a tree/list 
output of the content in "/var/www/dspam/htdocs" and in "/var/www/dspam/cgi-bin"?



Here it goes.
I forgot to mention, this is a CentOS 5.4 64bit system.

[r...@ravasopp-1 dspam]# dspam --version

DSPAM Anti-Spam Suite GIT (agent/library)

Copyright (c) 2002-2010 DSPAM Project
http://dspam.sourceforge.net.

DSPAM may be copied only under the terms of the GNU General Public License,
a copy of which can be found with the DSPAM distribution kit.

Configuration parameters: '--prefix=/usr' '--mandir=/usr/share/man' '--with-logdir=/var/log/dspam' '--with-dspam-home=/var/dspam' '--with-dspam-home-mode=2775' '--with-dspam-home-owner=dspam' '--with-dspam-home-group=dspam' '--with-dspam-mode=0755' '--with-dspam-owner=dspam' '--with-dspam-group=dspam' '--sysconfdir=/etc' '--enable-daemon' '--enable-clamav' '--enable-virtual-users' '--enable-preferences-extension' '--with-storage-driver=mysql_drv,mysql_drv' '--with-delivery-agent=/usr/sbin/sendmail' '--with-mysql-libraries=/usr/lib64/mysql' '--with-mysql-includes=/usr/include/mysql' '--enable-debug'





[r...@ravasopp-1 dspam]# ls -lR /var/www/dspam
/var/www/dspam:
total 12
drwxr-xr-x 3 dspam dspam 4096 Mar 17 14:12 cgi-bin
drwxr-xr-x 2 dspam dspam 4096 Mar 17 14:12 htdocs
-rw-r--r-- 1 dspam dspam   43 Dec 22 17:50 users

/var/www/dspam/cgi-bin:
total 224
-rwxr-xr-x  1 dspam dspam 30063 Mar 17 11:01 admin.cgi
-rwxr-xr-x  1 dspam dspam  5784 Mar 17 11:01 admingraph.cgi
-rw-r--r--  1 dspam dspam    10 Dec 22 17:47 admins
-rwxr-xr-x  1 dspam dspam  6838 Mar 17 11:01 configure.pl
-rw-r--r--  1 dspam dspam  6840 Mar 17 11:01 configure.pl.in
-rw-r--r--  1 dspam dspam  1383 Mar 17 11:01 default.prefs
-rwxr-xr-x  1 dspam dspam 54317 Mar 17 11:01 dspam.cgi
-rwxr-xr-x  1 dspam dspam  4586 Mar 17 11:01 graph.cgi
-rwxr-xr-x  1 dspam dspam 61392 Mar 17 11:01 htmlize.pl
-rw-r--r--  1 dspam dspam 17168 Mar 17 11:01 rgb.txt
-rw-r--r--  1 dspam dspam   564 Mar 17 11:01 subadmins
drwxr-xr-x 10 dspam dspam  4096 Mar 17 14:12 templates

/var/www/dspam/cgi-bin/templates:
total 96
drw-r--r-- 2 dspam dspam 4096 Mar 17 14:12 cs
drw-r--r-- 2 dspam dspam 4096 Mar 17 14:12 de
drw-r--r-- 2 dspam dspam 4096 Mar 17 14:12 es-es
drw-r--r-- 2 dspam dspam 4096 Mar 17 14:12 fr
drw-r--r-- 2 dspam dspam 4096 Mar 17 14:12 he
-rw-r--r-- 1 dspam dspam 1000 Mar 17 11:01 nav_admin_error.html
-rw-r--r-- 1 dspam dspam 4648 Mar 17 11:01 nav_admin_preferences.html
-rw-r--r-- 1 dspam dspam 3986 Mar 17 11:01 nav_admin_status.html
-rw-r--r-- 1 dspam dspam 1460 Mar 17 11:01 nav_admin_user.html
-rw-r--r-- 1 dspam dspam 1750 Mar 17 11:01 nav_alerts.html
-rw-r--r-- 1 dspam dspam 1694 Mar 17 11:01 nav_analysis.html
-rw-r--r-- 1 dspam dspam 1234 Mar 17 11:01 nav_error.html
-rw-r--r-- 1 dspam dspam  684 Mar 17 11:01 nav_fragment.html
-rw-r--r-- 1 dspam dspam 2668 Mar 17 11:01 nav_history.html
-rw-r--r-- 1 dspam dspam 3771 Mar 17 11:01 nav_performance.html
-rw-r--r-- 1 dspam dspam 4623 Mar 17 11:01 nav_preferences.html
-rw-r--r-- 1 dspam dspam 3650 Mar 17 11:01 nav_quarantine.html
-rw-r--r-- 1 dspam dspam 1730 Mar 17 11:01 nav_viewmessage.html
drw-r--r-- 2 dspam dspam 4096 Mar 17 14:12 pt-br
drw-r--r-- 2 dspam dspam 4096 Mar 17 14:12 ro
drw-r--r-- 2 dspam dspam 4096 Mar 17 14:12 ru
-rw-r--r-- 1 dspam dspam 3928 Mar 17 11:01 strings.pl

/var/www/dspam/cgi-bin/templates/cs:
total 80
-rw-r--r-- 1 dspam dspam 1029 Mar 17 11:01 nav_admin_error.html
-rw-r--r-- 1 dspam dspam 5412 Mar 17 11:01 nav_admin_preferences.html
-rw-r--r-- 1 dspam dspam 4487 Mar 17 11:01 nav_admin_status.html
-rw-r--r-- 1 dspam dspam 1580 Mar 17 11:01 nav_admin_user.html
-rw-r--r-- 1 dspam dspam 1937 Mar 17 11:01 nav_alerts.html
-rw-r--r-- 1 dspam dspam 1838 Mar 17 11:01 nav_analysis.html
-rw-r--r-- 1 dspam dspam 1257 Mar 17 11:01 nav_error.html
-rw-r--r-- 1 dspam dspam  710 Mar 17 11:01 nav_fragment.html
-rw-r--r-- 1 dspam dspam 2955 Mar 17 11:01 nav_history.html
-rw-r--r-- 1 dspam dspam 4359 Mar 17 11:01 nav_performance.html
-rw-r--r-- 1 dspam dspam 5374 Mar 17 11:01 nav_preferences.html
-rw-r--r-- 1 dspam dspam 4197 Mar 17 11:01 nav_quarantine.html
-rw-r--r-- 1 dspam dspam 1799 Mar 17 11:01 nav_viewmessage.html
-rw-r--r-- 1 dspam dspam 4425 Mar 17 11:01 strings.pl

/var/www/dspam/cgi-bin/templates/de:
total 72
-rw-r--r-- 1 dspam dspam 1081 Mar 17 11:01 nav_admin_error.html
-rw-r--r-- 1 dspam dspam 5761 Mar 17 11:01 nav_admin_preferences.html
-rw-r--r-- 1 dspam dspam 4167 Mar 17 11:01 nav_admin_status.html
-rw-r--r-- 1 dspam dspam 1519 Mar 17 11:01 nav_admin_user.html
-rw-r--r-- 1 dspam dspam 1924 Mar 17 11:01 nav_alerts.html
-rw-r--r-- 1 dspam dspam 1824 Mar 17 11:01 nav_analysis.html
-rw-r--r-- 1 dspam dspam 1330 Mar 17 11:01 nav_error.html
-rw-r--r-- 1 dspam dspam  774 Mar 17 11:01 nav_fragment.html
-rw-r--r-- 1 dspam dspam 2778 Mar 17 11:01 nav_history.html
-rw-r--r-- 1 dspam dspam 4065 Mar 17 11:01 nav_performance.html
-rw-r--r-- 1 dspam dspam 5776 Mar 17 11:01 nav_preferences.html
-rw-r--r-- 1 dspam dspam 3988 Mar 17 11:01 nav_quarantine.html
-rw-r--r-- 1 dspam dspam 1875 Mar 17 11:01 nav_viewmessage.html
-rw-r--r-- 1 dspam dspam 4175 Mar 17 11:01 strings.pl

/var/www/dspam/cgi-bin/templates/es-es:
total 72
-rw-r--r-- 1 dspam dspam 1012 Mar 17 11:01 nav_admin_error.html
-rw-r--r-- 1 dspam dspam 5099 Mar 17 11:01 nav_admin_preferences.html
-rw-r--r-- 1 dspam dspam 4128 Mar 17 11:01 nav_admin_status.html
-rw-r--r-- 1 dspam dspam 1490 Mar 17 11:01 nav_admin_user.html
-rw-r--r-- 1 dspam dspam 1830 Mar 17 11:01 nav_alerts.html
-rw-r--r-- 1 dspam dspam 1786 Mar 17 11:01 nav_analysis.html
-rw-r--r-- 1 dspam dspam 1249 Mar 17 11:01 nav_error.html
-rw-r--r-- 1 dspam dspam  687 Mar 17 11:01 nav_fragment.html
-rw-r--r-- 1 dspam dspam 2769 Mar 17 11:01 nav_history.html
-rw-r--r-- 1 dspam dspam 3916 Mar 17 11:01 nav_performance.html
-rw-r--r-- 1 dspam dspam 4963 Mar 17 11:01 nav_preferences.html
-rw-r--r-- 1 dspam dspam 3844 Mar 17 11:01 nav_quarantine.html
-rw-r--r-- 1 dspam dspam 1761 Mar 17 11:01 nav_viewmessage.html
-rw-r--r-- 1 dspam dspam 4136 Mar 17 11:01 strings.pl

/var/www/dspam/cgi-bin/templates/fr:
total 80
-rw-r--r-- 1 dspam dspam 1093 Mar 17 11:01 nav_admin_error.html
-rw-r--r-- 1 dspam dspam 5592 Mar 17 11:01 nav_admin_preferences.html
-rw-r--r-- 1 dspam dspam 4252 Mar 17 11:01 nav_admin_status.html
-rw-r--r-- 1 dspam dspam 1599 Mar 17 11:01 nav_admin_user.html
-rw-r--r-- 1 dspam dspam 1968 Mar 17 11:01 nav_alerts.html
-rw-r--r-- 1 dspam dspam 1897 Mar 17 11:01 nav_analysis.html
-rw-r--r-- 1 dspam dspam 1369 Mar 17 11:01 nav_error.html
-rw-r--r-- 1 dspam dspam  696 Mar 17 11:01 nav_fragment.html
-rw-r--r-- 1 dspam dspam 2962 Mar 17 11:01 nav_history.html
-rw-r--r-- 1 dspam dspam 4266 Mar 17 11:01 nav_performance.html
-rw-r--r-- 1 dspam dspam 5429 Mar 17 11:01 nav_preferences.html
-rw-r--r-- 1 dspam dspam 4357 Mar 17 11:01 nav_quarantine.html
-rw-r--r-- 1 dspam dspam 1742 Mar 17 11:01 nav_viewmessage.html
-rw-r--r-- 1 dspam dspam 4421 Mar 17 11:01 strings.pl

/var/www/dspam/cgi-bin/templates/he:
total 68
-rw-r--r-- 1 dspam dspam 1209 Mar 17 11:01 nav_admin_error.html
-rw-r--r-- 1 dspam dspam 4693 Mar 17 11:01 nav_admin_preferences.html
-rw-r--r-- 1 dspam dspam 3262 Mar 17 11:01 nav_admin_status.html
-rw-r--r-- 1 dspam dspam 1631 Mar 17 11:01 nav_admin_user.html
-rw-r--r-- 1 dspam dspam 1873 Mar 17 11:01 nav_alerts.html
-rw-r--r-- 1 dspam dspam 1965 Mar 17 11:01 nav_analysis.html
-rw-r--r-- 1 dspam dspam 1451 Mar 17 11:01 nav_error.html
-rw-r--r-- 1 dspam dspam  953 Mar 17 11:01 nav_fragment.html
-rw-r--r-- 1 dspam dspam 2773 Mar 17 11:01 nav_history.html
-rw-r--r-- 1 dspam dspam 3814 Mar 17 11:01 nav_performance.html
-rw-r--r-- 1 dspam dspam 4661 Mar 17 11:01 nav_preferences.html
-rw-r--r-- 1 dspam dspam 3677 Mar 17 11:01 nav_quarantine.html
-rw-r--r-- 1 dspam dspam 1931 Mar 17 11:01 nav_viewmessage.html
-rw-r--r-- 1 dspam dspam 5028 Mar 17 11:01 strings.pl

/var/www/dspam/cgi-bin/templates/pt-br:
total 64
-rw-r--r-- 1 dspam dspam 1038 Mar 17 11:01 nav_admin_error.html
-rw-r--r-- 1 dspam dspam 4959 Mar 17 11:01 nav_admin_preferences.html
-rw-r--r-- 1 dspam dspam 4091 Mar 17 11:01 nav_admin_status.html
-rw-r--r-- 1 dspam dspam 1518 Mar 17 11:01 nav_admin_user.html
-rw-r--r-- 1 dspam dspam 1808 Mar 17 11:01 nav_alerts.html
-rw-r--r-- 1 dspam dspam 1732 Mar 17 11:01 nav_analysis.html
-rw-r--r-- 1 dspam dspam 1256 Mar 17 11:01 nav_error.html
-rw-r--r-- 1 dspam dspam  688 Mar 17 11:01 nav_fragment.html
-rw-r--r-- 1 dspam dspam 2731 Mar 17 11:01 nav_history.html
-rw-r--r-- 1 dspam dspam 3914 Mar 17 11:01 nav_performance.html
-rw-r--r-- 1 dspam dspam 4854 Mar 17 11:01 nav_preferences.html
-rw-r--r-- 1 dspam dspam 3808 Mar 17 11:01 nav_quarantine.html
-rw-r--r-- 1 dspam dspam 1822 Mar 17 11:01 nav_viewmessage.html
-rw-r--r-- 1 dspam dspam 4061 Mar 17 11:01 strings.pl

/var/www/dspam/cgi-bin/templates/ro:
total 60
-rw-r--r-- 1 dspam dspam 1018 Mar 17 11:01 nav_admin_error.html
-rw-r--r-- 1 dspam dspam 5192 Mar 17 11:01 nav_admin_preferences.html
-rw-r--r-- 1 dspam dspam 3996 Mar 17 11:01 nav_admin_status.html
-rw-r--r-- 1 dspam dspam 1490 Mar 17 11:01 nav_admin_user.html
-rw-r--r-- 1 dspam dspam 1840 Mar 17 11:01 nav_alerts.html
-rw-r--r-- 1 dspam dspam 1693 Mar 17 11:01 nav_analysis.html
-rw-r--r-- 1 dspam dspam 1261 Mar 17 11:01 nav_error.html
-rw-r--r-- 1 dspam dspam  687 Mar 17 11:01 nav_fragment.html
-rw-r--r-- 1 dspam dspam 2807 Mar 17 11:01 nav_history.html
-rw-r--r-- 1 dspam dspam 3990 Mar 17 11:01 nav_performance.html
-rw-r--r-- 1 dspam dspam 5174 Mar 17 11:01 nav_preferences.html
-rw-r--r-- 1 dspam dspam 3959 Mar 17 11:01 nav_quarantine.html
-rw-r--r-- 1 dspam dspam 1787 Mar 17 11:01 nav_viewmessage.html

/var/www/dspam/cgi-bin/templates/ru:
total 100
-rw-r--r-- 1 dspam dspam  1707 Mar 17 11:01 nav_admin_error.html
-rw-r--r-- 1 dspam dspam 11588 Mar 17 11:01 nav_admin_preferences.html
-rw-r--r-- 1 dspam dspam  7799 Mar 17 11:01 nav_admin_status.html
-rw-r--r-- 1 dspam dspam  2571 Mar 17 11:01 nav_admin_user.html
-rw-r--r-- 1 dspam dspam  3035 Mar 17 11:01 nav_alerts.html
-rw-r--r-- 1 dspam dspam  2514 Mar 17 11:01 nav_analysis.html
-rw-r--r-- 1 dspam dspam  1861 Mar 17 11:01 nav_error.html
-rw-r--r-- 1 dspam dspam   771 Mar 17 11:01 nav_fragment.html
-rw-r--r-- 1 dspam dspam  4578 Mar 17 11:01 nav_history.html
-rw-r--r-- 1 dspam dspam  8379 Mar 17 11:01 nav_performance.html
-rw-r--r-- 1 dspam dspam 10476 Mar 17 11:01 nav_preferences.html
-rw-r--r-- 1 dspam dspam  7665 Mar 17 11:01 nav_quarantine.html
-rw-r--r-- 1 dspam dspam  2530 Mar 17 11:01 nav_viewmessage.html
-rw-r--r-- 1 dspam dspam  8480 Mar 17 11:01 strings.pl

/var/www/dspam/htdocs:
total 36
-rw-r--r-- 1 dspam dspam  3179 Mar 17 11:01 base.css
-rw-r--r-- 1 dspam dspam   822 Mar 17 11:01 dspam.js
-rw-r--r-- 1 dspam dspam  4792 Mar 17 11:01 dspam-logo-small.gif
-rw-r--r-- 1 dspam dspam 15774 Mar 17 11:01 favicon.ico
-rw-r--r-- 1 dspam dspam   589 Mar 17 11:01 rtl.css

the file configure.pl is attached.

Cheers,
Carlo Rodrigues
#!/usr/bin/perl

# $Id: configure.pl,v 1.05 2010/01/03 14:39:13 sbajic Exp $
# DSPAM
# COPYRIGHT (C) DSPAM PROJECT 2002-2010
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2
# of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.


# This configuration file is read by all the CGI scripts to configure both the
# environment that DSPAM is working in and the way it will display information
# to the web user.

# Default DSPAM enviroment
$CONFIG{'DSPAM_HOME'}	= "/var/dspam";
$CONFIG{'DSPAM_BIN'}	= "/usr/bin";
$CONFIG{'DSPAM'}	= $CONFIG{'DSPAM_BIN'} . "/dspam";
$CONFIG{'DSPAM_STATS'}	= $CONFIG{'DSPAM_BIN'} . "/dspam_stats";
$CONFIG{'DSPAM_ARGS'}	= "--client  --deliver=innocent --class=innocent " .
                          "--source=error --user %CURRENT_USER% -d %u";
$CONFIG{'TEMPLATES'}	= "./templates";	# Location of HTML templates
$CONFIG{'DSPAM_PROCESSES'} = "ps auxw | grep dspam | grep -v 'grep\|cgi\|sock' | wc -l"; # use ps -deaf for Solaris
$CONFIG{'MAIL_QUEUE'}	= "mailq | egrep '^[0-9,A-F]\{10,12\}[\t ][\t ]*[1-9]' | wc -l";

$CONFIG{'WEB_ROOT'}	= ""; # URL location of included htdocs/ files

# Default DSPAM display
#$CONFIG{'DATE_FORMAT'}	= "%d.%m.%Y %H:%M"; # Date format in strftime style
					     # if undefined use default DSPAM display format
$CONFIG{'HISTORY_SIZE'}	= 1799;		# Number of items in history
$CONFIG{'HISTORY_PER_PAGE'} = 200;	# Number of items per page
$CONFIG{'HISTORY_DUPLICATES'} = "yes";	# Wether to show duplicate entries in history "yes" or "no"
$CONFIG{'HISTORY_HTMLIZE'} = "yes";	# Wether to HTML-ize sender and subject in history "yes" or "no"
$CONFIG{'MAX_COL_LEN'}	= 75;		# Max chars in list columns
$CONFIG{'SORT_DEFAULT'}	= "From";	# Show quarantine by "Rating", "Date", "From" or "Subject"
$CONFIG{'3D_GRAPHS'}	= 1;		# 0=graphs in 2D, 1=graphs in 3D
$CONFIG{'OPTMODE'}	= "NONE";	# OUT=OptOut IN=OptIn NONE=not selectable

# Full path to TTF font(s) used for legend, x and y labels in Graphs. GD must be compiled
# with TTF support if you want to use this feature.
#$CONFIG{'GRAPHS_X_LABEL_FONT'} = "/usr/share/fonts/dejavu/DejaVuSans.ttf";
#$CONFIG{'GRAPHS_Y_LABEL_FONT'} = "/usr/share/fonts/dejavu/DejaVuSans.ttf";
#$CONFIG{'GRAPHS_LEGEND_FONT'}  = "/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf";

# Add customized settings below
$CONFIG{'LOCAL_DOMAIN'}	= "onicommunications.pt";

$ENV{'PATH'}		= "$ENV{'PATH'}:$CONFIG{'DSPAM_BIN'}";

# Autodetect filesystem layout and preference options
$CONFIG{'AUTODETECT'}	= 1;

# Or, if you're running dspam.cgi as untrusted, it won't be able to auto-detect
# so you will need to specify some features manually:
#$CONFIG{'AUTODETECT'}	= 0;
#$CONFIG{'LARGE_SCALE'}	= 0;
#$CONFIG{'DOMAIN_SCALE'}= 0;
#$CONFIG{'PREFERENCES_EXTENSION'} = 0;

# Get DSPAM version
$CONFIG{'DSPAM_VERSION'} = "Unknown Version";
open(PIPE, $CONFIG{'DSPAM'} . " --version|");
while(<PIPE>) {
  chomp;
  if (/^(DSPAM Anti\-Spam Suite .*)$/) {
    $CONFIG{'DSPAM_VERSION'} = $1;
    last;
  }
}
close(PIPE);

# Make a list of available templates/languages
my @dslanguages = ();
undef %LANG;
require "$CONFIG{'TEMPLATES'}/strings.pl";
while (($key, $value) = each(%LANG)) {
  $CONFIG{'LANG'}->{'en'}->{$key} = $value;
}
$CONFIG{'LANG'}->{'en'}->{'TEMPLATEDIR'} = $CONFIG{'TEMPLATES'};
$CONFIG{'LANG'}->{'en'}->{'NAME'} = 'en';
$CONFIG{'LANG'}->{'en'}->{'NAME'} = $LANG{'lang_name'} if (defined $LANG{'lang_name'});
push(@dslanguages, qq!<option value="en">&nbsp;$CONFIG{'LANG'}->{'en'}->{'NAME'}</option>!);
# Do now the other languages
opendir TEMPLDIR, $CONFIG{'TEMPLATES'} or die "Can not open template directory";
my @templatefiles = sort grep !/^\.\.?$/, readdir TEMPLDIR;
closedir TEMPLDIR;
foreach (@templatefiles) {
  my $langcode = $_;
  my $langname = $_;
  if ($langcode ne "" && -d "$CONFIG{'TEMPLATES'}/$langcode") {
    $CONFIG{'LANG'}->{$langcode}->{'TEMPLATEDIR'} = "$CONFIG{'TEMPLATES'}/$langcode";
    $CONFIG{'LANG'}->{$langcode}->{'NAME'} = $langcode;
    undef %LANG;
    if (-s "$CONFIG{'TEMPLATES'}/$langcode/strings.pl") {
      require "$CONFIG{'TEMPLATES'}/$langcode/strings.pl";
    } else {
      while (($key, $value) = each(%{$CONFIG{'LANG'}->{'en'}})) {
        $LANG{$key} = $value if($key ne "NAME" && $key ne "TEMPLATEDIR");
      }
      delete($LANG{'lang_name'});
    }
    $CONFIG{'LANG'}->{$langcode}->{'NAME'} = $LANG{'lang_name'} if (defined $LANG{'lang_name'});
    while (($key, $value) = each(%LANG)) {
      $CONFIG{'LANG'}->{$langcode}->{$key} = $value;
    }
    push(@dslanguages, qq!<option value="$langcode">&nbsp;$CONFIG{'LANG'}->{$langcode}->{'NAME'}</option>!);
  }
}
if (scalar(@dslanguages) == 0) {
  $CONFIG{'LANGUAGES'} = "";
} else {
  unshift(@dslanguages, qq!&nbsp;&nbsp;<select name="language">!);
  push(@dslanguages, qq!</select>!);
  $CONFIG{'LANGUAGES'} = join("\n", @dslanguages);
}
@templatefiles=();

# Determine if templates are available for the current
# HTTP_ACCEPT_LANGUAGE (see RFC 4646 for more info).
my $langlist = lc($ENV{'HTTP_ACCEPT_LANGUAGE'})||'';
my $langpat = qr'[a-zA-Z]{1,8}(\-[a-zA-Z]{1,8})?';
my $qvalpat = qr'(0(\.\d{0,3})?)|(1(\.0{0,3})?)';
my $q = -1.0;
my $templates = '';
my $langused = '';
for my $langpref (split /,\s*/, $langlist) {
  $langpref =~ /^([^;]+)(;q=)?(.*)?/;
  my $lang = $1 || '';
  my $qval = $3 || 1.0;
  my $langcode = '';
  if ($lang =~ /^($langpat)|(x\-$langpat)|\*$/ && $qval =~ /^($qvalpat)$/) {
    if ($q lt $qval) {
      $lang =~ s/^x\-//;
      if ($lang =~ /^(.*)\-.+$/) {
        $langcode = $1;
      }
      if ($lang ne '' && $lang ne '*' && -e $CONFIG{'TEMPLATES'} . '/' . $lang . '/nav_performance.html') {
        $q = $qval;
        $templates = $CONFIG{'TEMPLATES'} . '/' . $lang;
        $langused = $lang;
      } elsif ($langcode eq 'en') {
        $q = $qval;
        $templates = $CONFIG{'TEMPLATES'};
        $langused = 'en';
      } elsif ($langcode ne '' && -e $CONFIG{'TEMPLATES'} . '/' . $langcode . '/nav_performance.html') {
        $q = $qval;
        $templates = $CONFIG{'TEMPLATES'} . '/' . $langcode;
        $langused = $langcode;
      }
    }
  }
}
if ($templates ne '') {
  $CONFIG{'TEMPLATES'} = $templates;
  $CONFIG{'LANGUAGE_USED'} = $langused;
} else {
  $CONFIG{'LANGUAGE_USED'} = 'en';
}

$CONFIG{'DSPAM_CGI'} = "dspam.cgi";

# Configuration was successful
1;
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Dspam-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspam-user

Reply via email to