-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
87 lines (70 loc) · 2.49 KB
/
index.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
82
83
84
85
86
87
<?php
include './class.multiLanguage.php';
$staticSection = file_get_contents('./menu.html');
// multiLanguage::getLanguage(); Default language is english
// multiLanguage::getLanguage('es'); Set manual language
// multiLanguage::getLanguage(@$_POST['language']); Set language with POST method of forms
// multiLanguage::getLanguage(@$_GET['language']); Set language with GET method or Query string
multiLanguage::getLanguage(@$_POST['language']);
$translatedMenu = multiLanguage::translateRecursive($staticSection);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Multilanguage Static Sections With Regular Expression">
<meta name="author" content="pooya sabramooz">
<title>Multilanguage Static Sections With Regular Expression</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<style>
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
background-color: #f5f5f5;
}
body > .container {
padding: 60px 15px 0;
}
.container .text-muted {
margin: 20px 0;
}
.footer > .container {
padding-right: 15px;
padding-left: 15px;
}
</style>
</head>
<body>
<?php echo $translatedMenu; ?>
<div class="container">
<div class="page-header">
<h3>Multi language sections with xml and Regular expression</h3>
</div>
<p>Select a language...</p>
<form method="post">
English : <input type="submit" class="btn-link" name="language" value="en"><br>
Spanish : <input type="submit" class="btn-link" name="language" value="es"><br>
Farsi : <input type="submit" class="btn-link" name="language" value="fa"><br>
</form>
<br>
<p>In addition, with this class you can change language of a page or just a section of a page.</p>
</div>
<div class="footer">
<div class="container">
<p class="text-muted"> Pooya Sabramooz <pooya_alen1990@yahoo.com> </p>
</div>
</div>
</body>
</html>