Skip to content

Commit b428180

Browse files
committed
Add total strings to tx_stats.py
1 parent 38813b2 commit b428180

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

README.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,42 +21,61 @@ Maintained versions:
2121
* - Version
2222
- Sync status
2323
- Translation progress
24+
- Total strings
2425
* - `3.13 <https://github.com/python/python-docs-pt-br/tree/3.13>`_
2526
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-313/badge.svg
2627
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-313
2728
- .. 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
2829
:alt: Brazilian Portuguese translation status for Python 3.13
2930
:target: https://app.transifex.com/python-doc/python-newest/
31+
- .. 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
32+
:alt: Total strings for Python 3.13
33+
:target: https://app.transifex.com/python-doc/python-newest/
3034
* - `3.12 <https://github.com/python/python-docs-pt-br/tree/3.12>`_
3135
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-312/badge.svg
3236
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-312
3337
- .. 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
3438
:alt: Brazilian Portuguese translation status for Python 3.12
3539
:target: https://app.transifex.com/python-doc/python-312/
40+
- .. 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
41+
:alt: Total strings for Python 3.12
42+
:target: https://app.transifex.com/python-doc/python-312/
3643
* - `3.11 <https://github.com/python/python-docs-pt-br/tree/3.11>`_
3744
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-311/badge.svg
3845
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-311
3946
- .. 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
4047
:alt: Brazilian Portuguese translation status for Python 3.11
4148
:target: https://app.transifex.com/python-doc/python-311/
49+
- .. 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
50+
:alt: Total strings for Python 3.11
51+
:target: https://app.transifex.com/python-doc/python-311/
4252
* - `3.10 <https://github.com/python/python-docs-pt-br/tree/3.10>`_
4353
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-310/badge.svg
4454
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-310
4555
- .. 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
4656
:alt: Brazilian Portuguese translation status for Python 3.10
4757
:target: https://app.transifex.com/python-doc/python-310/
58+
- .. 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
59+
:alt: Total strings for Python 3.10
60+
:target: https://app.transifex.com/python-doc/python-310/
4861
* - `3.9 <https://github.com/python/python-docs-pt-br/tree/3.9>`_
4962
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-39/badge.svg
5063
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-39
5164
- .. 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
5265
:alt: Brazilian Portuguese translation status for Python 3.9
5366
:target: https://app.transifex.com/python-doc/python-39/
67+
- .. 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
68+
:alt: Total strings for Python 3.9
69+
:target: https://app.transifex.com/python-doc/python-39/
5470
* - `3.8 <https://github.com/python/python-docs-pt-br/tree/3.8>`_
5571
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-38/badge.svg
5672
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-38
5773
- .. 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
5874
:alt: Brazilian Portuguese translation status for Python 3.8
5975
:target: https://app.transifex.com/python-doc/python-38/
76+
- .. 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
77+
:alt: Total strings for Python 3.8
78+
:target: https://app.transifex.com/python-doc/python-38/
6079

6180
EOL versions:
6281

@@ -66,12 +85,16 @@ EOL versions:
6685
* - Version
6786
- Sync status
6887
- Translation progress
88+
- Total strings
6989
* - `3.7 <https://github.com/python/python-docs-pt-br/tree/3.7>`_
7090
- .. image:: https://github.com/python/python-docs-pt-br/workflows/python-37/badge.svg
7191
:target: https://github.com/python/python-docs-pt-br/actions?workflow=python-37
7292
- .. 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
7393
:alt: Brazilian Portuguese translation status for Python 3.7
7494
:target: https://app.transifex.com/python-doc/python-37/
95+
- .. 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
96+
:alt: Total strings for Python 3.7
97+
:target: https://app.transifex.com/python-doc/python-37/
7598

7699
Translation priorities
77100
~~~~~~~~~~~~~~~~~~~~~~

scripts/tx_stats.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
url = data['links'].get('next')
2828
for resourse in data['data']:
2929
translated = translated + resourse['attributes']['translated_strings']
30-
total = total + resourse['attributes']['total_strings']
30+
total = total + resourse['attributes']['total_strings']
3131

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

0 commit comments

Comments
 (0)