Skip to content

Commit

Permalink
Add total strings to tx_stats.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rffontenelle committed Sep 3, 2024
1 parent 38813b2 commit b428180
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
23 changes: 23 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,42 +21,61 @@ Maintained versions:
* - Version
- Sync status
- Translation progress
- Total strings
* - `3.13 <https://github.com/python/python-docs-pt-br/tree/3.13>`_
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-313/badge.svg
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-313
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.13%2Fstats.json&query=translation&label=pt_BR
:alt: Brazilian Portuguese translation status for Python 3.13
:target: https://app.transifex.com/python-doc/python-newest/
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Frffontenelle%2Fpython-docs-pt-br%2Fraw%2F3.13%2Fstats.json&query=total&label=3.13
:alt: Total strings for Python 3.13
:target: https://app.transifex.com/python-doc/python-newest/
* - `3.12 <https://github.com/python/python-docs-pt-br/tree/3.12>`_
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-312/badge.svg
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-312
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.12%2Fstats.json&query=translation&label=pt_BR
:alt: Brazilian Portuguese translation status for Python 3.12
:target: https://app.transifex.com/python-doc/python-312/
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Frffontenelle%2Fpython-docs-pt-br%2Fraw%2F3.12%2Fstats.json&query=total&label=3.12
:alt: Total strings for Python 3.12
:target: https://app.transifex.com/python-doc/python-312/
* - `3.11 <https://github.com/python/python-docs-pt-br/tree/3.11>`_
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-311/badge.svg
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-311
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.11%2Fstats.json&query=translation&label=pt_BR
:alt: Brazilian Portuguese translation status for Python 3.11
:target: https://app.transifex.com/python-doc/python-311/
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Frffontenelle%2Fpython-docs-pt-br%2Fraw%2F3.11%2Fstats.json&query=total&label=3.11
:alt: Total strings for Python 3.11
:target: https://app.transifex.com/python-doc/python-311/
* - `3.10 <https://github.com/python/python-docs-pt-br/tree/3.10>`_
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-310/badge.svg
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-310
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.10%2Fstats.json&query=translation&label=pt_BR
:alt: Brazilian Portuguese translation status for Python 3.10
:target: https://app.transifex.com/python-doc/python-310/
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Frffontenelle%2Fpython-docs-pt-br%2Fraw%2F3.10%2Fstats.json&query=total&label=3.10
:alt: Total strings for Python 3.10
:target: https://app.transifex.com/python-doc/python-310/
* - `3.9 <https://github.com/python/python-docs-pt-br/tree/3.9>`_
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-39/badge.svg
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-39
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.9%2Fstats.json&query=translation&label=pt_BR
:alt: Brazilian Portuguese translation status for Python 3.9
:target: https://app.transifex.com/python-doc/python-39/
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Frffontenelle%2Fpython-docs-pt-br%2Fraw%2F3.9%2Fstats.json&query=total&label=3.9
:alt: Total strings for Python 3.9
:target: https://app.transifex.com/python-doc/python-39/
* - `3.8 <https://github.com/python/python-docs-pt-br/tree/3.8>`_
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-38/badge.svg
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-38
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.8%2Fstats.json&query=translation&label=pt_BR
:alt: Brazilian Portuguese translation status for Python 3.8
:target: https://app.transifex.com/python-doc/python-38/
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Frffontenelle%2Fpython-docs-pt-br%2Fraw%2F3.8%2Fstats.json&query=total&label=3.8
:alt: Total strings for Python 3.8
:target: https://app.transifex.com/python-doc/python-38/

EOL versions:

Expand All @@ -66,12 +85,16 @@ EOL versions:
* - Version
- Sync status
- Translation progress
- Total strings
* - `3.7 <https://github.com/python/python-docs-pt-br/tree/3.7>`_
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-37/badge.svg
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-37
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.7%2Fstats.json&query=translation&label=pt_BR
:alt: Brazilian Portuguese translation status for Python 3.7
:target: https://app.transifex.com/python-doc/python-37/
- .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Frffontenelle%2Fpython-docs-pt-br%2Fraw%2F3.7%2Fstats.json&query=total&label=3.7
:alt: Total strings for Python 3.7
:target: https://app.transifex.com/python-doc/python-37/

Translation priorities
~~~~~~~~~~~~~~~~~~~~~~
Expand Down
3 changes: 2 additions & 1 deletion scripts/tx_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
url = data['links'].get('next')
for resourse in data['data']:
translated = translated + resourse['attributes']['translated_strings']
total = total + resourse['attributes']['total_strings']
total = total + resourse['attributes']['total_strings']

p = '{:.2%}'.format(translated/total)
print(json.dumps({
'translation':p,
'total':total,
'updated_at':datetime.now(timezone.utc).isoformat(timespec='seconds') + 'Z',
}))

0 comments on commit b428180

Please sign in to comment.