This guide defines translation conventions for the Punjabi (pa) translation of the Python documentation.
It complements README.md, CONTRIBUTING.md, and GLOSSARY.md by describing the writing style, terminology, formatting rules, and validation practices contributors should follow when translating Python documentation.
All contributors should follow these guidelines to ensure consistency, technical accuracy, and long-term maintainability across the project.
- Project Status
- General Principles
- Translation Philosophy
- Never Translate
- Variable Names
- PO File Rules
- Placeholder Preservation
- RST Markup Preservation
- Inline Markup Preservation
- Directives
- Code Blocks
- Interactive Python Sessions
- URLs
- Version Information
- Technical Terms
- Terminology Consistency
- Batch Translation Workflow
- Machine Translation Policy
- Translation Quality Checklist
- Validation Commands
- Repository-Wide Validation
- Transifex Synchronization
- Commit Message Conventions
- Contributor Expectations
- Tone and Writing Style
- Translation Review
- Final Rule
The Punjabi (pa) translation project is actively maintained as part of the official Python Documentation Translation initiative.
- ✅ Officially listed in the Python Developer Guide Translation Coordinators (PR #1843)
- ✅ Active translation branch:
3.15 - ✅ Automated synchronization with the official Python Documentation Transifex project
- ✅ GitHub Actions validation passing
- ✅ GNU gettext (
msgfmt) validation passing - ✅
sphinx-lintvalidation passing - ✅ CPython HTML documentation build passing
- ✅ Nitpicky (
-n) documentation build passing
| Area | Status |
|---|---|
| Tutorial Documentation (17/17 files) | ✅ Complete |
| Using Python Documentation (9/9 files) | ✅ Complete |
library/stdtypes.po |
✅ Complete |
library/functions.po |
✅ Complete |
library/exceptions.po |
✅ Complete |
library/functools.po |
✅ Complete |
library/string.po |
✅ Complete |
howto/regex.po |
✅ Complete |
howto/sorting.po |
✅ Complete |
glossary.po |
✅ Complete |
bugs.po |
✅ Complete |
| Metric | Value |
|---|---|
| Verified Translated Strings | 7,668 |
| Tutorial Files | 17 |
| Using Python Files | 9 |
| Completed Core Library Files | 5 |
| Completed HOWTO Files | 2 |
| Root Translation Files | 2 |
Contributors should review previously completed translations before introducing new terminology or translation patterns.
The following principles apply to every translation in this repository, regardless of the document or subject area.
- Translate meaning, not individual words.
- Use natural and clear Punjabi (Gurmukhi).
- Preserve technical accuracy.
- Prefer consistency over stylistic variation.
- Follow terminology defined in
GLOSSARY.md. - Reuse existing translations whenever possible.
- Match the tone of official Python documentation.
The goal is not literal translation.
The goal is to produce documentation that feels natural to Punjabi-speaking developers while remaining technically identical to the English original.
Good translation:
Clear
Accurate
Consistent
Natural
Poor translation:
Word-for-word
Ambiguous
Inconsistent
Artificial sounding
if
else
elif
for
while
class
def
return
import
from
try
except
finally
raise
pass
with
yield
lambda
and
or
not
global
nonlocal
async
await
match
case
print
len
range
list
dict
tuple
set
frozenset
bytes
bytearray
str
int
float
complex
bool
object
type
property
classmethod
staticmethod
Exception
ValueError
TypeError
KeyError
IndexError
ImportError
RuntimeError
AttributeError
StopIteration
os
sys
json
pathlib
re
typing
collections
itertools
asyncio
These identifiers must remain unchanged.
Never translate variable names.
Examples:
x
y
count
index
user_name
my_list
self
clsCorrect:
count = 5Incorrect:
ਗਿਣਤੀ = 5Never modify:
msgid
#: source references
#, flags
Translate only:
msgstr
Placeholders must remain exactly unchanged.
Examples:
%s
%d
%i
%r
%f
%s%.*f
{}
{0}
{name}
{value}
%(name)s
%(count)d
Correct:
"%s ਆਈਟਮ ਮਿਲੇ"
Incorrect:
"%d ਆਈਟਮ ਮਿਲੇ"
unless the original uses %d.
Never modify reStructuredText roles.
Examples:
:func:`print`
:class:`list`
:class:`dict`
:mod:`os`
:meth:`append`
:attr:`name`
:exc:`ValueError`
:term:`iterator`
:ref:`section`Translate only surrounding text.
Correct:
ਇਹ :func:`print` ਫੰਕਸ਼ਨ ਦੀ ਵਰਤੋਂ ਕਰਦਾ ਹੈ।Incorrect:
ਇਹ :func:`ਛਾਪੋ` ਫੰਕਸ਼ਨ ਦੀ ਵਰਤੋਂ ਕਰਦਾ ਹੈ।Keep inline markup unchanged.
Examples:
*italic*
**bold**
``code``Do not modify formatting syntax.
Never modify Sphinx directives.
Examples:
.. note::
.. warning::
.. important::
.. tip::
.. versionadded::
.. versionchanged::
.. deprecated::
.. code-block:: pythonTranslate the directive content only.
Translate:
- Comments
- Explanatory text
Do not translate:
- Python code
- Keywords
- Identifiers
- Module names
- Function names
- Class names
- Exception names
Example:
# Calculate the square of a number
x = 5
print(x * x)Only the comment may be translated.
Examples:
>>> x = 5
>>> print(x)
5Do not translate:
- Code
- Output
- Tracebacks
- Exception names
Translate only surrounding explanations.
Never translate URLs.
Examples:
https://docs.python.org/
https://devguide.python.org/
https://github.com/python/cpython
Never modify version numbers.
Examples:
Python 3.13
Python 3.14
Changed in version 3.12
Deprecated since version 3.11
Translate surrounding text only.
Some technical terms are widely recognized in English within the Python ecosystem and should normally remain untranslated unless the project glossary specifies an approved Punjabi equivalent.
Examples:
Python
API
Unicode
JSON
XML
HTML
HTTP
URL
ASCII
UTF-8
Use glossary-approved Punjabi translations where available.
Always consult:
GLOSSARY.md
before introducing new terminology.
If a term already exists in the glossary:
- Use the glossary translation.
- Do not create alternatives.
- Do not switch wording between files.
Consistency is more important than personal preference.
For large files, translations should be performed in reviewable batches.
Recommended format:
Replace this block:
msgid "example"
msgstr ""
With:
msgid "example"
msgstr "ਉਦਾਹਰਨ"
For multiple consecutive entries:
Replace these consecutive blocks:
...
This workflow was successfully used for:
library/functions.po
library/stdtypes.po
library/functools.po
library/exceptions.po
and is recommended for future large files.
Machine translation may be used only as a drafting aid.
Every translation must be manually reviewed.
Contributors remain responsible for:
- Accuracy
- Technical correctness
- Terminology consistency
- Markup preservation
- Natural Punjabi wording
No untranslated machine output should be committed.
Before committing:
- Verify all intended strings are translated.
- Verify placeholders remain unchanged.
- Verify markup remains unchanged.
- Verify code examples remain executable.
- Verify glossary terminology is followed.
- Verify formatting matches the source.
- Verify the documentation builds successfully.
- Verify
sphinx-lintreports no issues. - Verify the translation reads naturally in Punjabi.
- Complete a manual review.
Validate a file:
msgfmt --check FILE.poShow statistics:
msgfmt --statistics FILE.poShow untranslated entries:
msgattrib --untranslated FILE.poShow translated entries:
msgattrib --translated FILE.poValidate translation files:
msgfmt --check FILE.poRun documentation linting:
sphinx-lint .Build the Punjabi documentation:
python -m sphinx -b html -D language=pa Doc build/html-paRun the strict ("nitpicky") documentation build:
python -m sphinx -b html -n -W Doc build/html-paA completed translation should:
- Pass GNU gettext validation.
- Preserve all reStructuredText markup.
- Produce no
sphinx-linterrors. - Build successfully with CPython's HTML documentation builder.
- Pass the nitpicky (
-n) documentation build.
Translations may be maintained through the official Python Documentation Transifex project.
Before uploading translations:
- Validate all files with msgfmt
- Ensure glossary terminology is consistent
- Verify RST markup remains unchanged
- Review all machine-assisted translations manually
Only validated translations should be uploaded.
Commit messages should be concise, descriptive, and focused on a single logical change whenever possible.
Use descriptive commit messages.
Examples:
Translate tutorial/classes.po to Punjabi
Translate tutorial/floatingpoint.po to Punjabi
Translate tutorial/venv.po to Punjabi
Translate library/functions.po to Punjabi
Translate library/stdtypes.po to Punjabi
Translate library/functools.po to Punjabi
Translate library/exceptions.po to Punjabi
Translate glossary.po to Punjabi
Update glossary terminology
Update README statistics
Update project documentation
Before starting a new file:
- Review
GLOSSARY.md - Review this Style Guide
- Review completed translations
- Validate frequently
- Commit in logical batches
- Keep terminology consistent
Documentation should be:
- Formal
- Educational
- Clear
- Consistent
- Professional
Avoid:
- Slang
- Regional dialect variations
- Excessively literal translations
- Unnecessary English/Punjabi mixing
When in doubt:
Clarity > Literal Translation
Consistency > Personal Preference
Accuracy > Style
Every completed translation should be reviewed before submission.
Review each completed translation for:
- Technical accuracy.
- Natural and idiomatic Punjabi wording.
- Consistent terminology.
- Correct grammar and spelling.
- Preservation of placeholders.
- Preservation of reStructuredText markup.
- Formatting consistency.
- Successful validation with the project's tooling.
Useful resources for contributors:
-
Python Developer Guide – Documentation Translations
https://devguide.python.org/documentation/translations/ -
Python Documentation
https://docs.python.org/ -
Python Documentation Style Guide
https://devguide.python.org/documentation/style-guide/ -
Python Documentation on Transifex
https://app.transifex.com/python-doc/python-newest/ -
reStructuredText Primer (Sphinx)
https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
Every translation should satisfy three requirements:
Technically accurate
Consistent with the project glossary
Natural and readable for Punjabi users
If any of these requirements are not met, revise the translation before committing.