Ordinal endings

Mark Davis ☕️ mark at macchiato.com
Sun Feb 28 14:16:38 CST 2016

The primary function of the ordinal categories is to be used as "switch"
selectors in messages, where the UI supplies the whole message with the
ending (as you mention) that is appropriate for the . CLDR doesn't supply
text for "1st", "2nd", etc for languages precisely for the reason you
mention; the inflections vary by the rest of the sentence.

There are RBNF ordinal rules for some languages, but the RBNF rules are not
complete for all languages; and for some languages that have them, they are
not complete for all of the inflected forms.


On Sun, Feb 28, 2016 at 2:17 AM, Felipe Gasper <felipe at felipegasper.com>

> Hello,
>         I’m wanting to make a function that takes in an integer and a
> locale tag and spits out the ordinal form of that integer in the given
> locale. For example:
> to_ordinal( 5, 'en' ) => '5th',
> to_ordinal( 1, 'fr' ) => '1er',
>         I know this is tricky because in many cases (e.g., the second
> example that I posted!) the ordinal form will depend on more context--for
> example, in French it could be (something like) “1er” or “1ère”.
>         Only English seems to have the actual text of the ordinal endings
> in CLDR … is that because there are but few languages whose ordinal forms
> are simple enough to require no additional context?
>         Thank you!
> -Felipe Gasper
> Houston, TX
> _______________________________________________
> CLDR-Users mailing list
> CLDR-Users at unicode.org
> http://unicode.org/mailman/listinfo/cldr-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://unicode.org/pipermail/cldr-users/attachments/20160228/637af8c4/attachment.html>

More information about the CLDR-Users mailing list