Hi.
At this moment, if I am not mistaken, Fluent can implicitly work only with what I would call “primitive” types - strings and numbers. I wanted to ask, whether there was a discussion if the support more “complex” types, like objects (key-value pairs) and lists?
To illustrate such feature on an example, having that supported by Fluent, the string and variables from playground may work like this.
For object in variables
{
"user": {
"name": "Anne",
"gender": "female"
},
"photoCount": 3
}
using syntax $object[field]
would render
shared-photos =
{$user[name]} {$photoCount ->
[one] added a new photo
*[other] added {$photoCount} new photos
} to {$user[gender] ->
[male] his stream
[female] her stream
*[other] their stream
}.
as “Anne added 3 new photos to her stream.”.
List in variables
{
"userName": "Anne",
"userGender": "female",
"photos": [
"my dog",
"my cat"
]
}
using syntax $list[item_order]
and function LENGTH($list)
would render
shared-photos =
{$userName} {length($photos) ->
[one] added a new photo called "$photos[1]"
[two] added new photos called "$photos[1]" and "$photos[2]"
*[other] added {LENGTH($photos)} new photos
} to {$userGender ->
[male] his stream
[female] her stream
*[other] their stream
}.
as “Anne added a new photos called “my dog” and “my cat” to her stream.”.
The main question is, whether you think this may be sane to include into the Fluent syntax. It’s more of a feature for the developers, rather than for localizers.