Skip to content

Commit

Permalink
Clean up switcher progress tracking (#48)
Browse files Browse the repository at this point in the history
* Clean up Language Switcher Progress

* Update update-lint-and-build.yml

---------

Co-authored-by: Maciej Olko <maciej.olko@gmail.com>
  • Loading branch information
StanFromIreland and m-aciek authored Dec 29, 2024
1 parent 5e4b11d commit 87dbfb9
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 1,674 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/update-chart.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/update-lint-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,9 @@ jobs:
# Check for changes in README.md
- run: >
! git diff -I'^"POT-Creation-Date: ' -I'^"Language-Team: ' -I'^# Copyright (C) 2001-' --exit-code && echo "SIGNIFICANT_CHANGES=1" >> $GITHUB_ENV || exit 0
- run: >
! git diff -G'\!\[[0-9]{2,3}\.[0-9]{2}% przełącznika języków\]' --exit-code README.md && echo "SWITCHER_PROGRESS=1" >> $GITHUB_ENV || exit 0
- run: git add .
- run: git commit -m 'Update translation from Transifex'
if: env.SIGNIFICANT_CHANGES
- run: pip install gitpython matplotlib
if: env.SWITCHER_PROGRESS
- run: python update_switcher_chart.py
if: env.SWITCHER_PROGRESS
- run: git add .
if: env.SWITCHER_PROGRESS
- run: git commit -m 'Update switcher progress chart'
if: env.SWITCHER_PROGRESS
- uses: ad-m/github-push-action@master
if: env.SIGNIFICANT_CHANGES
with:
branch: ${{ matrix.version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: peter-evans/repository-dispatch@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
15 changes: 1 addition & 14 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ Polish Translation of Python Documentation
from manage_translation import get_resource_language_stats, progress_from_resources, language_switcher, get_number_of_translators
stats = get_resource_language_stats()
switcher = progress_from_resources(filter(language_switcher, stats))
total = progress_from_resources(stats)
translators = get_number_of_translators()
print(
f'''![build](https://github.com/python/python-docs-pl/workflows/.github/workflows/update-lint-and-build.yml/badge.svg)
![{switcher:.2f}% Language Switcher](https://img.shields.io/badge/language_switcher-{switcher:.2f}%25-0.svg)
![Total Translation of Documentation](https://img.shields.io/badge/Total-{total:.2f}%25-0.svg)
![{translators} Translators](https://img.shields.io/badge/Translators-{translators}-0.svg)''')
]]] -->
![build](https://github.com/python/python-docs-pl/workflows/.github/workflows/update-lint-and-build.yml/badge.svg)
![100.00% Language Switcher](https://img.shields.io/badge/language_switcher-100.00%25-0.svg)
![Total Translation of Documentation](https://img.shields.io/badge/Total-4.41%25-0.svg)
![24 Translators](https://img.shields.io/badge/Translators-24-0.svg)
<!-- [[[end]]] -->
Expand All @@ -32,17 +29,7 @@ If you find a mistake or have a suggestion,
* After joining the Project, pick the category you want to fix/translate.

You can find more information about using Transifex
[in their help guide.](https://help.transifex.com/en/articles/6318216-translating-with-the-web-editor).

**Translation Progress**

![translation progress till Polish is added to the language switcher](language-switcher-progress.svg)

The Polish language will appear in the language switcher in docs.python.org,
[when these categories will be fully translated](https://www.python.org/dev/peps/pep-0545/#add-translation-to-the-language-switcher):
* `bugs`,
* Everything in the `tutorial` section,
* `library/functions`.
[in their help guide.](https://help.transifex.com/en/articles/6318216-translating-with-the-web-editor)

**How to see the newest build of the documentation?**

Expand Down
19 changes: 2 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
Polskie tłumaczenie dokumentacji Pythona
========================================
<!-- [[[cog
from manage_translation import get_resource_language_stats, progress_from_resources, language_switcher, get_number_of_translators
from manage_translation import get_resource_language_stats, progress_from_resources, get_number_of_translators
stats = get_resource_language_stats()
switcher = progress_from_resources(filter(language_switcher, stats))
total = progress_from_resources(stats)
translators = get_number_of_translators()
print(
f'''![build](https://github.com/python/python-docs-pl/workflows/.github/workflows/update-lint-and-build.yml/badge.svg)
![{switcher:.2f}% przełącznika języków](https://img.shields.io/badge/przełącznik_języków-{switcher:.2f}%25-0.svg)
![postęp tłumaczenia całości dokumentacji](https://img.shields.io/badge/całość-{total:.2f}%25-0.svg)
![{translators} tłumaczy](https://img.shields.io/badge/tłumaczy-{translators}-0.svg)''')
]]] -->
![build](https://github.com/python/python-docs-pl/workflows/.github/workflows/update-lint-and-build.yml/badge.svg)
![100.00% przełącznika języków](https://img.shields.io/badge/przełącznik_języków-100.00%25-0.svg)
![postęp tłumaczenia całości dokumentacji](https://img.shields.io/badge/całość-4.41%25-0.svg)
![24 tłumaczy](https://img.shields.io/badge/tłumaczy-24-0.svg)
<!-- [[[end]]] -->
Expand All @@ -31,23 +28,11 @@ projektu [dokumentacji Pythona](https://explore.transifex.com/python-doc/python-
* Naciśnij przycisk „Join this project”, aby dołączyć do projektu.
* Utwórz konto Transifex.
* Na stronie projektu wybierz język polski.
* Po dołączeniu do zespołu, wybierz zasób, który chcesz poprawić/zaktualizować.
* Po dołączeniu do zespołu wybierz zasób, który chcesz poprawić/zaktualizować.

Więcej informacji o używaniu Transifeksa znajdziesz w
[jego artykułach pomocy](https://help.transifex.com/en/articles/6318216-translating-with-the-web-editor).

**Postęp tłumaczenia**

![postęp tłumaczenia do przełącznika języków](language-switcher-progress.svg)

Język polski pojawi się w przełączniku języków na docs.python.org,
[kiedy w pełni przetłumaczone będą](https://www.python.org/dev/peps/pep-0545/#add-translation-to-the-language-switcher):
* `bugs`,
* wszystkie zasoby z katalogu `tutorial`,
* `library/functions`.

[Kliknij tutaj, aby zobaczyć co pozostało do przetłumaczenia.](https://github.com/python/python-docs-pl/issues/3)

**Jak obejrzeć najnowszy build dokumentacji?**

Pobierz ostatnią zbudowaną dokumentację z listy artefaktów w ostatniej GitHub Action (zakładka Actions).
Expand Down
Loading

0 comments on commit 87dbfb9

Please sign in to comment.