Closed Bug 1130285 Opened 9 years ago Closed 9 years ago

[l10n] Numbers are not formatted correctly for dsb, hsb

Categories

(www.mozilla.org :: L10N, defect)

Development/Staging
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: flod, Assigned: pmac)

Details

(Whiteboard: [kb=1654682] )

Attachments

(1 file)

https://www.mozilla.org/hsb/
https://www.mozilla.org/dsb/

Numbers are formatted the "English way", with commas as thousands separator.

I assume this is a limitation in babel?
https://github.com/mozilla/bedrock/blob/master/lib/l10n_utils/helpers.py#L9
Summary: Numbers are not formatted correctly for dsb, hsb → [l10n] Numbers are not formatted correctly for dsb, hsb
Hello Francesco, thank you for filing the bug.
Looks like you're right. It's possible that's configurable, or we may need to update babel. I'll check it out. Thanks.
Looks like even latest version of Babel doesn't know anything about hsb or dsb. Babel [0] gets its data from the CLDR (Unicode Common Locale Data Repository) [1]. If we know that hsb and/or dsb follow the number formatting rules of another locale we do have, we should be able to map it for bedrock and make it work.

[0] http://babel.pocoo.org/docs/
[1] http://cldr.unicode.org/
CLDR does have dsb/hsb, but it seems to be introduced in version 26.

Available
http://www.unicode.org/cldr/charts/26/by_type/numbers.number_formatting_patterns.html#53687a25c19b6481

Missing
http://www.unicode.org/cldr/charts/25/by_type/numbers.number_formatting_patterns.html#53687a25c19b6481

I think German should be the natural fallback for dsb/hsb. Michael, is that correct?
Flags: needinfo?(milupo)
Yes, you can use German as fallback here.
Flags: needinfo?(milupo)
Assignee: nobody → pmac
Whiteboard: [kb=1654682]
Babel seems to be using cldr 23.1, would it make sense to maybe make an upstream patch to have them use 26?
Commits pushed to master at https://github.com/mozilla/bedrock

https://github.com/mozilla/bedrock/commit/64c4f177580495fc1704e78e7f41fa2833ff6613
Fix bug 1130285: Treat hsb/dsb locales as de for number formatting.

https://github.com/mozilla/bedrock/commit/01db764178854a1e410d6c6bb55ad1b7002fab70
Merge pull request #2711 from pmclanahan/fix-dsb-hsb-number-formatting-1130285

Fix bug 1130285: Treat hsb/dsb locales as de for number formatting.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
(In reply to Pascal Chevrel:pascalc from comment #7)
> Babel seems to be using cldr 23.1, would it make sense to maybe make an
> upstream patch to have them use 26?

That would be a nice thing to do. We're fairly behind in our version of Babel anyway. There appear to be 2 new versions of Bable set to be released (1.4 and 2.0) [0]. Maybe one or both of them will have that lib updated.

[0] http://babel.pocoo.org/docs/changelog/
It works for www-dev.allizom.org/hsb resp. www-dev.allizom.org/dsb now but not for www.mozill.org/hsb bzw. www.mozilla.org/dsb
That's expected. Changes are pushed to production periodically, but not on Fridays. It should be available next week on mozilla.org
Thank you, Francesco, for the information.
Thank you, it works for mozilla.org as well.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: