# python/python-docs-pl architecture

> Architecture diagram of the GitHub repository python/python-docs-pl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/python/python-docs-pl
- Repository: https://github.com/python/python-docs-pl

## Overview

#### Purpose and Scope
This repository is the Polish localization source for Python documentation. Its primary artifacts are gettext `.po` catalogs, organized to mirror the upstream Python documentation structure. It is not an application or documentation authoring source tree; localized strings are synchronized with Transifex and built by external automation.

#### Entry Points and Operations
`manage_translation.py` is the repository’s operational entry point. Contributors use it to regenerate Transifex resource configuration and fetch translated catalogs. README translation-progress badges are generated through code embedded in `README.md`, using functions from this script.
- `manage_translation.py`
- `README.md`
- `.tx/config`

#### Translation Catalog Domain Model
Each `.po` file is an independent gettext resource representing one documentation page/chapter. Catalogs retain source strings, translated Polish strings, and translation metadata; their directory hierarchy is the key integration contract with upstream Python docs and Transifex.
- `tutorial/index.po`
- `library/asyncio.po`
- `c-api/object.po`

#### Documentation Area Partitioning
Top-level directories partition catalogs by the Python documentation information architecture: language/tutorial material, standard-library APIs, language reference, C API, extension authoring, user guides, FAQs, and release notes. This makes parallel translation work possible while preserving stable upstream resource identities.
- `library/index.po`
- `reference/index.po`
- `whatsnew/index.po`

#### Synchronization Boundary: Transifex
Transifex is the authoritative collaborative translation service. The local configuration under `.tx/` maps repository catalogs to remote resources; `manage_translation.py fetch` imports current translations. Contributors normally edit through Transifex rather than treating local `.po` files as an application datastore.
- `.tx/config`
- `manage_translation.py`
- `README.en.md`

#### Build, Publishing, and Quality Control
GitHub Actions provide the delivery pipeline: translation updates are fetched and documentation is built approximately every 30 minutes; artifacts can be downloaded from Actions, while the public Polish docs are published externally on a daily cadence. A separate lint workflow validates translation/build quality, with status exposed through `translations.python.org`.
- `.github/workflows/update-and-build.yml`
- `.github/workflows/lint.yml`
- `.github/workflows/pre-commit.yml`

#### External Runtime and Infrastructure
Operational scripts run in a Python environment, with project metadata/dependencies declared in `pyproject.toml`. External dependencies are GitHub Actions, Transifex, the Python documentation translation/build infrastructure, and the published site at `docs.python.org/pl/`. Repository automation also uses Cog to render dynamic README statistics.
- `pyproject.toml`
- `manage_translation.py`
- `.github/workflows/update-and-build.yml`

Main entry points: [`manage_translation.py`](https://github.com/python/python-docs-pl/blob/3.15/manage_translation.py) (Translation manager), [`.github/workflows/update-and-build.yml`](https://github.com/python/python-docs-pl/blob/3.15/.github/workflows/update-and-build.yml) (Update and build), [`.tx/config`](https://github.com/python/python-docs-pl/blob/3.15/.tx/config) (Transifex mapping), [`library/index.po`](https://github.com/python/python-docs-pl/blob/3.15/library/index.po) (Library catalogs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_repo["Repository"]
  node_manage{{"Translation manager<br/>Python CLI"}}
  node_readme["Contributor README<br/>documentation<br/>[README.md]"]
  node_readme_en["English README<br/>documentation<br/>[README.en.md]"]
  node_pyproject["Python project metadata<br/>[pyproject.toml]"]
  node_tx_config["Transifex mapping<br/>resource configuration<br/>[config]"]
end

subgraph group_catalogs["Translation catalogs"]
  node_tutorial["Tutorial catalogs<br/>gettext catalogs<br/>[index.po]"]
  node_library["Library catalogs<br/>gettext catalogs<br/>[index.po]"]
  node_asyncio["Asyncio catalog<br/>gettext catalog<br/>[asyncio.po]"]
  node_reference["Reference catalogs<br/>gettext catalogs<br/>[index.po]"]
  node_c_api["C API catalog<br/>gettext catalog<br/>[object.po]"]
  node_whatsnew["Release-note catalogs<br/>gettext catalogs<br/>[index.po]"]
end

subgraph group_automation["Automation"]
  node_update_build["Update and build<br/>GitHub Actions workflow"]
  node_lint["Translation lint<br/>GitHub Actions workflow<br/>[lint.yml]"]
  node_precommit["Pre-commit checks<br/>GitHub Actions workflow<br/>[pre-commit.yml]"]
end

subgraph group_external["External services"]
  node_transifex[("Transifex<br/>translation service")]
  node_docs_build["Python docs build infrastructure<br/>external build service"]
  node_published_docs["Polish documentation site<br/>published site"]
end

node_readme -.->|"renders badge statistics"| node_manage
node_pyproject -->|"provides runtime"| node_manage
node_manage -->|"regenerates"| node_tx_config
node_tx_config -->|"maps resources"| node_transifex
node_transifex -->|"translations fetched by"| node_manage
node_manage -->|"updates catalogs"| node_tutorial
node_manage -->|"updates catalogs"| node_library
node_manage -->|"updates catalogs"| node_reference
node_manage -->|"updates catalog"| node_c_api
node_manage -->|"updates catalogs"| node_whatsnew
node_library -->|"contains resource"| node_asyncio
node_update_build -->|"runs fetch"| node_manage
node_update_build -->|"triggers build"| node_docs_build
node_docs_build -->|"publishes daily"| node_published_docs
node_lint -->|"validates build quality"| node_docs_build
node_precommit -.->|"complements checks"| node_lint
node_readme_en -.->|"documents collaboration boundary"| node_transifex

click node_manage "https://github.com/python/python-docs-pl/blob/3.15/manage_translation.py"
click node_readme "https://github.com/python/python-docs-pl/blob/3.15/README.md"
click node_readme_en "https://github.com/python/python-docs-pl/blob/3.15/README.en.md"
click node_pyproject "https://github.com/python/python-docs-pl/blob/3.15/pyproject.toml"
click node_tx_config "https://github.com/python/python-docs-pl/blob/3.15/.tx/config"
click node_tutorial "https://github.com/python/python-docs-pl/blob/3.15/tutorial/index.po"
click node_library "https://github.com/python/python-docs-pl/blob/3.15/library/index.po"
click node_asyncio "https://github.com/python/python-docs-pl/blob/3.15/library/asyncio.po"
click node_reference "https://github.com/python/python-docs-pl/blob/3.15/reference/index.po"
click node_c_api "https://github.com/python/python-docs-pl/blob/3.15/c-api/object.po"
click node_whatsnew "https://github.com/python/python-docs-pl/blob/3.15/whatsnew/index.po"
click node_update_build "https://github.com/python/python-docs-pl/blob/3.15/.github/workflows/update-and-build.yml"
click node_lint "https://github.com/python/python-docs-pl/blob/3.15/.github/workflows/lint.yml"
click node_precommit "https://github.com/python/python-docs-pl/blob/3.15/.github/workflows/pre-commit.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manage,node_readme,node_readme_en,node_pyproject,node_tx_config toneBlue
class node_tutorial,node_library,node_asyncio,node_reference,node_c_api,node_whatsnew toneAmber
class node_update_build,node_lint,node_precommit toneMint
class node_transifex,node_docs_build,node_published_docs toneRose
```

## Components

### Repository

- [Translation manager](https://github.com/python/python-docs-pl/blob/3.15/manage_translation.py): Python CLI · Regenerates Transifex configuration and fetches translations. · `manage_translation.py`
- [Contributor README](https://github.com/python/python-docs-pl/blob/3.15/README.md): documentation · Contains generated translation-progress badges. · `README.md`
- [English README](https://github.com/python/python-docs-pl/blob/3.15/README.en.md): documentation · `README.en.md`
- [Python project metadata](https://github.com/python/python-docs-pl/blob/3.15/pyproject.toml): project metadata · Declares the script runtime and dependencies. · `pyproject.toml`
- [Transifex mapping](https://github.com/python/python-docs-pl/blob/3.15/.tx/config): resource configuration · Maps local catalog paths to remote translation resources. · `.tx/config`

### Translation catalogs

Gettext resources mirror the upstream Python documentation tree.

- [Tutorial catalogs](https://github.com/python/python-docs-pl/blob/3.15/tutorial/index.po): gettext catalogs · Language and tutorial documentation resources. · `tutorial/index.po`
- [Library catalogs](https://github.com/python/python-docs-pl/blob/3.15/library/index.po): gettext catalogs · Standard-library API documentation resources. · `library/index.po`
- [Asyncio catalog](https://github.com/python/python-docs-pl/blob/3.15/library/asyncio.po): gettext catalog · One independently synchronized documentation resource. · `library/asyncio.po`
- [Reference catalogs](https://github.com/python/python-docs-pl/blob/3.15/reference/index.po): gettext catalogs · Language-reference documentation resources. · `reference/index.po`
- [C API catalog](https://github.com/python/python-docs-pl/blob/3.15/c-api/object.po): gettext catalog · C API documentation resource. · `c-api/object.po`
- [Release-note catalogs](https://github.com/python/python-docs-pl/blob/3.15/whatsnew/index.po): gettext catalogs · What's New documentation resources. · `whatsnew/index.po`

### Automation

- [Update and build](https://github.com/python/python-docs-pl/blob/3.15/.github/workflows/update-and-build.yml): GitHub Actions workflow · Fetches translations and builds documentation on a recurring schedule. · `.github/workflows/update-and-build.yml`
- [Translation lint](https://github.com/python/python-docs-pl/blob/3.15/.github/workflows/lint.yml): GitHub Actions workflow · Validates translation and build quality. · `.github/workflows/lint.yml`
- [Pre-commit checks](https://github.com/python/python-docs-pl/blob/3.15/.github/workflows/pre-commit.yml): GitHub Actions workflow · `.github/workflows/pre-commit.yml`

### External services

- **Transifex**: translation service · Authoritative collaborative translation service.
- **Python docs build infrastructure**: external build service · Builds localized documentation artifacts.
- **Polish documentation site**: published site · Externally published Polish Python documentation.

## Connections

- Contributor README → Translation manager: renders badge statistics
- Python project metadata → Translation manager: provides runtime
- Translation manager → Transifex mapping: regenerates
- Transifex mapping → Transifex: maps resources
- Transifex → Translation manager: translations fetched by
- Translation manager → Tutorial catalogs: updates catalogs
- Translation manager → Library catalogs: updates catalogs
- Translation manager → Reference catalogs: updates catalogs
- Translation manager → C API catalog: updates catalog
- Translation manager → Release-note catalogs: updates catalogs
- Library catalogs → Asyncio catalog: contains resource
- Update and build → Translation manager: runs fetch
- Update and build → Python docs build infrastructure: triggers build
- Python docs build infrastructure → Polish documentation site: publishes daily
- Translation lint → Python docs build infrastructure: validates build quality
- Pre-commit checks → Translation lint: complements checks
- English README → Transifex: documents collaboration boundary
