forked from justdeleteme/justdelete.me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
static-gen.php
106 lines (99 loc) · 1.7 KB
/
static-gen.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
$langs = array(
'en',
'ar',
'cat',
'de',
'es',
'fa',
'fr',
'id',
'it',
'nl',
'pt_br',
'ru',
'tr',
'vi',
'zh-cn',
'zh-tw',
'ro',
'pl'
);
include 'contrib.php';
foreach ($langs as $language)
{
// start the output buffer
ob_start(); ?>
<?php
$lang = $language;
if ($lang == "en") {
$full_name = "English";
}
if ($lang == "ar") {
$full_name = "العربية";
}
if ($lang == "cat") {
$full_name = "Català";
}
if ($lang == "de") {
$full_name = "Deutsch";
}
if ($lang == "es") {
$full_name = "Español";
}
if ($lang == "fa") {
$full_name = "فارسی";
}
if ($lang == "fr") {
$full_name = "Français";
}
if ($lang == "id") {
$full_name = "Indonesia";
}
if ($lang == "it") {
$full_name = "Italiano";
}
if ($lang == "nl") {
$full_name = "Nederlands";
}
if ($lang == "pt_br") {
$full_name = "Português";
}
if ($lang == "ru") {
$full_name = "Pусский";
}
if ($lang == "tr") {
$full_name = "Türk";
}
if ($lang == "vi") {
$full_name = "Tiếng Việt";
}
if ($lang == "zh-cn") {
$full_name = "中国的";
}
if ($lang == "zh-tw") {
$full_name = "正體中文";
}
if ($lang == "ro") {
$full_name = "Român";
}
if ($lang == "pl") {
$full_name = "Polski";
}
include ('dev.php');
if ($language == "en") {
$cachefile = "index.html";
}
else {
$cachefile = $language.".html";
}
// open the cache file "cache/home.html" for writing
$fp = fopen($cachefile, 'w');
// save the contents of output buffer to the file
fwrite($fp, ob_get_contents());
// close the file
fclose($fp);
// Send the output to the browser
ob_end_flush();
}
?>