Debian Codegraph @

autotests/html/highlight_fluent.ftl.html

raw
1 <!DOCTYPE html>
2 <html><head>
3 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4 <title>highlight_fluent.ftl</title>
5 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (Fluent) - Theme (Breeze Light)"/>
6 </head><body style="background-color:#ffffff;color:#1f1c1b"><pre>
7 <span style="color:#607880;">### File wide comment, for reference see https://projectfluent.org</span>
8 <span style="color:#607880;">### And for a EBNF-Syntax, see https://github.com/projectfluent/fluent/blob/master/spec/fluent.ebnf</span>
9
10
11 <span style="color:#607880;">## Section comment: Simple texts</span>
12 <span style="color:#898887;"># identifier = matched word</span>
13 <span style="font-weight:bold;">hello-world</span> = <span style="color:#bf0303;">Hello World</span>
14
15 <span style="color:#898887;"># multiline text</span>
16 <span style="font-weight:bold;">multiline</span> = <span style="color:#bf0303;">Some text on the first line</span>
17 <span style="color:#bf0303;"> And more text on the next line</span>
18 <span style="color:#bf0303;"> One could even go further</span>
19
20 <span style="color:#898887;"># block text</span>
21 <span style="font-weight:bold;">block</span> =
22 <span style="color:#bf0303;"> No content on first line</span>
23 <span style="color:#bf0303;"> rest is like multiline</span>
24
25
26 <span style="color:#607880;">## Placeables, insert text from variables etc.</span>
27 <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>
28 <span style="font-weight:bold;">stacked-placeable</span> = <span style="color:#bf0303;">More </span><span style="color:#3daee9;">{{</span><span style="color:#bf0303;">&quot;Placeables&quot;</span><span style="color:#3daee9;">}}</span>
29
30 <span style="color:#898887;"># Term, used only in other texts, not final translation string</span>
31 <span style="font-weight:bold;">-name</span> = <span style="color:#bf0303;">Fluent</span>
32 <span style="font-weight:bold;">about</span> = <span style="color:#3daee9;">{ -name }</span><span style="color:#bf0303;"> is great</span>
33
34 <span style="color:#898887;"># Term with parameters</span>
35 <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>
36 <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;">&quot;stuff&quot;</span><span style="color:#644a9b;">)</span><span style="color:#3daee9;"> }</span>
37
38 <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;">&quot;{ and \U01F91A or \\&quot;</span><span style="color:#3daee9;">}</span>
39
40 <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>
41
42 <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;">&quot;numeric&quot;</span><span style="color:#644a9b;">, month: </span><span style="color:#bf0303;">&quot;long&quot;</span><span style="color:#644a9b;">)</span><span style="color:#3daee9;"> }</span><span style="color:#bf0303;">.</span>
43
44
45 <span style="color:#607880;">## Selectors, different options for different types of numbers</span>
46 <span style="color:#898887;"># by variable</span>
47 <span style="font-weight:bold;">emails</span> =
48 <span style="color:#bf0303;"> </span><span style="color:#3daee9;">{ </span><span style="color:#0057ae;">$unreadEmails</span><span style="color:#3daee9;"> -&gt;</span>
49 <span style="color:#3daee9;"> </span><span style="font-weight:bold;">[one]</span><span style="color:#bf0303;"> You have one unread email.</span>
50 <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>
51 <span style="color:#3daee9;"> }</span>
52
53 <span style="color:#898887;"># by function</span>
54 <span style="font-weight:bold;">your-score</span> =
55 <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;"> -&gt;</span>
56 <span style="color:#3daee9;"> </span><span style="font-weight:bold;">[0.0]</span><span style="color:#bf0303;"> You scored zero points. What happened?</span>
57 <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>
58 <span style="color:#3daee9;"> }</span>
59
60 <span style="color:#898887;"># with keywords</span>
61 <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;">&quot;ordinal&quot;</span><span style="color:#644a9b;">)</span><span style="color:#3daee9;"> -&gt;</span>
62 <span style="color:#3daee9;"> </span><span style="font-weight:bold;">[1]</span><span style="color:#bf0303;"> You finished first!</span>
63 <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>
64 <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>
65 <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>
66 <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>
67 <span style="color:#3daee9;">}</span>
68
69 <span style="color:#607880;">## Attributes</span>
70 <span style="font-weight:bold;">login-input</span> = <span style="color:#bf0303;">Predefined value</span>
71 <span style="color:#bf0303;"> </span><span style="font-weight:bold;">.placeholder</span> = <span style="color:#bf0303;">[email protected]</span>
72 <span style="color:#bf0303;"> </span><span style="font-weight:bold;">.aria-label</span> = <span style="color:#bf0303;">Login input value</span>
73 <span style="color:#bf0303;"> </span><span style="font-weight:bold;">.title</span> = <span style="color:#bf0303;">Type your login email</span>
74
75 <span style="color:#898887;"># accessible via .</span>
76 <span style="font-weight:bold;">login-placeholder</span> = <span style="color:#3daee9;">{login-input.placeholder}</span>
77
78 <span style="color:#607880;">## Faulty code, no gurantees for sense of the end of errors</span>
79
80 <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;">&quot;\&quot;}</span>
81 <span style="color:#3daee9;"> still-inside</span><span style="color:#bf0303;text-decoration:underline;">\</span>
82 <span style="color:#bf0303;"> </span><span style="color:#3daee9;">{</span><span style="color:#bf0303;">&quot;lonely \\ </span><span style="color:#bf0303;text-decoration:underline;">\ &quot;}</span>
83 <span style="color:#3daee9;">}</span>
84
85 <span style="font-weight:bold;">disallowed-identifier</span><span style="color:#bf0303;text-decoration:underline;"> characters</span>
86 <span style="font-weight:bold;">disallowed-character</span><span style="color:#bf0303;text-decoration:underline;">$</span>
87
88 <span style="color:#898887;"># Hilight only at the end of the line, not visible since err only visible on same line</span>
89 <span style="font-weight:bold;">broken-function</span> = <span style="color:#3daee9;">{</span><span style="color:#644a9b;">fn(</span>
90 <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>
91 <span style="color:#3daee9;"> </span><span style="color:#644a9b;">fn(noth</span><span style="color:#bf0303;text-decoration:underline;">!ng:3)</span>
92 <span style="color:#3daee9;"> </span><span style="color:#644a9b;">fn(</span><span style="color:#bf0303;text-decoration:underline;">\)</span>
93 <span style="color:#3daee9;">}</span>
94
95 <span style="color:#898887;"># Same for open ended string and wron unicode characters</span>
96 <span style="font-weight:bold;">broken-string</span> = <span style="color:#3daee9;">{</span>
97 <span style="color:#3daee9;"> </span><span style="color:#bf0303;">&quot;</span>
98 <span style="color:#3daee9;"> </span><span style="color:#bf0303;">&quot;</span><span style="color:#bf0303;text-decoration:underline;">\u923&quot;</span>
99 <span style="color:#3daee9;"> </span><span style="color:#bf0303;">&quot;</span><span style="color:#bf0303;text-decoration:underline;">\U92345&quot;</span>
100 <span style="color:#3daee9;"> </span><span style="color:#bf0303;">&quot;</span><span style="color:#bf0303;text-decoration:underline;">\Ubcdefg&quot;</span>
101 <span style="color:#3daee9;">}</span>
102 </pre></body></html>