From dc72ddf3a8f282fea3ea2d9d82d894b4f4d47d30 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Fri, 5 Mar 2010 11:00:55 +1300 Subject: [PATCH] Correct setup of locale. --- inc/always.php | 3 ++- inc/always.php.in | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/always.php b/inc/always.php index edf2b587..92560cf4 100644 --- a/inc/always.php +++ b/inc/always.php @@ -81,7 +81,6 @@ $c->protocol_server_port = sprintf( '%s://%s%s', ) ); $c->protocol_server_port_script = $c->protocol_server_port . ($_SERVER['SCRIPT_NAME'] == '/index.php' ? '' : $_SERVER['SCRIPT_NAME']); -init_gettext( 'davical', '../locale' ); /** * We use @file_exists because things like open_basedir might noisily deny @@ -124,7 +123,9 @@ if ( count($c->dbg) > 0 ) { * Now that we have loaded the configuration file we can switch to a * default site locale. This may be overridden by each user. */ +putenv("LANG=". $c->default_locale); awl_set_locale($c->default_locale); +init_gettext( 'davical', '../locale' ); /** * Work out our version diff --git a/inc/always.php.in b/inc/always.php.in index edf2b587..92560cf4 100644 --- a/inc/always.php.in +++ b/inc/always.php.in @@ -81,7 +81,6 @@ $c->protocol_server_port = sprintf( '%s://%s%s', ) ); $c->protocol_server_port_script = $c->protocol_server_port . ($_SERVER['SCRIPT_NAME'] == '/index.php' ? '' : $_SERVER['SCRIPT_NAME']); -init_gettext( 'davical', '../locale' ); /** * We use @file_exists because things like open_basedir might noisily deny @@ -124,7 +123,9 @@ if ( count($c->dbg) > 0 ) { * Now that we have loaded the configuration file we can switch to a * default site locale. This may be overridden by each user. */ +putenv("LANG=". $c->default_locale); awl_set_locale($c->default_locale); +init_gettext( 'davical', '../locale' ); /** * Work out our version