-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Introduce a number locale override #34
Conversation
|
Size Change: +26 B (+2.34%) Total Size: 1.14 kB
|
Name numberLocale to overrideLocale
Description
We need to be able to format numbers on the AT point of sale like we do in DE
This is handed by
Intl.NumberFormat(locale, value)
in PhrasebookWe pass
de-AT
as the locale on the AT pos, where we expect numbers to be formatted like12.345
but instead we see12 345
. This is becauseIntl.NumberFormat()
doesn't really recognisede-AT
and just falls back to a defaultTo handle this, and render numbers in AT like they are shown in DE, I propose here to pass through the
t()
method an override locale, the reasons for this arecount
value will shut of the inbuilt pluralisation functionality, and would require a fair amount of logic to parse these values back to numbers to regain it, considering that DE formatted numbers like decimals to the outside world this is a bit tricky1.234 -> 1
etcExpected usage in consumers
For these reasons the proposed changes in this PR yield the simplest way forward