-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathindex.php
More file actions
48 lines (44 loc) · 1.16 KB
/
Copy pathindex.php
File metadata and controls
48 lines (44 loc) · 1.16 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
<?php
$languages = array(
'en' => 'English',
'el' => 'Ελληνικά',
'mk' => 'македонски',
'es' => 'Español',
'nl' => 'Nederlands',
'he' => 'עברית',
'pt' => 'Português',
'sh' => 'srpskohrvatski',
'uk' => 'Українська',
'ru' => 'Русский'
);
$lang = 'en';
foreach ( $languages as $code => $caption ) {
if ( isset( $_GET[ $code ] ) ) {
$lang = $code;
break;
}
}
ob_start();
?>
<ul class='translations'>
<?php
foreach ( $languages as $code => $caption ) {
?><li class='<?php
if ( $code == $lang ) {
?>selected<?php
}
?>'><a href='?<?php
echo $code;
?>'><?php
echo $caption;
?></a></li><?php
}
?><li><a href='mailto:dionyziz@gmail.com'>Help translate</a></li>
</ul>
<?php
$translations = ob_get_clean();
$article = include 'index-' . $lang . '.php';
include 'header.php';
echo $article[ 'content' ];
include 'footer.php';
?>