From: Steinar H. Gunderson Date: Sun, 17 Jul 2005 13:25:13 +0000 (+0000) Subject: Set the locale early enough for everything to be translated. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=3bfa49f3081e4e2b278093a57382f773f5a5230f Set the locale early enough for everything to be translated. --- diff --git a/html/ccbs.pm b/html/ccbs.pm index d3f0721..6dd7b13 100755 --- a/html/ccbs.pm +++ b/html/ccbs.pm @@ -14,6 +14,11 @@ our $start_time; BEGIN { $start_time = [Time::HiRes::gettimeofday()]; + + POSIX::setlocale( &POSIX::LC_CTYPE , "nb_NO.UTF-8" ); + POSIX::setlocale( &POSIX::LC_MESSAGES , "nb_NO.UTF-8" ); + Locale::gettext::bindtextdomain("ccbs", "po"); + Locale::gettext::textdomain("ccbs"); } our $ccbs_dbdebug = 0; @@ -81,11 +86,6 @@ sub process_template { $vars->{'public'} = $ccbs_noadmin; $vars->{'timetogenerate'} = sprintf "%.3f", Time::HiRes::tv_interval($start_time); - POSIX::setlocale( &POSIX::LC_CTYPE , "nb_NO.UTF-8" ); - POSIX::setlocale( &POSIX::LC_MESSAGES , "nb_NO.UTF-8" ); - Locale::gettext::bindtextdomain("ccbs", "po"); - Locale::gettext::textdomain("ccbs"); - my $config = { INCLUDE_PATH => 'templates/', INTERPOLATE => 1,