Luxon: Luxon feedback for ECMA402 `Intl.Locale`

Created on 2 Oct 2018  路  6Comments  路  Source: moment/luxon

Hi!

We (ECMA TC39) are working on a new low-level API called Intl.Locale[0] that seems to fit perfectly into what Luxon project decided to shortcut through[1].

It would be awesome to get this projects feedback on our API since we aim to help in exactly the kind of scenarios as you're facing.

[0] https://github.com/tc39/proposal-intl-locale/
[1] https://github.com/moment/luxon/blob/master/src/impl/locale.js#L23

Most helpful comment

You're reading it correctly!

Thanks for the feedback. Glad to hear it fits your needs! If you have more time, feel free to scan through the issues as we're trying to iron out remaining details.

Also, other active proposals may be interesting for your use case:

(esp. Shane's NumberFormat revision is a pretty major rewrite :))

All 6 comments

CC @littledan

@zbraniecki Holy crap that is awesome. It's funny, I just added that code you referenced, so this is top-of-mind for me, and I absolutely love the idea of having a built-in parser like that (and formatter! Luxon does that too).

What's even more important to Luxon is the locale list (and I love that I can get them as Locale objects). Just being able to tell a caller "here's what I can do" comes up all the time.

I'm going to dig into some specifics, but just to make sure I understand the API (I am bad at reading specs and it seems to have drifted from your original proposal), is the following the behavior?

var l1 = Intl.Locale("de-AT", { calendar: "coptic" });
l1.baseName //=> de-AT
l1.language //=> de
l1.calendar //=> coptic
l1.numberingSystem //=> null
l1.toString() //=> de-AT-u-ca-coptic

var l2 = l1.maximize();
l2.baseName //=> de-AT
l2.numberingSystem //=> latn
l2.toString() //=> de-AT-u-ca-coptic-nu-latn-etc

l2.minimize(); //=> same as l1

Intl.Locale("de-AT-u-ca-coptic") //=> also the same as l1
Intl.Locale("de-AT-u-ca-buddhist", { calendar: "coptic" }) //=> also the same as l1

If so, that's a totally great API.

You're reading it correctly!

Thanks for the feedback. Glad to hear it fits your needs! If you have more time, feel free to scan through the issues as we're trying to iron out remaining details.

Also, other active proposals may be interesting for your use case:

(esp. Shane's NumberFormat revision is a pretty major rewrite :))

@zbraniecki I looked through the issues and most of them seemed to be about the details of the spec, not exactly the supported features, so I don't think I have much to add besides cheerleading.

Thanks for your feedback. Would you be interested in coming to our monthly ECMA-402 calls? I think we would really benefit from a better understanding of application and library needs.

@littledan Yeah, I'd be in down for that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Frondor picture Frondor  路  5Comments

thetuyen picture thetuyen  路  4Comments

kwtucker picture kwtucker  路  6Comments

icambron picture icambron  路  5Comments

jonathanborges picture jonathanborges  路  6Comments