-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlang.php
More file actions
executable file
·80 lines (64 loc) · 1.92 KB
/
lang.php
File metadata and controls
executable file
·80 lines (64 loc) · 1.92 KB
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
<?php
/**
* The Javaria Project
* Copyright © 2019
* Michel Noel
* Datalight Analytics
* http://www.datalightanalytics.com/
*
* Creative Commons Attribution-ShareAlike 4.0 International Public License
* By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of
* this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this
* Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your
* acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the
* Licensor receives from making the Licensed Material available under these terms and conditions.
*
* File: lang.php
* Last Modified: 7/27/19, 8:27 PM
*/
// Multilingual Support
getlang();
function mlang_str($lang_str, $ret = false){
global $langArr;
if (empty($langArr) ) {
getlang();
}
if(isset($langArr[$lang_str]) ) {
$value = $langArr[$lang_str];
}
else {
$value = "{".$lang_str."}";
}
if(!$ret){
echo $value;
return '';
}
else {
return $value;
}
}
function getlang(){
global $langArr;
if(isSet($_GET['lang']))
{
$lang = $_GET['lang'];
$_SESSION['lang'] = $lang;
}
else if(isSet($_SESSION['lang']))
{
$lang = $_SESSION['lang'];
}
else
{
$lang = 'en';
}
switch ($lang) {
case 'en':
$lang_file = 'lang.en.php';
break;
case 'fr':
$lang_file = 'lang.fr.php';
break;
}
include_once 'languages/'.$lang_file;
}