This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
104 lines (93 loc) · 2.6 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
<?php
spl_autoload_register(function($className)
{
$namespace=str_replace("\\","/",__NAMESPACE__);
$className=str_replace("\\","/",$className);
$class="classes/".(empty($namespace)?"":$namespace."/")."{$className}.php";
include_once($class);
});
try {
$reactIntlEditor = new \ReactIntlEditor\ReactIntlEditor();
} catch (\ReactIntlEditor\Exception $e) {
echo '<div style="color:black;border:3px solid red;padding:15px;max-width:800px;width:100%;">';
echo '<p>An error has occured during startup:</p><p>' . $e->getMessage() . '</p>';
echo '</div>';
die();
}
?><html lang="en">
<head>
<title>React Intl Editor</title>
<link rel="stylesheet" href="assets/react-intl-editor.css" />
</head>
<body>
<div class="wrapper">
<header>
<h1>React Intl Editor</h1>
</header>
<main>
<div class="half">
<h1>Project Stats</h1>
<table id="project_stats">
<thead>
<tr>
<th>Property</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<th>Message Files Found</th>
<td><?php echo $reactIntlEditor->sourceFileCount; ?></td>
</tr>
<tr>
<th>Strings Found</th>
<td><?php echo $reactIntlEditor->sourceStringCount; ?></td>
</tr>
<tr>
<th>Locales Found</th>
<td><?php echo $reactIntlEditor->localeCount; ?></td>
</tr>
</tbody>
</table>
</div>
<div class="half">
<h1>Locales</h1>
<?php foreach ($reactIntlEditor->locales as $locale) { ?>
<div class="locale_header"><h2><?php echo $locale; ?></h2>
<?php if ($reactIntlEditor->getMissingStringCount($locale) == 0) {
echo '<span>✅</span>';
} else {
echo '<span>❌</span>';
} ?></div>
<table id="project_stats">
<thead>
<tr>
<th>Property</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<th>Matching Strings</th>
<td><a href="editor.php?locale=<?php echo $locale; ?>&type=matching"><?php echo $reactIntlEditor->getMatchingStringCount($locale); ?></a></td>
</tr>
<tr>
<th>Missing Strings</th>
<td><a href="editor.php?locale=<?php echo $locale; ?>&type=missing"><?php echo $reactIntlEditor->getMissingStringCount($locale); ?></a></td>
</tr>
<tr>
<th>Orphaned Strings</th>
<td><?php echo $reactIntlEditor->getOrphanedStringCount($locale); ?></td>
</tr>
</tbody>
</table>
<?php } ?>
</div>
</main>
<footer>
<hr />
<a href="https://github.com/shawnhooper/react-intl-editor">React Intl Editor on GitHub</a>
</footer>
</div>
</body>
</html>