Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork81
Fix translation progress badge#318
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
9 commits Select commitHold shift + click to select a range
cd2b341
Merge pull request #1 from python/master
Dumeng7f439f0
Add issue template
Dumeng8530ab1
Add tx stat
Dumeng77a36b1
Update json output
Dumeng94ebe6a
Fix dir path
Dumengaf4aaaa
Update readme badge
Dumeng7b67886
Fix typo
Dumeng156beca
Add update time
Dumeng7c3ff3d
Merge branch 'master' into master
DumengFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
6 changes: 3 additions & 3 deletions.github/ISSUE_TEMPLATE/translation.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions.github/scripts/tx_stat.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import json | ||
import os | ||
import urllib.request | ||
from datetime import datetime | ||
key = os.environ.get('TX_TOKEN') | ||
project = os.environ.get('TX_PROJECT') | ||
url = "https://rest.api.transifex.com/resource_language_stats?filter[project]=o%3Apython-doc%3Ap%3A{}&filter[language]=l%3Azh_CN".format(project) | ||
headers = { | ||
"accept": "application/vnd.api+json", | ||
"authorization": "Bearer " + key | ||
} | ||
total = 0 | ||
translated = 0 | ||
while(url): | ||
request = urllib.request.Request(url=url,headers=headers) | ||
with urllib.request.urlopen(request) as response: | ||
data = json.loads(response.read().decode("utf-8")) | ||
url = data['links'].get('next') | ||
for resourse in data['data']: | ||
translated = translated + resourse['attributes']['translated_strings'] | ||
total = total + resourse['attributes']['total_strings'] | ||
p = '{:.2%}'.format(translated/total) | ||
print(json.dumps({ | ||
'translation':p, | ||
'updated_at':datetime.utcnow().isoformat(timespec='seconds') + 'Z', | ||
})) |
1 change: 1 addition & 0 deletions.github/workflows/python-310.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -12,5 +12,6 @@ jobs: | ||
uses: ./.github/workflows/sync.yml | ||
with: | ||
version: "3.10" | ||
tx_project: "python-310" | ||
secrets: inherit | ||
1 change: 1 addition & 0 deletions.github/workflows/python-311.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -12,5 +12,6 @@ jobs: | ||
uses: ./.github/workflows/sync.yml | ||
with: | ||
version: "3.11" | ||
tx_project: "python-311" | ||
secrets: inherit | ||
1 change: 1 addition & 0 deletions.github/workflows/python-312.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -12,4 +12,5 @@ jobs: | ||
uses: ./.github/workflows/sync.yml | ||
with: | ||
version: "3.12" | ||
tx_project: "python-newest" | ||
secrets: inherit |
1 change: 1 addition & 0 deletions.github/workflows/python-38.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -12,4 +12,5 @@ jobs: | ||
uses: ./.github/workflows/sync.yml | ||
with: | ||
version: "3.8" | ||
tx_project: "python-38" | ||
secrets: inherit |
1 change: 1 addition & 0 deletions.github/workflows/python-39.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -12,5 +12,6 @@ jobs: | ||
uses: ./.github/workflows/sync.yml | ||
with: | ||
version: "3.9" | ||
tx_project: "python-39" | ||
secrets: inherit | ||
8 changes: 8 additions & 0 deletions.github/workflows/sync.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletionsREADME.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.