-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathlang.php
81 lines (77 loc) · 1.79 KB
/
lang.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
$lang = 'en';
if(!isset($_COOKIE['lang']) || empty($_COOKIE['lang'])) {
setcookie('lang', 'en', time() + 60*60*24*30);
}
if (isset($_GET['lang'])) {
setcookie('lang', $_GET['lang'], time() + 60*60*24*30);
$lang = $_GET['lang'];
} else if (isset($_COOKIE['lang'])) {
$lang = $_COOKIE['lang'];
}
// TODO: Use single function instead of switch
switch(@$lang){
case 'ar':
include_once 'assets/lang/ar.php';
$lang = 'ar';
break;
case 'fr':
include_once 'assets/lang/fr.php';
$lang = 'fr';
break;
case 'it':
include_once 'assets/lang/it.php';
$lang = 'it';
break;
case 'es':
include_once 'assets/lang/es.php';
$lang = 'es';
break;
case 'ru':
include_once 'assets/lang/ru.php';
$lang = 'ru';
break;
case 'de':
include_once 'assets/lang/de.php';
$lang = 'de';
break;
case 'id':
include_once 'assets/lang/id.php';
$lang = 'id';
break;
case 'en': default:
include_once 'assets/lang/en.php';
$lang = 'en';
break;
case 'eo':
include_once 'assets/lang/eo.php';
$lang = 'eo';
break;
case 'cz':
include_once 'assets/lang/cz.php';
$lang = 'cz';
break;
case 'tr':
include_once 'assets/lang/tr.php';
$lang = 'tr';
break;
case 'gr':
include_once 'assets/lang/gr.php';
$lang = 'gr';
break;
case 'zh_tw':
include_once 'assets/lang/zh_tw.php';
$lang = 'zh_tw';
break;
case 'nl':
include_once 'assets/lang/nl.php';
$lang = 'nl';
break;
case 'az':
include_once 'assets/lang/az.php';
$lang = 'az';
break;
}
// Default language
include_once 'assets/lang/en.php';
?>