Jump to content

problem with language file


pwesthead

Recommended Posts

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;

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.