L20n/Features/Nested indexes

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


goals

To allow for multiple indexes to be used to resolve a hash object of unbalanced depth

example

<happy[plural(user.number), user.person, user.gender] {
  one: {
    first: "I",
    second: "You",
    third: {
      male: "He",
      female: "She",
      impersonal: "It"
    }
  },
  many: {
    first: "We",
    second: "You",
    third: "They"
  }
}>

In this case, if plural returns "many", and user.person returns "first" then we should just return "We" ignoring the third index.

See also Issue 12

status

  • accepted