Skip to content

Is there a "self-attribute" shorthand? And if not, should there be? #372

Answered by rkh
ilyvion asked this question in Q&A
Discussion options

You must be logged in to vote

It does sound like you might be trying to put more logic into Fluent than most of us usually do. Maybe go with custom functions instead?

Accessing the data depends on the environment. I'd recommend looking for CLDR/ICU bindings.

If you're in the browser, some but not all of the CLDR is exposed via Intl. Unfortunately, you cannot get unit names without an amount from Intl.DisplayNames (though for other things, it is your friend), but you can grab them via Intl.NumberFormat (which is also what fluent.js uses). formatToParts is your friend if you want to grab only part of the output.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ilyvion
Comment options

@rkh
Comment options

Answer selected by ilyvion
@eemeli
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants