-
Notifications
You must be signed in to change notification settings - Fork 446
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
Fallback to LC_MONETARY when formatting currency #1051
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically okay, but we really should fall back to LC_NUMERIC
if LC_MONETARY
isn't set so as to match the old behavior for people who don't have LC_MONETARY
set; right now default_locale
would then fall back to LC_ALL
, LANG
, etc.
You'd need to change default_locale()
to accept multiple "primary options" before those fallbacks.
Furthermore, previously, LC_MONETARY
was ignored altogether, but now it will be used if set for money formatting, which could be a surprising change for people who have it set. This change will need to be thoroughly documented in the changelog.
* ``LC_NUMERIC``, | ||
* ``LC_NUMERIC`` or ``LC_MONETARY`` for currency related functions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation doesn't seem to match the new behavior; it's not an "or" if the envvar is set. This should probably say
* ``LC_NUMERIC``, | |
* ``LC_NUMERIC`` or ``LC_MONETARY`` for currency related functions, | |
* ``LC_MONETARY`` for currency related functions, | |
* ``LC_NUMERIC`` for other numbers, |
or something along those lines.
Thanks for the review and feedback, @akx, much appreciated. I'll look into addressing your comments and updating this PR accordingly. Not sure when I can get to it, but I'll try to make time soon. |
@afh Do you have time to maybe look at this PR? Could get it merged for 2.16 :) |
Thanks for reaching out, @akx 🙂 |
@afh No worries, thanks for replying! I can take this over, no problem. |
Very much appreciated, @akx! 🙏 Do ping me if there's something that can be tested. |
POSIX defines the
LC_MONETARY
category to be used for monetary formatting, hence babel could be more standards-compliant in this regard.