pwesthead Posted May 23, 2012 Share Posted May 23, 2012 Hi can anyone see the problem with this language file, i want my index page to load in portuguese and not english i have set the default to portuguese but keeps loading the index page in english. here is my code. session_start(); header('Cache-control: private'); // IE 6 FIX if(isSet($_GET['lang'])) { $lang = $_GET['lang']; // register the session and set the cookie $_SESSION['lang'] = $lang; setcookie("lang", $lang, time() + (3600 * 24 * 30)); } else if(isSet($_SESSION['lang'])) { $lang = $_SESSION['lang']; } else if(isSet($_COOKIE['lang'])) { $lang = $_COOKIE['lang']; } else { $lang = 'pg'; } switch ($lang) { case 'pg': $lang_file = 'lang.pg.php'; break; case 'en': $lang_file = 'lang.en.php'; break; case 'fr': $lang_file = 'lang.fr.php'; break; case 'de': $lang_file = 'lang.de.php'; break; default: $lang_file = 'lang.pg.php'; break; } include_once 'languages/'.$lang_file; Quote Link to comment https://forums.phpfreaks.com/topic/262980-problem-with-language-file/ Share on other sites More sharing options...
PeoMachine Posted May 23, 2012 Share Posted May 23, 2012 Set on your errors... maybe the path to the files is incorrect. Quote Link to comment https://forums.phpfreaks.com/topic/262980-problem-with-language-file/#findComment-1348166 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.