diff --git a/README.en.md b/README.en.md index 709faac6b1..80be79893b 100644 --- a/README.en.md +++ b/README.en.md @@ -4,12 +4,13 @@ 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() -total = progress_from_resources(stats) +total_words, total_strings = progress_from_resources(stats) translators = get_number_of_translators() print( f'''[](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml) - +[](https://python-docs-translations.github.io/dashboard/) +[](https://python-docs-translations.github.io/dashboard/) ''') ]]] --> [](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml) diff --git a/README.md b/README.md index 0d8c09991d..4653311d88 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,13 @@ Polskie tłumaczenie dokumentacji Pythona from manage_translation import get_resource_language_stats, progress_from_resources, get_number_of_translators stats = get_resource_language_stats() -total = progress_from_resources(stats) +total_words, total_strings = progress_from_resources(stats) translators = get_number_of_translators() print( f'''[](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml) - +[](https://python-docs-translations.github.io/dashboard/) +[](https://python-docs-translations.github.io/dashboard/) ''') ]]] --> [](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml) diff --git a/manage_translation.py b/manage_translation.py index 7d53b2f233..e8a042a6a3 100755 --- a/manage_translation.py +++ b/manage_translation.py @@ -29,6 +29,8 @@ from transifex.api import transifex_api LANGUAGE = 'pl' +PROJECT_SLUG = 'python-newest' +VERSION = '3.14' def fetch(): @@ -49,10 +51,6 @@ def _call(command: str): exit(return_code) -PROJECT_SLUG = 'python-newest' -VERSION = '3.14' - - def recreate_tx_config(): """ Regenerate Transifex client config for all resources. @@ -151,10 +149,12 @@ def get_resource_language_stats() -> list[ResourceLanguageStatistics]: return [ResourceLanguageStatistics.from_api_entry(entry) for entry in resources] -def progress_from_resources(resources: Iterable[ResourceLanguageStatistics]) -> float: - pairs = ((e.translated_words, e.total_words) for e in resources) - translated_total, total_total = (sum(counts) for counts in zip(*pairs)) - return translated_total / total_total * 100 +def progress_from_resources(resources: Iterable[ResourceLanguageStatistics]) -> tuple[float, float]: + word_pairs = ((e.translated_words, e.total_words) for e in resources) + string_pairs = ((e.translated_strings, e.total_strings) for e in resources) + translated_total_words, total_words = (sum(counts) for counts in zip(*word_pairs)) + translated_total_strs, total_strs = (sum(counts) for counts in zip(*string_pairs)) + return translated_total_words / total_words * 100, translated_total_strs / total_strs * 100 def get_number_of_translators():
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: