-
Notifications
You must be signed in to change notification settings - Fork 0
/
lang_definition.php
44 lines (31 loc) · 961 Bytes
/
lang_definition.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
//master file for sending local header info
//if lang is not specified set it to english
if((!isset($_SESSION['lang'])) || (!isset($_GET['lang']))){
$_SESSION['lang'] = 'en';
$current_language = 'en';
}
else
{
//retrieve the current language specify by the user_error
$current_language = $_GET['lang'];
$_SESSION['lang'] = $current_language;
}
switch($current_language){
case "eng":
define("CHARSET", "ISO-8859-1");
define("LANGCODE", "en");
break;
case "fr":
define("CHARSET", "UTF-8");
define("LANGCODE", "fr");
break;
default:
define("CHARSET", "ISO-8859-1");
define('LANGCODE', 'en');
break;
}
//set the header
header("Content-Type: text/html; Charset=".CHARSET);
header("Content-Language :".LANGCODE);
?>