Skip to content

Add an ordinal_form property to Locale #270

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

Merged
merged 1 commit into from
Dec 20, 2015

Conversation

mbirtwell
Copy link
Contributor

This exposes the rules for selecting ordinal forms in a similar way to the rules for selecting plural forms. In general a languages plural forms and ordinal forms might not be related.

I was hoping to provide a format_ordinal function to do conversions like 1->1st, 2->2nd, 11->11th, 23->23rd etc. unfortunately the CLDR doesn't have any convenient data for this. It does have some in the rbnf data but the language coverage at least in CLDR 26 seems patchy and pretty hard to interpret.

But I think this is useful on it's own because it provides access to the ordinal rules so that you could construct a simplified solution to a reduced problem based on these rules. Indeed that is what I'm doing for the small set of locales that I need to support.

@codecov-io
Copy link

Current coverage is 83.53%

Merging #270 into master will increase coverage by +0.01% as of 0db1ac4

@@            master    #270   diff @@
======================================
  Files           22      22       
  Stmts         3812    3814     +2
  Branches         0       0       
  Methods          0       0       
======================================
+ Hit           3184    3186     +2
  Partial          0       0       
  Missed         628     628       

Review entire Coverage Diff as of 0db1ac4

Powered by Codecov. Updated on successful CI builds.

@sils
Copy link
Member

sils commented Oct 16, 2015

@mbirtwell apparently we have conflicts here and I'm afraid this needs a rebase

@akx
Copy link
Member

akx commented Dec 20, 2015

Looks good to me.

As an aside, it would be nice to have some sort of table listing the CLDR features Babel currently supports (and probably a list of those it doesn't, too).

@sils
Copy link
Member

sils commented Dec 20, 2015

I've filed #291 for the listing.

sils added a commit that referenced this pull request Dec 20, 2015
Add an ordinal_form property to Locale
@sils sils merged commit cc02cd1 into python-babel:master Dec 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants