-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
gettext.js
49 lines (48 loc) · 1.01 KB
/
gettext.js
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
// @ts-nocheck
gettext.displayName = 'gettext'
gettext.aliases = ['po']
/** @type {import('../core.js').Syntax} */
export default function gettext(Prism) {
Prism.languages.gettext = {
comment: [
{
pattern: /# .*/,
greedy: true,
alias: 'translator-comment'
},
{
pattern: /#\..*/,
greedy: true,
alias: 'extracted-comment'
},
{
pattern: /#:.*/,
greedy: true,
alias: 'reference-comment'
},
{
pattern: /#,.*/,
greedy: true,
alias: 'flag-comment'
},
{
pattern: /#\|.*/,
greedy: true,
alias: 'previously-untranslated-comment'
},
{
pattern: /#.*/,
greedy: true
}
],
string: {
pattern: /(^|[^\\])"(?:[^"\\]|\\.)*"/,
lookbehind: true,
greedy: true
},
keyword: /^msg(?:ctxt|id|id_plural|str)\b/m,
number: /\b\d+\b/,
punctuation: /[\[\]]/
}
Prism.languages.po = Prism.languages.gettext
}