L20n/Features/Attribute indexes: Difference between revisions

From MozillaWiki
< L20n‎ | Features
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
[[Category:L20n Features|{{SUBPAGENAME}}]]
[[Category:L20n Features|{{SUBPAGENAME}}]]
[[Category:L20n]]


== goal ==
== goal ==

Latest revision as of 20:02, 7 August 2012


goal

Allow attributes to have their own indexes.

examples

<brandName[plural($downloadCount)] {
 *one: "Firefox", 
  many: "Firefoxes"
}
  accesskey[@os]: {
   *win: "d", 
    mac: "l", 
    lin: "d"
  }
>

In the example above, the value of @os selects the key of the attribute hash. If @os is none of (win, mac, lin), the default key (*win) is used.

On a Mac, referencing the attribute will return "l".

{{ brandName..accesskey }}

If the index is not defined on the attribute, the entity's index is looked at. In the following example, the value for the accesskey is selected based on the value of plural(downloadCount).

<brandName[plural($downloadCount)] {
 *one: "Firefox", 
  many: "Firefoxes"
}
  accesskey: {
   *one: "F", 
    many: "s"
  }
>


chain of hash resolving:

  • attribute index
  • entity index
  • attribute default value

status

  • gandalf - ?
  • stas - ok
  • pike - ?