Confirmed users
1,016
edits
No edit summary |
No edit summary |
||
| Line 86: | Line 86: | ||
<pre style="color:blue"> | <pre style="color:blue"> | ||
let msg = ctx.get("extName") | let msg = ctx.get("extName") | ||
let msg2 = ctx.get("drinks", 0) # Coca cola | let msg2 = ctx.get("drinks", 0) # Coca cola | ||
| Line 99: | Line 98: | ||
<cookie {'one': "Cookie", 'many': "Cookies"}> | <cookie {'one': "Cookie", 'many': "Cookies"}> | ||
<install "Install {{extName}}> | <install "Install {{extName}}"> | ||
<buy "Buy {{drinks[0]}}> | <buy "Buy {{drinks[0]}}"> | ||
<iWant "I want a {{cookie['one']}}"> | <iWant "I want a {{cookie['one']}}"> | ||
</pre> | </pre> | ||
<pre style="color:blue"> | <pre style="color:blue"> | ||
let msg = ctx.get("install") # Install AdBlock | let msg = ctx.get("install") # Install AdBlock | ||
let msg2 = ctx.get("buy") # Buy Coca cola | let msg2 = ctx.get("buy") # Buy Coca cola | ||
let msg3 = ctx.get("iWant'); # I want a Cookie | let msg3 = ctx.get("iWant'); # I want a Cookie | ||
</pre> | |||
=== Entity properties === | |||
In L20n context, an entity is an object that may contain a value and a list of key-value pairs of properties: | |||
<pre style="color:blue"> | |||
<extName "AdBlock" | |||
gender: "male" | |||
declension: "nominative"> | |||
<buttonClick "Click me" | |||
tooltip: "If you click me, I'll give you a kiss" | |||
accesskey: "c"> | |||
</pre> | |||
JS: | |||
<pre style="color:blue"> | |||
let msg = ctx.getAttributes("buttonClick").gender | |||
</pre> | |||
XML: | |||
<pre style="color:blue"> | |||
<button l10n_id="buttonClick"/> | |||
</pre> | </pre> | ||