This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
432 lines (427 loc) · 10.6 KB
/
index.html
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
<!DOCTYPE html>
<html>
<head>
<link type="text/x-gettext-translation" href="po/es-ES.po" id="external-po" />
<meta charset="UTF-8"/>
<title>Pomo, a gettext(and family) implementation for JS</title>
<style>
/*! normalize.css v1.1.0 | MIT License | git.io/normalize */
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary {
display: block
}
audio, canvas, video {
display: inline-block;
*display: inline;
*zoom: 1
}
audio:not([controls]) {
display: none;
height: 0
}
[hidden] {
display: none
}
html {
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%
}
html, button, input, select, textarea {
font-family: sans-serif
}
body {
margin: 0
}
a:focus {
outline: thin dotted
}
a:active, a:hover {
outline: 0
}
h1 {
font-size: 2em;
margin: .67em 0
}
h2 {
font-size: 1.5em;
margin: .83em 0
}
h3 {
font-size: 1.17em;
margin: 1em 0
}
h4 {
font-size: 1em;
margin: 1.33em 0
}
h5 {
font-size: .83em;
margin: 1.67em 0
}
h6 {
font-size: .67em;
margin: 2.33em 0
}
abbr[title] {
border-bottom: 1px dotted
}
b, strong {
font-weight: bold
}
blockquote {
margin: 1em 40px
}
dfn {
font-style: italic
}
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0
}
mark {
background: #ff0;
color: #000
}
p, pre {
margin: 1em 0
}
code, kbd, pre, samp {
font-family: monospace, serif;
_font-family: 'courier new', monospace;
font-size: 1em
}
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word
}
q {
quotes: none
}
q:before, q:after {
content: '';
content: none
}
small {
font-size: 80%
}
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline
}
sup {
top: -0.5em
}
sub {
bottom: -0.25em
}
dl, menu, ol, ul {
margin: 1em 0
}
dd {
margin: 0 0 0 40px
}
menu, ol, ul {
padding: 0 0 0 40px
}
nav ul, nav ol {
list-style: none;
list-style-image: none
}
img {
border: 0;
-ms-interpolation-mode: bicubic
}
svg:not(:root) {
overflow: hidden
}
figure {
margin: 0
}
form {
margin: 0
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: .35em .625em .75em
}
legend {
border: 0;
padding: 0;
white-space: normal;
*margin-left: -7px
}
button, input, select, textarea {
font-size: 100%;
margin: 0;
vertical-align: baseline;
*vertical-align: middle
}
button, input {
line-height: normal
}
button, select {
text-transform: none
}
button, html input[type="button"], input[type="reset"], input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
*overflow: visible
}
button[disabled], html input[disabled] {
cursor: default
}
input[type="checkbox"], input[type="radio"] {
box-sizing: border-box;
padding: 0;
*height: 13px;
*width: 13px
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box
}
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none
}
button::-moz-focus-inner, input::-moz-focus-inner {
border: 0;
padding: 0
}
textarea {
overflow: auto;
vertical-align: top
}
table {
border-collapse: collapse;
border-spacing: 0
}
</style>
<style>
body {
width: 960px;
margin: 0px auto;
}
#support-matrix {
width: 100%;
}
#support-matrix *{
line-height:2em;
}
#support-matrix-wrap thead>tr>th:first-child{
border-top-left-radius: 10em;
background:skyblue;
}
#support-matrix-wrap thead>tr>th:last-child, .matrix-body>tr:last-child th:first-child
{
border-bottom-left-radius: 3em;
}
#support-matrix .odd {
background: #eee;
}
#support-matrix th:nth-child(odd){
background:skyblue;
}
th {
background: lightblue;
padding: 1em 1ex;
margin: 0px;
vertical-align: middle;
}
th:first-child {
background: none;
}
#support-matrix .even {
width: 25%;
}
#support-matrix td {
vertical-align: middle;
text-align: center;
}
#support-matrix td table {
width: 100%;
}
#support-matrix td th {
background: #DCF2F5;
}
#support-matrix td:first-child {
text-align: left;
}
#support-matrix td th:nth-child(odd),
#support-matrix td table tr th{
border-radius:0px;
background:#DCF2F5;
padding:0.25em 0;
}
#support-matrix-wrap thead>tr:first-child>th:last-child{
border-bottom-left-radius:0px;
border-top-right-radius: 10em;
}
#support-matrix th:first-child {
background: #eee;
}
.odd:hover *{
background:lime !important;
}
tr:hover *{
background:#F5EEBA !important;
}
tr:hover th{
background:yellow !important;
}
tr tr:hover *{
background:#FFEF78 !important;
}
</style>
</head>
<body>
<header>
<h1>Pomo, a gettext(and family) implementation for JS</h1>
</header>
<section id="main">
<article id="explanations">
<header>
<h2>What?</h2>
</header>
<p>
Pomo is a library that allows you to handle PO and MO files in
pretty much the same way that gettext (and family) allow you to.
</p>
<p>
It exposes a single Pomo object whose
<code>
Pomo.getText()
</code>
method behaves like
<code>
sprintf(gettext("string %s"), "placeholder")
</code>
would for other languages.
</p>
<p>
Instead of returning a string upon finding the translation, Pomo gives you an object
containing all the possible information about that translation; this object in turn can
be casted to a string for ease of use, or can be used straight as a string by
</p>
<p>
While it DOES aim to be feature-complete, right now it is not. Below is a table
showing exactly what is and what's not covered.
</p>
<div id="support-matrix-wrap">
<table id="support-matrix" summary="This shows the current state of PO/MO feature support">
<colgroup>
<col class="odd"/>
<col/>
<col class="odd" />
<col/>
</colgroup>
<thead>
<tr>
<th>Feature</th>
<th>PO files</th>
<th>MO files</th>
<th>Additional details</th>
</tr>
</thead>
<tbody class="matrix-body">
<tr valign="top">
<th>Read from literal string</th>
<td class="none">Yes</td>
<td class="none">No</td>
<td>
<table>
<tr align="left">
<th>Detailed feature</th>
<th>Status</th>
</tr>
<tr>
<td>single line msgid/msgstr reading</td>
<td>Yes</td>
</tr>
<tr>
<td>multiline msgid/msgstr reading</td>
<td>Yes</td>
</tr>
<tr>
<td>context reading</td>
<td>Yes</td>
</tr>
<tr>
<td>plurals</td>
<td>Yes</td>
</tr>
</table></td>
</tr>
<tr>
<th>Read from URL</th>
<td class="none">Yes</td>
<td class="none">No</td>
<td>
<table>
<tr align="left">
<th>Detailed feature</th>
<th>Status</th>
</tr>
<tr>
<td>Everything you can do with a literal string</td>
<td>Yes</td>
</tr>
<tr>
<td>Read from <link></td>
<td>Yes</td>
</tr>
<tr>
<td>Read from <URL></td>
<td>Yes</td>
</tr>
</table></td>
</tr>
</tbody>
<caption>
Support matrix
</caption>
</table>
</div>
</article>
<article id="how">
<header>
<h2>How?</h2>
<p>
Like this:
</p>
<script src="https://gist.github.com/cfv1984/5221069.js"></script>
</header>
</article>
</section>
<aside role="complementary">
</aside>
<footer>
<p>
Pomo is Apache licensed. All other software used comes with a note on its origins.
</p>
</footer>
<!--<script type="text/javascript" src="js/Pomo.min.js"></script>-->
<script type="text/javascript" src="js/pomo.js"></script>
<script>
onload = function(){
var loader = Pomo.load('po/pl_PL.po',{
format:'po',
mode:'ajax'
});
loader.ready(function(){
var msg = this.getText(
"Currently %s comment is waiting for approval. Please visit the moderation panel:",{
count: 3
});
console.log(''+msg);
}
);
}
</script>
</html>