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

Territory languages #315

Merged
merged 5 commits into from Jan 11, 2016

Conversation

Projects
None yet
6 participants
@akx
Member

akx commented Jan 3, 2016

This PR is a rebase of and supersedes #122 and #123.

@akx akx added this to the Babel 2.3/3.0 milestone Jan 3, 2016

@sils sils added the (2) in progress label Jan 3, 2016

@gitmate-bot gitmate-bot added the size/L label Jan 3, 2016

@codecov-io

This comment has been minimized.

codecov-io commented Jan 3, 2016

Current coverage is 88.34%

Merging #315 into master will increase coverage by +0.05% as of 6d21d4e

@@            master    #315   diff @@
======================================
  Files           22      23     +1
  Stmts         3597    3612    +15
  Branches         0       0       
  Methods          0       0       
======================================
+ Hit           3176    3191    +15
  Partial          0       0       
  Missed         421     421       

Review entire Coverage Diff as of 6d21d4e

Powered by Codecov. Updated on successful CI builds.

@akx akx force-pushed the akx:territory-languages branch from 0bb5afd to 4d0de3d Jan 4, 2016

@etanol

This comment has been minimized.

Contributor

etanol commented Jan 7, 2016

Even though the population percents may be informative, I have the feeling that it will become outdated very quickly. Therefore, unless we can keep up with the bi-yearly CLDR release schedule, we may be left behind again (like when we supported CLDR 23) and, then, such data will not be very useful.

On the other hand, the supported languages by territory will hopefully change in a less dramatic way.

One solution could be to add a big fat disclaimer note regarding the possible lack of accuracy for the population percent information.

@akx

This comment has been minimized.

Member

akx commented Jan 7, 2016

@etanol: I'll make an issue of adding that big fat disclaimer.

Disclaimer added in cbd98d4.

If you think this is good to merge otherwise, go ahead and do it :)

@akx akx force-pushed the akx:territory-languages branch 3 times, most recently from a91c6e0 to 70fa94c Jan 8, 2016

scripts: add territory-language import from CLDR
Available in the global data onder the 'territory_language' key.

@akx akx force-pushed the akx:territory-languages branch from 70fa94c to cbd98d4 Jan 8, 2016

for language, info in get_global("territory_languages").get(territory, {}).items():
if info["official_status"] in allowed_stati:
pairs.append((info["population_percent"], language))
pairs.sort(reverse=True)

This comment has been minimized.

@etanol

etanol Jan 9, 2016

Contributor

I would be inclined to write:

languages = get_global("territory_languages").get(territory, {})
pairs = [(info['population_percent'], language)
             for language, info in langs.iteritems()
                 if info['official_status'] in allowed_stati]
pairs.sort(reverse=True)

It should be a little faster and a bit more Pythonic to make more extensive use of comprehensions.

@akx akx force-pushed the akx:territory-languages branch from cbd98d4 to 935a0be Jan 11, 2016

@akx

This comment has been minimized.

Member

akx commented Jan 11, 2016

Switched to an admittedly more pythonic and more or less just as readable list comprehension as suggested by @etanol.

Since patch coverage is 100% and overall coverage is increasing, I'll just go ahead and merge this :)

akx added a commit that referenced this pull request Jan 11, 2016

@akx akx merged commit a4cd0e3 into python-babel:master Jan 11, 2016

6 of 7 checks passed

review/gitmate/manual This commit needs review.
Details
Scrutinizer 4 updated code elements
Details
codecov/patch 100.00% of diff hit (target 80.00%)
Details
codecov/project 88.34% (+0.05%) compared to 2e20745 at 88.29%
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
review/gitmate/commit All is well! :)
Details

@akx akx deleted the akx:territory-languages branch Jan 11, 2016

@pyup-bot pyup-bot referenced this pull request Jan 6, 2017

Merged

Update babel to 2.3.4 #13

@pyup-bot pyup-bot referenced this pull request Jan 31, 2017

Open

Update babel to 2.3.4 #28

@pyup-bot pyup-bot referenced this pull request Apr 11, 2017

Open

Initial Update #3

@pyup-bot pyup-bot referenced this pull request May 12, 2017

Closed

Initial Update #43

@pyup-bot pyup-bot referenced this pull request Jul 4, 2017

Merged

Initial Update #2

@pyup-bot pyup-bot referenced this pull request Nov 3, 2017

Closed

Update babel to 2.5.1 #424

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment