1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:38:10 +00:00
serenity/Userland/Libraries/LibUnicode
Timothy Flynn 39e031c4dd LibJS+LibUnicode: Generate all styles of currency localizations
Currently, LibUnicode is only parsing and generating the "long" style of
currency display names. However, the CLDR contains "short" and "narrow"
forms as well that need to be handled. Parse these, and update LibJS to
actually respect the "style" option provided by the user for displaying
currencies with Intl.DisplayNames.

Note: There are some discrepencies between the engines on how style is
handled. In particular, running:

new Intl.DisplayNames('en', {type:'currency', style:'narrow'}).of('usd')

Gives:

  SpiderMoney: "USD"
  V8: "US Dollar"
  LibJS: "$"

And running:

new Intl.DisplayNames('en', {type:'currency', style:'short'}).of('usd')

Gives:

  SpiderMonkey: "$"
  V8: "US Dollar"
  LibJS: "$"

My best guess is V8 isn't handling style, and just returning the long
form (which is what LibJS did before this commit). And SpiderMoney can
handle some styles, but if they don't have a value for the requested
style, they fall back to the canonicalized code passed into of().
2021-11-13 11:52:45 +00:00
..
CharacterTypes.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
CharacterTypes.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
CMakeLists.txt LibUnicode: Add some data related to currency codes 2021-09-11 11:05:50 +01:00
CurrencyCode.cpp LibUnicode: Add some data related to currency codes 2021-09-11 11:05:50 +01:00
CurrencyCode.h LibUnicode: Add some data related to currency codes 2021-09-11 11:05:50 +01:00
Forward.h LibUnicode: Parse and generate standard percentage formatting rules 2021-11-12 09:17:08 +00:00
Locale.cpp LibJS+LibUnicode: Generate all styles of currency localizations 2021-11-13 11:52:45 +00:00
Locale.h LibJS+LibUnicode: Generate all styles of currency localizations 2021-11-13 11:52:45 +00:00