babel icon indicating copy to clipboard operation
babel copied to clipboard

Validate Locale parameter formats while constructing

Open akx opened this issue 9 years ago • 4 comments
trafficstars

This avoids being able to construct mongrel locales with language = 'en_US', territory = None.

Fixes #283

:warning: Warning :warning:

This might actually be a fairly disruptive change to the users of the library who have come to expect they can build locales with Locale("en_US").

akx avatar Dec 30 '15 17:12 akx

Current coverage is 89.49%

Merging #309 into master will increase coverage by +0.09% as of 51fd1f3

@@            master    #309   diff @@
======================================
  Files           23      23       
  Stmts         3736    3752    +16
  Branches         0       0       
  Methods          0       0       
======================================
+ Hit           3340    3358    +18
  Partial          0       0       
+ Missed         396     394     -2

Review entire Coverage Diff as of 51fd1f3

Powered by Codecov. Updated on successful CI builds.

codecov-io avatar Dec 30 '15 17:12 codecov-io

Come to think of it, this paves the way nicely for https://github.com/python-babel/babel/issues/30; we can now derive a FuzzyLocale class or similar that doesn't validate as strictly. :)

akx avatar Jan 11 '16 10:01 akx

akx: Come to think of it, this paves the way nicely for #30; we can now derive a FuzzyLocale class or similar > that doesn't validate as strictly. :)

Is there some kind of roadmap as to when fuzzy locales will be implemented? I have a requirement that needs the ability to define custom/fuzzy locales, so it would be great to know when I can implement this.

danjamesmay avatar Jan 14 '16 10:01 danjamesmay

Moved this out of the next point release due to the warning above.

akx avatar Feb 03 '16 21:02 akx