From: Frank Lichtenheld Date: Sun, 28 Oct 2007 20:50:25 +0000 (+0000) Subject: Disable gettext translations X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=8bf8802267881bdbbece88f8be766cb1be2b7076;p=deb%2Fpackages.git Disable gettext translations mpm_worker, mod_perl and gettext together show some funny results. When several clients request different languages from the server simultaniously they can get the completly wrong or even mixed strings. Which of course doesn't happen on my test server, since the chances for that to happen are very slim there. This whole mess can easily explained by the fact that the locale setting done with setlocale is global to the process. The solution for that is most likely to switch to a OO aproach with using a message catalog (no idea how to tell sprintf which locale to use in a non-global way, though...) --- diff --git a/lib/Packages/Dispatcher.pm b/lib/Packages/Dispatcher.pm index 4062122..39ecab7 100755 --- a/lib/Packages/Dispatcher.pm +++ b/lib/Packages/Dispatcher.pm @@ -279,14 +279,14 @@ sub do_dispatch { my $locale = get_locale($opts{lang}); my $charset = get_charset($opts{lang}); - setlocale ( LC_ALL, $locale ) - or do { debug( "couldn't set locale $locale, using default" ) if DEBUG; - setlocale( LC_ALL, get_locale() ) - or do { - debug( "couldn't set default locale either" ) if DEBUG; +# setlocale ( LC_ALL, $locale ) +# or do { debug( "couldn't set locale $locale, using default" ) if DEBUG; +# setlocale( LC_ALL, get_locale() ) +# or do { +# debug( "couldn't set default locale either" ) if DEBUG; setlocale( LC_ALL, "C" ); - }; - }; +# }; +# }; debug( "locale=$locale charset=$charset", 1 ) if DEBUG; $opts{h_suites} = { map { $_ => 1 } @suites };