|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +Guidance for coding agents (Claude Code, Codex, Copilot, Cursor, and others) |
| 4 | +working in this repository. |
| 5 | +The human-facing guide is [README.md](README.md), written in Turkish. |
| 6 | +When the two disagree, the README wins. |
| 7 | + |
| 8 | +## What this repository is |
| 9 | + |
| 10 | +The Turkish translation of the Python documentation. |
| 11 | +Each `.po` file mirrors one `.rst` file under `Doc/` in |
| 12 | +[python/cpython](https://github.com/python/cpython), |
| 13 | +at the path and branch named in the `Makefile` |
| 14 | +(`BRANCH` and `CPYTHON_CURRENT_COMMIT`). |
| 15 | + |
| 16 | +- The default branch is `3.15`. Open pull requests against it. |
| 17 | +- `msgid` is the English source. Only `msgstr` is translated. |
| 18 | +- Never edit a `msgid`, the file header, or the `#:` location comments by hand. |
| 19 | + `merge.py` regenerates them from CPython once a month (`.github/workflows/update_doc.yml`). |
| 20 | + |
| 21 | +## Contribution rules |
| 22 | + |
| 23 | +- **At most 3 open pull requests per author at a time.** |
| 24 | + `.github/workflows/pr_limit.yml` labels and comments on PRs over the limit. |
| 25 | + Finish or close one before you open another. |
| 26 | +- Work on one `.po` file per branch and pull request, as the README's steps do. |
| 27 | +- Reserve a file before translating it, |
| 28 | + with the "Rezervasyon" issue template (`.github/ISSUE_TEMPLATE/file_reservation.md`). |
| 29 | + Do not translate a file someone else has reserved. |
| 30 | +- Entries flagged `#, fuzzy` are not used in the build. |
| 31 | + Remove the flag only after you have checked and updated the translation. |
| 32 | + |
| 33 | +## Translation rules |
| 34 | + |
| 35 | +- Keep role and link targets in English, or the Sphinx build fails |
| 36 | + (`i18n.inconsistent_references`). |
| 37 | + - Roles: translate only the shown text, |
| 38 | + e.g. `` :term:`dosya nesnesi <file object>` ``. |
| 39 | + A bare `` :func:`len` `` stays as it is. |
| 40 | + - Named links: leave `` `Documentation bugs`_ `` untouched. |
| 41 | +- Keep reST markup, code samples, literals (` ``...`` `), and placeholders |
| 42 | + (`%s`, `{name}`) exactly as in the `msgid`. |
| 43 | +- Use the term already used elsewhere in the repository. |
| 44 | + For example `string` is `dize`, not `metin`. |
| 45 | + Search existing `msgstr` entries with `rg` before choosing a term. |
| 46 | +- Write correct Turkish spelling, checked against the |
| 47 | + [TDK dictionary](https://sozluk.gov.tr/). |
| 48 | + |
| 49 | +## Commands |
| 50 | + |
| 51 | +Set up: |
| 52 | + |
| 53 | +```sh |
| 54 | +python -m pip install --upgrade -r requirements-dev.txt |
| 55 | +pre-commit install |
| 56 | +``` |
| 57 | + |
| 58 | +Before committing a `.po` file: |
| 59 | + |
| 60 | +```sh |
| 61 | +powrap path/to/file.po # rewrap to the project's line width |
| 62 | +pre-commit run --files path/to/file.po |
| 63 | +``` |
| 64 | + |
| 65 | +Build the HTML docs locally (clones CPython into `venv/cpython`): |
| 66 | + |
| 67 | +```sh |
| 68 | +make |
| 69 | +``` |
| 70 | + |
| 71 | +Other `Makefile` targets: `make todo` (progress), `make fuzzy`, `make verifs`. |
| 72 | + |
| 73 | +## Layout |
| 74 | + |
| 75 | +- `*.po`, `<section>/*.po`: translations, laid out like CPython's `Doc/`. |
| 76 | +- `merge.py`: pulls new strings from CPython into the `.po` files. |
| 77 | +- `scripts/`: helper scripts (`format_check.py`, `progress.py`, `translate.py`). |
| 78 | +- `.github/workflows/`: CI, monthly CPython sync, rewrap, and the PR limit check. |
| 79 | +- `TRANSLATORS`: contributor credits. |
0 commit comments