From 4240a23a8a9024daab45a277d5df311762d07d49 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 15 Nov 2010 23:27:12 -0800 Subject: i18n re-arrange --- index.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 91b864df8..cf20d35a2 100644 --- a/index.php +++ b/index.php @@ -123,14 +123,18 @@ $a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array( $page = $a->page; $profile = $a->profile; $lang = get_config('system','language'); +if($lang === false) + $lang = 'en'; header("Content-type: text/html; charset=utf-8"); -$template = "view/" . (($lang) ? $lang . "/" : "") - . ((x($a->page,'template')) ? $a->page['template'] : 'default' ) - . ".php"; +$template = 'view/' . $lang . '/' + . ((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.php'; -require_once($template); +if(file_exists($template)) + require_once($template); +else + require_once(str_replace($lang . '/', '', $template)); session_write_close(); exit; -- cgit v1.2.3