File: highlight_fluent.ftl.html

package info (click to toggle)
kf6-syntax-highlighting 6.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 47,568 kB
  • sloc: xml: 197,750; cpp: 12,850; python: 3,023; sh: 955; perl: 546; ruby: 488; pascal: 393; javascript: 161; php: 150; jsp: 132; lisp: 131; haskell: 124; ada: 119; ansic: 107; makefile: 96; f90: 94; ml: 85; cobol: 81; yacc: 71; csh: 62; erlang: 54; sql: 51; java: 47; objc: 37; awk: 31; asm: 30; tcl: 29; fortran: 18; cs: 10
file content (102 lines) | stat: -rw-r--r-- 10,895 bytes parent folder | download
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
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>highlight_fluent.ftl</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (Fluent) - Theme (Breeze Light)"/>
</head><body style="background-color:#ffffff;color:#1f1c1b"><pre>
<span style="color:#607880">### File wide comment, for reference see https://projectfluent.org</span>
<span style="color:#607880">### And for a EBNF-Syntax, see https://github.com/projectfluent/fluent/blob/master/spec/fluent.ebnf</span>


<span style="color:#607880">## Section comment: Simple texts</span>
<span style="color:#898887"># identifier = matched word</span>
<span style="font-weight:bold">hello-world</span> = <span style="color:#bf0303">Hello World</span>

<span style="color:#898887"># multiline text</span>
<span style="font-weight:bold">multiline</span> = <span style="color:#bf0303">Some text on the first line</span>
<span style="color:#bf0303">    And more text on the next line</span>
<span style="color:#bf0303">    One could even go further</span>

<span style="color:#898887"># block text</span>
<span style="font-weight:bold">block</span> =
<span style="color:#bf0303">    No content on first line</span>
<span style="color:#bf0303">    rest is like multiline</span>


<span style="color:#607880">## Placeables, insert text from variables etc.</span>
<span style="font-weight:bold">variable-placeable</span> = <span style="color:#bf0303">We currently have </span><span style="color:#3daee9">{ </span><span style="color:#0057ae">$users</span><span style="color:#3daee9"> }</span><span style="color:#bf0303"> users</span>
<span style="font-weight:bold">stacked-placeable</span> = <span style="color:#bf0303">More </span><span style="color:#3daee9">{{</span><span style="color:#bf0303">"Placeables"</span><span style="color:#3daee9">}}</span>

<span style="color:#898887"># Term, used only in other texts, not final translation string</span>
<span style="font-weight:bold">-name</span> = <span style="color:#bf0303">Fluent</span>
<span style="font-weight:bold">about</span> = <span style="color:#3daee9">{ -name }</span><span style="color:#bf0303"> is great</span>

<span style="color:#898887"># Term with parameters</span>
<span style="font-weight:bold">-special-term</span> = <span style="color:#bf0303">Wrapper around </span><span style="color:#3daee9">{ </span><span style="color:#0057ae">$parameter</span><span style="color:#3daee9"> }</span>
<span style="font-weight:bold">using-wrapper</span> = <span style="color:#bf0303">Wrapping </span><span style="color:#3daee9">{ </span><span style="color:#644a9b">-special-term(parameter: </span><span style="color:#bf0303">"stuff"</span><span style="color:#644a9b">)</span><span style="color:#3daee9"> }</span>

<span style="font-weight:bold">placeable-with-special-character</span> = <span style="color:#bf0303">Using a </span><span style="color:#3daee9">{</span><span style="color:#bf0303">"{ and \U01F91A or \\"</span><span style="color:#3daee9">}</span>

<span style="font-weight:bold">builtin-number</span> = <span style="color:#bf0303">Time elapsed: </span><span style="color:#3daee9">{ </span><span style="color:#644a9b">NUMBER(</span><span style="color:#0057ae">$duration</span><span style="color:#644a9b">, maximumFractionDigits: </span><span style="color:#b08000">0</span><span style="color:#644a9b">)</span><span style="color:#3daee9"> }</span><span style="color:#bf0303">s.</span>

<span style="font-weight:bold">builtin-date</span> = <span style="color:#bf0303">Last checked: </span><span style="color:#3daee9">{ </span><span style="color:#644a9b">DATETIME(</span><span style="color:#0057ae">$lastChecked</span><span style="color:#644a9b">, day: </span><span style="color:#bf0303">"numeric"</span><span style="color:#644a9b">, month: </span><span style="color:#bf0303">"long"</span><span style="color:#644a9b">)</span><span style="color:#3daee9"> }</span><span style="color:#bf0303">.</span>


<span style="color:#607880">## Selectors, different options for different types of numbers</span>
<span style="color:#898887"># by variable</span>
<span style="font-weight:bold">emails</span> =
<span style="color:#bf0303">    </span><span style="color:#3daee9">{ </span><span style="color:#0057ae">$unreadEmails</span><span style="color:#3daee9"> -></span>
<span style="color:#3daee9">        </span><span style="font-weight:bold">[one]</span><span style="color:#bf0303"> You have one unread email.</span>
<span style="color:#3daee9">        </span><span style="font-weight:bold">*[other]</span><span style="color:#bf0303"> You have </span><span style="color:#3daee9">{ </span><span style="color:#0057ae">$unreadEmails</span><span style="color:#3daee9"> }</span><span style="color:#bf0303"> unread emails.</span>
<span style="color:#3daee9">    }</span>

<span style="color:#898887"># by function</span>
<span style="font-weight:bold">your-score</span> =
<span style="color:#bf0303">    </span><span style="color:#3daee9">{ </span><span style="color:#644a9b">NUMBER(</span><span style="color:#0057ae">$score</span><span style="color:#644a9b">, minimumFractionDigits: </span><span style="color:#b08000">1</span><span style="color:#644a9b">)</span><span style="color:#3daee9"> -></span>
<span style="color:#3daee9">        </span><span style="font-weight:bold">[0.0]</span><span style="color:#bf0303">   You scored zero points. What happened?</span>
<span style="color:#3daee9">       </span><span style="font-weight:bold">*[other]</span><span style="color:#bf0303"> You scored </span><span style="color:#3daee9">{ </span><span style="color:#644a9b">NUMBER(</span><span style="color:#0057ae">$score</span><span style="color:#644a9b">, minimumFractionDigits: </span><span style="color:#b08000">1</span><span style="color:#644a9b">)</span><span style="color:#3daee9"> }</span><span style="color:#bf0303"> points.</span>
<span style="color:#3daee9">    }</span>

<span style="color:#898887"># with keywords</span>
<span style="font-weight:bold">your-rank</span> = <span style="color:#3daee9">{ </span><span style="color:#644a9b">NUMBER(</span><span style="color:#0057ae">$pos</span><span style="color:#644a9b">, type: </span><span style="color:#bf0303">"ordinal"</span><span style="color:#644a9b">)</span><span style="color:#3daee9"> -></span>
<span style="color:#3daee9">   </span><span style="font-weight:bold">[1]</span><span style="color:#bf0303"> You finished first!</span>
<span style="color:#3daee9">   </span><span style="font-weight:bold">[one]</span><span style="color:#bf0303"> You finished </span><span style="color:#3daee9">{</span><span style="color:#0057ae">$pos</span><span style="color:#3daee9">}</span><span style="color:#bf0303">st</span>
<span style="color:#3daee9">   </span><span style="font-weight:bold">[two]</span><span style="color:#bf0303"> You finished </span><span style="color:#3daee9">{</span><span style="color:#0057ae">$pos</span><span style="color:#3daee9">}</span><span style="color:#bf0303">nd</span>
<span style="color:#3daee9">   </span><span style="font-weight:bold">[few]</span><span style="color:#bf0303"> You finished </span><span style="color:#3daee9">{</span><span style="color:#0057ae">$pos</span><span style="color:#3daee9">}</span><span style="color:#bf0303">rd</span>
<span style="color:#3daee9">  </span><span style="font-weight:bold">*[other]</span><span style="color:#bf0303"> You finished </span><span style="color:#3daee9">{</span><span style="color:#0057ae">$pos</span><span style="color:#3daee9">}</span><span style="color:#bf0303">th</span>
<span style="color:#3daee9">}</span>

<span style="color:#607880">## Attributes</span>
<span style="font-weight:bold">login-input</span> = <span style="color:#bf0303">Predefined value</span>
<span style="color:#bf0303">    </span><span style="font-weight:bold">.placeholder</span> = <span style="color:#bf0303">email@example.com</span>
<span style="color:#bf0303">    </span><span style="font-weight:bold">.aria-label</span> = <span style="color:#bf0303">Login input value</span>
<span style="color:#bf0303">    </span><span style="font-weight:bold">.title</span> = <span style="color:#bf0303">Type your login email</span>

<span style="color:#898887"># accessible via .</span>
<span style="font-weight:bold">login-placeholder</span> = <span style="color:#3daee9">{login-input.placeholder}</span>

<span style="color:#607880">## Faulty code, no gurantees for sense of the end of errors</span>

<span style="font-weight:bold">faulty-quote</span> = <span style="color:#bf0303">Won't work </span><span style="color:#3daee9">{</span><span style="color:#bf0303">"\"}</span>
<span style="color:#3daee9">    still-inside</span><span style="color:#bf0303;text-decoration:underline">\</span>
<span style="color:#bf0303">    </span><span style="color:#3daee9">{</span><span style="color:#bf0303">"lonely \\ </span><span style="color:#bf0303;text-decoration:underline">\ "}</span>
<span style="color:#3daee9">}</span>

<span style="font-weight:bold">disallowed-identifier</span><span style="color:#bf0303;text-decoration:underline"> characters</span>
<span style="font-weight:bold">disallowed-character</span><span style="color:#bf0303;text-decoration:underline">$</span>

<span style="color:#898887"># Hilight only at the end of the line, not visible since err only visible on same line</span>
<span style="font-weight:bold">broken-function</span> = <span style="color:#3daee9">{</span><span style="color:#644a9b">fn(</span>
<span style="color:#3daee9">    </span><span style="color:#644a9b">fn(smth:</span><span style="color:#b08000">123</span><span style="color:#644a9b">, </span><span style="color:#b08000">0</span><span style="color:#644a9b">, </span><span style="color:#3daee9">{</span><span style="color:#bf0303;text-decoration:underline">)</span>
<span style="color:#3daee9">    </span><span style="color:#644a9b">fn(noth</span><span style="color:#bf0303;text-decoration:underline">!ng:3)</span>
<span style="color:#3daee9">    </span><span style="color:#644a9b">fn(</span><span style="color:#bf0303;text-decoration:underline">\)</span>
<span style="color:#3daee9">}</span>

<span style="color:#898887"># Same for open ended string and wron unicode characters</span>
<span style="font-weight:bold">broken-string</span> = <span style="color:#3daee9">{</span>
<span style="color:#3daee9">    </span><span style="color:#bf0303">"</span>
<span style="color:#3daee9">    </span><span style="color:#bf0303">"</span><span style="color:#bf0303;text-decoration:underline">\u923"</span>
<span style="color:#3daee9">    </span><span style="color:#bf0303">"</span><span style="color:#bf0303;text-decoration:underline">\U92345"</span>
<span style="color:#3daee9">    </span><span style="color:#bf0303">"</span><span style="color:#bf0303;text-decoration:underline">\Ubcdefg"</span>
<span style="color:#3daee9">}</span>
</pre></body></html>