-
Notifications
You must be signed in to change notification settings - Fork 454
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
Add support for formatting intervals #276
Comments
@xmo-odoo thanks for proposing this, we're happy to accept pull requests, probably no time to do this soon on our own. |
@sils1297 is there documentation for the current content of locale dat files (and/or the mapping between the CLDR and locale dat files) aside from the import script and localedata.py? I tried looking quickly if the interval formats were currently parsed/stored but that doesn't seem to be the case so it looks like this issue would require alterations to the CLDR import script, that correct? |
@xmo-odoo Yes, the import script does not process all the locale features described in CLDR. So, whenever we need to implement new functionality from the XML files, we change the import script first. The Therefore, if you would like to implement new functionality, the first step is always to modify the CLDR import script as desired in an independent commit. Then, change the affected module based on the changes to the |
Thanks @etanol After more spec-reading to see if I could implement it quickly, it looks like this requires way more work than I'd originally expected:
|
I'll take a look at this. :) |
For what it's worth, @xmo-odoo, it looks like closest-match resolution might not be needed for an MVP (though I'll look at implementing that too). The skeletons provided by CLDR 28 at present seem to be fairly homogeneous, aside from a couple outliers (at the bottom). # List of intervalFormat skeletons in use in CLDR 28; format skeleton/count.
[
('d', 755),
('h', 755),
('H', 755),
('Hm', 755),
('hm', 755),
('Hmv', 755),
('hmv', 755),
('hv', 755),
('Hv', 755),
('M', 755),
('Md', 755),
('MEd', 755),
('MMM', 755),
('MMMd', 755),
('MMMEd', 755),
('y', 755),
('yM', 755),
('yMd', 755),
('yMEd', 755),
('yMMM', 755),
('yMMMd', 755),
('yMMMEd', 755),
('yMMMM', 755),
('MMMM', 86),
('yMMMMEd', 49),
('MMMMEd', 41),
('yMMMMd', 41),
('MMMMd', 33),
('yMMMEEEEd', 5),
('yMMMMEEEEd', 2),
('MMMEEEEd', 2)
] |
The LDML has defined an
intervalFormats
for locale-aware interval formatting since UTS#35 revision 10. Since Babel has added support for formatting durations (timedeltas) it would be convenient to support intervals as well.The text was updated successfully, but these errors were encountered: