-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
106 lines (82 loc) · 3.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
require 'ot/lib/locale.php';
$accepted_locales = array(
'en' => 'en_US',
'es' => 'es_MX'
);
if (isset($_GET['lang']) && in_array($_GET['lang'], array_keys($accepted_languages))) {
$locale_code = $accepted_languages[$_GET['lang']];
} else {
$config = include 'ot/lib/config.php';
$locale_code = $config['native_locale']['code'];
}
$locale = new OT_Locale(array('code' => $locale_code, 'path' => dirname(__FILE__) . '/locales'));
$locale = new OT_Locale(array('code' => $locale_code, 'path' => dirname(__FILE__) . '/locales', 'fallback_code' => 'en_US'));
?>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Open Translation Documentation</title>
<link rel="stylesheet" href="/ot/styles/css/ot.css<?php echo '?' . filemtime(dirname(__FILE__) . '/ot/styles/css/ot.css');?>" type="text/css" />
<script src="/ot/js/jq1.6.2.js<?php echo '?' . filemtime(dirname(__FILE__) . '/ot/js/jq1.6.2.js');?>"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="/ot/js/spin.js<?php echo '?' . filemtime(dirname(__FILE__) . '/ot/js/spin.js');?>" type="text/javascript" charset="utf-8"></script>
<script src="/ot/js/open-translation.js<?php echo '?' . filemtime(dirname(__FILE__) . '/ot/js/open-translation.js');?>"></script>
</head>
<body>
<a href="/#translate">Turn On Translation</a>
<div id="demo-contain">
<header>
<h1><?php echo $locale->fetch('OPEN-TRANSLATION'); ?></h1>
<h2><?php echo $locale->fetch('TAGLINE'); ?></h2>
</header>
<p><?php echo $locale->fetch('DEMO-PARA-1'); ?></p>
<p><?php echo $locale->fetch('DEMO-PARA-2'); ?></p>
<p><?php echo $locale->fetch('DEMO-PARA-3'); ?></p>
<ul>
<li data-translatable-id="click-here"><?php echo $locale->fetch('CLICK-HERE'); ?></li>
<li data-translatable-id="welcome"><?php echo $locale->fetch('WELCOME'); ?></li>
<li data-translatable-id="save-your-progress"><?php echo $locale->fetch('SAVE-YOUR-PROGRESS'); ?></li>
<li data-translatable-id="make-new-entry"><?php echo $locale->fetch('MAKE-NEW-ENTRY'); ?></li>
</ul>
<p><?php echo $locale->fetch('DEMO-PARA-4'); ?></p>
<p><?php echo $locale->fetch('DEMO-PARA-5'); ?></p>
<p><?php echo $locale->fetch('DEMO-PARA-6'); ?></p>
<p><?php echo $locale->fetch('DEMO-PARA-7'); ?></p>
<a href="/ot/admin/index.php">Administration</a>
<a href="https://github.com/agentile/open-translation">GitHub Repo</a>
</div><!-- .demo-contain -->
<!-- <div class="ot-mode-indicator">
<h1>My language:</h1>
<span class="ot-mode-language">French</span>
</div> -->
<!-- <input type="text" class="ot-add-translation" />
<blockquote class="ot-translate-this"><?php echo $locale->fetch('TRANSLATE_THIS');?></blockquote>
<a href="#" class="ot-submit ot-pill"><?php echo $locale->fetch('SUBMIT');?></a>
<ul class="ot-submitted-translations-list">
<li class="ot-list-green">
Some text
<span>+3</span>
</li>
<li class="ot-list-green">
More text
<span>+2</span>
</li>
<li class="ot-list-red">
Extra stuff
<span>-3</span>
</li>
</ul>
<div class="ot-translateable ot-need-translation"></div>
<div class="ot-translateable ot-has-translation"></div> -->
<script type="text/javascript">
ot.init({
native_locale: 'en_US',
csrf_token: '',
translate_type: 'all' // class, selected, all
});
</script>
</body>
</html>