Hi all,
I'm working on Intl API v2 and I'm thinking on how to tie those features to
L20n. My approach is to design API that can be used directly from JS (similarly
to how Intl works right now), but in the back of my head I'm thinking on how
we'll expose the same API from within of l20n so that localizers can use it as
well.
One of first things I'd love to see is list formatting. CLDR provides the data
for that and we can add list formatting which would benefit a lot of current
Gaia apps that do it DYI way.
It would look sth like this:
var f = mozIntl.ListFormatter(navigator.languages, {
end: 'word'
});
f.format(['John', 'Mary', 'Nick']); // in en-US it would produce: "John, Mary
and Nick"
--------
Now, when I think about getting it into L20n, one question that pops is how we
handle lists. It feels to me that over last two years we removed the concept of
lists and replaced them with Hashes, which works for values, but not
necessarily for variables.
How can a developer pass a list as a variable, how can he access variable list
elements (no integer, so no $var[0]) and do we want to just support sth like:
<myEntity "You added {{ @cldr.list($namesList) }}">
How does it look to you?
zb.
_______________________________________________
tools-l10n mailing list
[email protected]
https://lists.mozilla.org/listinfo/tools-l10n