Warning, file /frameworks/syntax-highlighting/autotests/html/highlight_fluent.ftl.html was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 <!DOCTYPE html>
0002 <html><head>
0003 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
0004 <title>highlight_fluent.ftl</title>
0005 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (Fluent) - Theme (Breeze Light)"/>
0006 </head><body style="background-color:#ffffff;color:#1f1c1b"><pre>
0007 <span style="color:#607880;">### File wide comment, for reference see https://projectfluent.org</span>
0008 <span style="color:#607880;">### And for a EBNF-Syntax, see https://github.com/projectfluent/fluent/blob/master/spec/fluent.ebnf</span>
0009 
0010 
0011 <span style="color:#607880;">## Section comment: Simple texts</span>
0012 <span style="color:#898887;"># identifier = matched word</span>
0013 <span style="font-weight:bold;">hello-world</span> = <span style="color:#bf0303;">Hello World</span>
0014 
0015 <span style="color:#898887;"># multiline text</span>
0016 <span style="font-weight:bold;">multiline</span> = <span style="color:#bf0303;">Some text on the first line</span>
0017 <span style="color:#bf0303;">    And more text on the next line</span>
0018 <span style="color:#bf0303;">    One could even go further</span>
0019 
0020 <span style="color:#898887;"># block text</span>
0021 <span style="font-weight:bold;">block</span> =
0022 <span style="color:#bf0303;">    No content on first line</span>
0023 <span style="color:#bf0303;">    rest is like multiline</span>
0024 
0025 
0026 <span style="color:#607880;">## Placeables, insert text from variables etc.</span>
0027 <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>
0028 <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>
0029 
0030 <span style="color:#898887;"># Term, used only in other texts, not final translation string</span>
0031 <span style="font-weight:bold;">-name</span> = <span style="color:#bf0303;">Fluent</span>
0032 <span style="font-weight:bold;">about</span> = <span style="color:#3daee9;">{ -name }</span><span style="color:#bf0303;"> is great</span>
0033 
0034 <span style="color:#898887;"># Term with parameters</span>
0035 <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>
0036 <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>
0037 
0038 <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>
0039 
0040 <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>
0041 
0042 <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>
0043 
0044 
0045 <span style="color:#607880;">## Selectors, different options for different types of numbers</span>
0046 <span style="color:#898887;"># by variable</span>
0047 <span style="font-weight:bold;">emails</span> =
0048 <span style="color:#bf0303;">    </span><span style="color:#3daee9;">{ </span><span style="color:#0057ae;">$unreadEmails</span><span style="color:#3daee9;"> -&gt;</span>
0049 <span style="color:#3daee9;">        </span><span style="font-weight:bold;">[one]</span><span style="color:#bf0303;"> You have one unread email.</span>
0050 <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>
0051 <span style="color:#3daee9;">    }</span>
0052 
0053 <span style="color:#898887;"># by function</span>
0054 <span style="font-weight:bold;">your-score</span> =
0055 <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>
0056 <span style="color:#3daee9;">        </span><span style="font-weight:bold;">[0.0]</span><span style="color:#bf0303;">   You scored zero points. What happened?</span>
0057 <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>
0058 <span style="color:#3daee9;">    }</span>
0059 
0060 <span style="color:#898887;"># with keywords</span>
0061 <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>
0062 <span style="color:#3daee9;">   </span><span style="font-weight:bold;">[1]</span><span style="color:#bf0303;"> You finished first!</span>
0063 <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>
0064 <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>
0065 <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>
0066 <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>
0067 <span style="color:#3daee9;">}</span>
0068 
0069 <span style="color:#607880;">## Attributes</span>
0070 <span style="font-weight:bold;">login-input</span> = <span style="color:#bf0303;">Predefined value</span>
0071 <span style="color:#bf0303;">    </span><span style="font-weight:bold;">.placeholder</span> = <span style="color:#bf0303;">email@example.com</span>
0072 <span style="color:#bf0303;">    </span><span style="font-weight:bold;">.aria-label</span> = <span style="color:#bf0303;">Login input value</span>
0073 <span style="color:#bf0303;">    </span><span style="font-weight:bold;">.title</span> = <span style="color:#bf0303;">Type your login email</span>
0074 
0075 <span style="color:#898887;"># accessible via .</span>
0076 <span style="font-weight:bold;">login-placeholder</span> = <span style="color:#3daee9;">{login-input.placeholder}</span>
0077 
0078 <span style="color:#607880;">## Faulty code, no gurantees for sense of the end of errors</span>
0079 
0080 <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>
0081 <span style="color:#3daee9;">    still-inside</span><span style="color:#bf0303;text-decoration:underline;">\</span>
0082 <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>
0083 <span style="color:#3daee9;">}</span>
0084 
0085 <span style="font-weight:bold;">disallowed-identifier</span><span style="color:#bf0303;text-decoration:underline;"> characters</span>
0086 <span style="font-weight:bold;">disallowed-character</span><span style="color:#bf0303;text-decoration:underline;">$</span>
0087 
0088 <span style="color:#898887;"># Hilight only at the end of the line, not visible since err only visible on same line</span>
0089 <span style="font-weight:bold;">broken-function</span> = <span style="color:#3daee9;">{</span><span style="color:#644a9b;">fn(</span>
0090 <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>
0091 <span style="color:#3daee9;">    </span><span style="color:#644a9b;">fn(noth</span><span style="color:#bf0303;text-decoration:underline;">!ng:3)</span>
0092 <span style="color:#3daee9;">    </span><span style="color:#644a9b;">fn(</span><span style="color:#bf0303;text-decoration:underline;">\)</span>
0093 <span style="color:#3daee9;">}</span>
0094 
0095 <span style="color:#898887;"># Same for open ended string and wron unicode characters</span>
0096 <span style="font-weight:bold;">broken-string</span> = <span style="color:#3daee9;">{</span>
0097 <span style="color:#3daee9;">    </span><span style="color:#bf0303;">&quot;</span>
0098 <span style="color:#3daee9;">    </span><span style="color:#bf0303;">&quot;</span><span style="color:#bf0303;text-decoration:underline;">\u923&quot;</span>
0099 <span style="color:#3daee9;">    </span><span style="color:#bf0303;">&quot;</span><span style="color:#bf0303;text-decoration:underline;">\U92345&quot;</span>
0100 <span style="color:#3daee9;">    </span><span style="color:#bf0303;">&quot;</span><span style="color:#bf0303;text-decoration:underline;">\Ubcdefg&quot;</span>
0101 <span style="color:#3daee9;">}</span>
0102 </pre></body></html>