babel
babel copied to clipboard
Format ordinal numbers
Often one wants to generate a list of things with ordinals in front of them. E.g. "1st place: Foo, 2nd place: Bar" or "1st choice: Hello, 2nd choice: World". The way these ordinals are represented differs between languages. In e.g. german this would commonly be written as "1. place: Foo, 2. place: Bar".
PyBabel should support these use cases with a respective formatter. Rules how this works can probably be taken from the ICU library.
Ordinal numbers are usable in some locales even for dates, e.g. "18th September, 2022", which would be very nice (using Pattern Syntax).