diff --git a/scripts/create_issue.py b/scripts/create_issue.py index e5e452acc7..539f87dca0 100644 --- a/scripts/create_issue.py +++ b/scripts/create_issue.py @@ -1,16 +1,16 @@ import os import sys +from pathlib import Path -import polib from github import Github - +from potodo._po_file import PoFileStats if len(sys.argv) != 2: print('Specify PO filename') sys.exit(1) pofilename = sys.argv[1] -percentage = polib.pofile(pofilename).percent_translated() +pofile = PoFileStats(Path(pofilename)) g = Github(os.environ.get('GITHUB_TOKEN')) @@ -18,10 +18,17 @@ # https://pygithub.readthedocs.io/en/latest/github_objects/Repository.html#github.Repository.Repository.create_issue issue = repo.create_issue( title=f'Translate `{pofilename}`', - body=f'''This file is at {percentage}% translated. It needs to reach 100% translated. + body=f'''This needs to reach 100% translated. + +Current stats for `{pofilename}`: + +- Fuzzy: {pofile.fuzzy_nb} +- Percent translated: {pofile.percent_translated}% +- Entries: {pofile.translated_nb} / {pofile.po_file_size} +- Untranslated: {pofile.untranslated_nb} Please, comment here if you want this file to be assigned to you and an member will assign it to you as soon as possible, so you can start working on it. -Remember to follow the steps in our [Contributing Guide](https://python-docs-es.readthedocs.io/page/CONTRIBUTING.html)''', +Remember to follow the steps in our [Contributing Guide](https://python-docs-es.readthedocs.io/page/CONTRIBUTING.html).''', ) print(f'Issue created at {issue.html_url}')