L20n/Features/Attribute indexes

From MozillaWiki
< L20n‎ | Features
Jump to: navigation, search


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 - ?