From 4c8dfadf2d11373d9518fea94a05d4a04f74589e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 5 Aug 2008 23:45:15 -0400 Subject: make init of lang environment happen earlier, or when user language may have changed darcs-hash:20080806034515-84dde-e32cbfec2890f50b610d0441659180038b060473.gz --- lib/util.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/util.php b/lib/util.php index a904e34e0..5e6d9fc6f 100644 --- a/lib/util.php +++ b/lib/util.php @@ -131,11 +131,7 @@ function common_end_xml() { $xw->flush(); } -define('PAGE_TYPE_PREFS', 'text/html,application/xhtml+xml,application/xml;q=0.3,text/xml;q=0.2'); - -function common_show_header($pagetitle, $callable=NULL, $data=NULL, $headercall=NULL) { - global $config, $xw; - +function common_init_language() { $language = common_language(); # So we don't have to make people install the gettext locales putenv('LANGUAGE='.$language); @@ -148,7 +144,13 @@ function common_show_header($pagetitle, $callable=NULL, $data=NULL, $headercall= bindtextdomain("laconica", $config['site']['locale_path']); bind_textdomain_codeset("laconica", "UTF-8"); textdomain("laconica"); - +} + +define('PAGE_TYPE_PREFS', 'text/html,application/xhtml+xml,application/xml;q=0.3,text/xml;q=0.2'); + +function common_show_header($pagetitle, $callable=NULL, $data=NULL, $headercall=NULL) { + global $config, $xw; + $httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : NULL; # XXX: allow content negotiation for RDF, RSS, or XRDS -- cgit v1.2.3-54-g00ecf