File indexing completed on 2024-05-19 15:23:15

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 Dark)"/>
0006 </head><body style="background-color:#232629;color:#cfcfc2"><pre>
0007 <span style="color:#a43340;">### File wide comment, for reference see https://projectfluent.org</span>
0008 <span style="color:#a43340;">### And for a EBNF-Syntax, see https://github.com/projectfluent/fluent/blob/master/spec/fluent.ebnf</span>
0009 
0010 
0011 <span style="color:#a43340;">## Section comment: Simple texts</span>
0012 <span style="color:#7a7c7d;"># identifier = matched word</span>
0013 <span style="font-weight:bold;">hello-world</span> = <span style="color:#f44f4f;">Hello World</span>
0014 
0015 <span style="color:#7a7c7d;"># multiline text</span>
0016 <span style="font-weight:bold;">multiline</span> = <span style="color:#f44f4f;">Some text on the first line</span>
0017 <span style="color:#f44f4f;">    And more text on the next line</span>
0018 <span style="color:#f44f4f;">    One could even go further</span>
0019 
0020 <span style="color:#7a7c7d;"># block text</span>
0021 <span style="font-weight:bold;">block</span> =
0022 <span style="color:#f44f4f;">    No content on first line</span>
0023 <span style="color:#f44f4f;">    rest is like multiline</span>
0024 
0025 
0026 <span style="color:#a43340;">## Placeables, insert text from variables etc.</span>
0027 <span style="font-weight:bold;">variable-placeable</span> = <span style="color:#f44f4f;">We currently have </span><span style="color:#3daee9;">{ </span><span style="color:#27aeae;">$users</span><span style="color:#3daee9;"> }</span><span style="color:#f44f4f;"> users</span>
0028 <span style="font-weight:bold;">stacked-placeable</span> = <span style="color:#f44f4f;">More </span><span style="color:#3daee9;">{{</span><span style="color:#f44f4f;">&quot;Placeables&quot;</span><span style="color:#3daee9;">}}</span>
0029 
0030 <span style="color:#7a7c7d;"># Term, used only in other texts, not final translation string</span>
0031 <span style="font-weight:bold;">-name</span> = <span style="color:#f44f4f;">Fluent</span>
0032 <span style="font-weight:bold;">about</span> = <span style="color:#3daee9;">{ -name }</span><span style="color:#f44f4f;"> is great</span>
0033 
0034 <span style="color:#7a7c7d;"># Term with parameters</span>
0035 <span style="font-weight:bold;">-special-term</span> = <span style="color:#f44f4f;">Wrapper around </span><span style="color:#3daee9;">{ </span><span style="color:#27aeae;">$parameter</span><span style="color:#3daee9;"> }</span>
0036 <span style="font-weight:bold;">using-wrapper</span> = <span style="color:#f44f4f;">Wrapping </span><span style="color:#3daee9;">{ </span><span style="color:#8e44ad;">-special-term(parameter: </span><span style="color:#f44f4f;">&quot;stuff&quot;</span><span style="color:#8e44ad;">)</span><span style="color:#3daee9;"> }</span>
0037 
0038 <span style="font-weight:bold;">placeable-with-special-character</span> = <span style="color:#f44f4f;">Using a </span><span style="color:#3daee9;">{</span><span style="color:#f44f4f;">&quot;{ and \U01F91A or \\&quot;</span><span style="color:#3daee9;">}</span>
0039 
0040 <span style="font-weight:bold;">builtin-number</span> = <span style="color:#f44f4f;">Time elapsed: </span><span style="color:#3daee9;">{ </span><span style="color:#8e44ad;">NUMBER(</span><span style="color:#27aeae;">$duration</span><span style="color:#8e44ad;">, maximumFractionDigits: </span><span style="color:#f67400;">0</span><span style="color:#8e44ad;">)</span><span style="color:#3daee9;"> }</span><span style="color:#f44f4f;">s.</span>
0041 
0042 <span style="font-weight:bold;">builtin-date</span> = <span style="color:#f44f4f;">Last checked: </span><span style="color:#3daee9;">{ </span><span style="color:#8e44ad;">DATETIME(</span><span style="color:#27aeae;">$lastChecked</span><span style="color:#8e44ad;">, day: </span><span style="color:#f44f4f;">&quot;numeric&quot;</span><span style="color:#8e44ad;">, month: </span><span style="color:#f44f4f;">&quot;long&quot;</span><span style="color:#8e44ad;">)</span><span style="color:#3daee9;"> }</span><span style="color:#f44f4f;">.</span>
0043 
0044 
0045 <span style="color:#a43340;">## Selectors, different options for different types of numbers</span>
0046 <span style="color:#7a7c7d;"># by variable</span>
0047 <span style="font-weight:bold;">emails</span> =
0048 <span style="color:#f44f4f;">    </span><span style="color:#3daee9;">{ </span><span style="color:#27aeae;">$unreadEmails</span><span style="color:#3daee9;"> -&gt;</span>
0049 <span style="color:#3daee9;">        </span><span style="font-weight:bold;">[one]</span><span style="color:#f44f4f;"> You have one unread email.</span>
0050 <span style="color:#3daee9;">        </span><span style="font-weight:bold;">*[other]</span><span style="color:#f44f4f;"> You have </span><span style="color:#3daee9;">{ </span><span style="color:#27aeae;">$unreadEmails</span><span style="color:#3daee9;"> }</span><span style="color:#f44f4f;"> unread emails.</span>
0051 <span style="color:#3daee9;">    }</span>
0052 
0053 <span style="color:#7a7c7d;"># by function</span>
0054 <span style="font-weight:bold;">your-score</span> =
0055 <span style="color:#f44f4f;">    </span><span style="color:#3daee9;">{ </span><span style="color:#8e44ad;">NUMBER(</span><span style="color:#27aeae;">$score</span><span style="color:#8e44ad;">, minimumFractionDigits: </span><span style="color:#f67400;">1</span><span style="color:#8e44ad;">)</span><span style="color:#3daee9;"> -&gt;</span>
0056 <span style="color:#3daee9;">        </span><span style="font-weight:bold;">[0.0]</span><span style="color:#f44f4f;">   You scored zero points. What happened?</span>
0057 <span style="color:#3daee9;">       </span><span style="font-weight:bold;">*[other]</span><span style="color:#f44f4f;"> You scored </span><span style="color:#3daee9;">{ </span><span style="color:#8e44ad;">NUMBER(</span><span style="color:#27aeae;">$score</span><span style="color:#8e44ad;">, minimumFractionDigits: </span><span style="color:#f67400;">1</span><span style="color:#8e44ad;">)</span><span style="color:#3daee9;"> }</span><span style="color:#f44f4f;"> points.</span>
0058 <span style="color:#3daee9;">    }</span>
0059 
0060 <span style="color:#7a7c7d;"># with keywords</span>
0061 <span style="font-weight:bold;">your-rank</span> = <span style="color:#3daee9;">{ </span><span style="color:#8e44ad;">NUMBER(</span><span style="color:#27aeae;">$pos</span><span style="color:#8e44ad;">, type: </span><span style="color:#f44f4f;">&quot;ordinal&quot;</span><span style="color:#8e44ad;">)</span><span style="color:#3daee9;"> -&gt;</span>
0062 <span style="color:#3daee9;">   </span><span style="font-weight:bold;">[1]</span><span style="color:#f44f4f;"> You finished first!</span>
0063 <span style="color:#3daee9;">   </span><span style="font-weight:bold;">[one]</span><span style="color:#f44f4f;"> You finished </span><span style="color:#3daee9;">{</span><span style="color:#27aeae;">$pos</span><span style="color:#3daee9;">}</span><span style="color:#f44f4f;">st</span>
0064 <span style="color:#3daee9;">   </span><span style="font-weight:bold;">[two]</span><span style="color:#f44f4f;"> You finished </span><span style="color:#3daee9;">{</span><span style="color:#27aeae;">$pos</span><span style="color:#3daee9;">}</span><span style="color:#f44f4f;">nd</span>
0065 <span style="color:#3daee9;">   </span><span style="font-weight:bold;">[few]</span><span style="color:#f44f4f;"> You finished </span><span style="color:#3daee9;">{</span><span style="color:#27aeae;">$pos</span><span style="color:#3daee9;">}</span><span style="color:#f44f4f;">rd</span>
0066 <span style="color:#3daee9;">  </span><span style="font-weight:bold;">*[other]</span><span style="color:#f44f4f;"> You finished </span><span style="color:#3daee9;">{</span><span style="color:#27aeae;">$pos</span><span style="color:#3daee9;">}</span><span style="color:#f44f4f;">th</span>
0067 <span style="color:#3daee9;">}</span>
0068 
0069 <span style="color:#a43340;">## Attributes</span>
0070 <span style="font-weight:bold;">login-input</span> = <span style="color:#f44f4f;">Predefined value</span>
0071 <span style="color:#f44f4f;">    </span><span style="font-weight:bold;">.placeholder</span> = <span style="color:#f44f4f;">email@example.com</span>
0072 <span style="color:#f44f4f;">    </span><span style="font-weight:bold;">.aria-label</span> = <span style="color:#f44f4f;">Login input value</span>
0073 <span style="color:#f44f4f;">    </span><span style="font-weight:bold;">.title</span> = <span style="color:#f44f4f;">Type your login email</span>
0074 
0075 <span style="color:#7a7c7d;"># 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:#a43340;">## 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:#f44f4f;">Won't work </span><span style="color:#3daee9;">{</span><span style="color:#f44f4f;">&quot;\&quot;}</span>
0081 <span style="color:#3daee9;">    still-inside</span><span style="color:#da4453;text-decoration:underline;">\</span>
0082 <span style="color:#f44f4f;">    </span><span style="color:#3daee9;">{</span><span style="color:#f44f4f;">&quot;lonely \\ </span><span style="color:#da4453;text-decoration:underline;">\ &quot;}</span>
0083 <span style="color:#3daee9;">}</span>
0084 
0085 <span style="font-weight:bold;">disallowed-identifier</span><span style="color:#da4453;text-decoration:underline;"> characters</span>
0086 <span style="font-weight:bold;">disallowed-character</span><span style="color:#da4453;text-decoration:underline;">$</span>
0087 
0088 <span style="color:#7a7c7d;"># 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:#8e44ad;">fn(</span>
0090 <span style="color:#3daee9;">    </span><span style="color:#8e44ad;">fn(smth:</span><span style="color:#f67400;">123</span><span style="color:#8e44ad;">, </span><span style="color:#f67400;">0</span><span style="color:#8e44ad;">, </span><span style="color:#3daee9;">{</span><span style="color:#da4453;text-decoration:underline;">)</span>
0091 <span style="color:#3daee9;">    </span><span style="color:#8e44ad;">fn(noth</span><span style="color:#da4453;text-decoration:underline;">!ng:3)</span>
0092 <span style="color:#3daee9;">    </span><span style="color:#8e44ad;">fn(</span><span style="color:#da4453;text-decoration:underline;">\)</span>
0093 <span style="color:#3daee9;">}</span>
0094 
0095 <span style="color:#7a7c7d;"># 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:#f44f4f;">&quot;</span>
0098 <span style="color:#3daee9;">    </span><span style="color:#f44f4f;">&quot;</span><span style="color:#da4453;text-decoration:underline;">\u923&quot;</span>
0099 <span style="color:#3daee9;">    </span><span style="color:#f44f4f;">&quot;</span><span style="color:#da4453;text-decoration:underline;">\U92345&quot;</span>
0100 <span style="color:#3daee9;">    </span><span style="color:#f44f4f;">&quot;</span><span style="color:#da4453;text-decoration:underline;">\Ubcdefg&quot;</span>
0101 <span style="color:#3daee9;">}</span>
0102 </pre></body></html>