Currency names
Please reconsider: "Rarely displayed" and "its available in Intl.DisplayNames"
There are tons of scenarios where you're not in a browser or have access to Intl
Even if you do; fetching and transforming and mapping almost 200 currencies is much heavier on the frontend side (try doing that on a 5 year old Android in a React Native app, that uses a Intl polyfill), than just doing direct-lookup, like so:
data.meta.currencies[code].name
{
"data" ...,
"meta": {
"currencies": {
"AFN": {
"code": "AFN",
"name": "Afghan Afghani",
"symbol": "؋"
}
}
}
}
On the backend side, this should be cached anyway so the extra work there is negligible.
The trade-off here is memory usage and binary size.
The current data that we ship is fairly small, the file is ~40kb, though that doesn't translate to equivalent memory usage / binary size. Adding currency names would increase the size of the dataset about 20 times, since you'd have to store 165 currency names for about 215 locales, resulting in about 35 475 new stored strings, which would probably need to be optimized in some way. The additional weight of localization data is often discussed when it comes to packages like this one (and whether to avoid them), and people are in general sensitive to it.
I am happy to leave this issue open for other people to vote for this feature, but for now I am inclined to leave it as-is, since you're the first one to request currency names in the 4.5 years of this package's existence, and since I myself haven't had the need for that yet in my own projects.
In the interim I suggest forking this package and modifying gen.go to generate the data for yourself.
Understood, thanks for the reply :)