Skip to content

Commit 9289c58

Browse files
committed
Align documentation with Python translation guidelines
1 parent ea24033 commit 9289c58

1 file changed

Lines changed: 175 additions & 13 deletions

File tree

‎STYLE_GUIDE.md‎

Lines changed: 175 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
# Punjabi (pa-IN) Python Docs Style Guide
22

3+
This guide defines translation conventions for the Punjabi translation of Python documentation.
4+
5+
## General Principles
6+
7+
* Translate meaning, not individual words.
8+
* Use clear and natural Punjabi (Gurmukhi).
9+
* Maintain consistency across all files.
10+
* Follow terminology defined in `GLOSSARY.md`.
11+
* Preserve technical accuracy at all times.
12+
13+
---
14+
315
## Never Translate
416

517
### Python Keywords
618

19+
```text
720
if
821
else
922
elif
@@ -13,47 +26,196 @@ class
1326
def
1427
return
1528
import
29+
from
30+
try
31+
except
32+
finally
33+
raise
34+
pass
35+
with
36+
yield
37+
lambda
38+
and
39+
or
40+
not
41+
```
1642

1743
### Variable Names
1844

45+
```text
1946
x
2047
y
2148
count
2249
user_name
2350
my_list
51+
self
52+
cls
53+
```
54+
55+
### Function, Class, Module, and Exception Names
56+
57+
Examples:
58+
59+
```text
60+
print
61+
len
62+
range
63+
ValueError
64+
TypeError
65+
Exception
66+
list
67+
dict
68+
tuple
69+
set
70+
os
71+
sys
72+
json
73+
```
74+
75+
These names must remain unchanged.
76+
77+
---
2478

25-
### RST Roles
79+
## RST Markup Preservation
2680

81+
Never modify Sphinx or reStructuredText markup.
82+
83+
Examples:
84+
85+
```rst
2786
:func:`print`
2887
:class:`list`
2988
:mod:`os`
3089
:ref:`section`
90+
:meth:`append`
91+
:attr:`name`
92+
:exc:`ValueError`
93+
:term:`iterator`
94+
```
3195

32-
### URLs
96+
Translate only surrounding explanatory text.
3397

34-
Leave all URLs unchanged.
98+
---
99+
100+
## Directives
101+
102+
Preserve directives exactly as written.
103+
104+
Examples:
105+
106+
```rst
107+
.. note::
108+
.. warning::
109+
.. code-block:: python
110+
.. versionadded::
111+
.. versionchanged::
112+
```
113+
114+
Translate the content inside notes and warnings, but never change the directive itself.
35115

36116
---
37117

38118
## Code Blocks
39119

40120
Translate:
41121

42-
- Comments
43-
- Explanatory text
122+
* Comments
123+
* User-facing explanatory text
44124

45125
Do not translate:
46126

47-
- Python keywords
48-
- Variable names
49-
- Function names
50-
- Class names
51-
- Module names
127+
* Python keywords
128+
* Variable names
129+
* Function names
130+
* Class names
131+
* Module names
132+
* Exception names
133+
* Example code behavior
134+
135+
Example:
136+
137+
```python
138+
# Calculate the square of a number
139+
x = 5
140+
print(x * x)
141+
```
142+
143+
Only the comment may be translated.
144+
145+
---
146+
147+
## URLs
148+
149+
Leave all URLs unchanged.
150+
151+
Examples:
152+
153+
```text
154+
https://docs.python.org/
155+
https://devguide.python.org/
156+
```
157+
158+
---
159+
160+
## Terminology
161+
162+
Always consult `GLOSSARY.md` before introducing new translations.
163+
164+
When a technical term already exists in the glossary, use the glossary version consistently throughout the project.
165+
166+
---
167+
168+
## Consistency Rules
169+
170+
* Use the same translation for the same term everywhere.
171+
* Preserve punctuation when possible.
172+
* Preserve formatting and inline markup.
173+
* Keep examples technically correct after translation.
174+
175+
---
176+
177+
## Machine Translation
178+
179+
Machine translation may be used only as a drafting aid.
180+
181+
Every translated string must be manually reviewed for:
182+
183+
* Accuracy
184+
* Terminology consistency
185+
* Natural Punjabi wording
186+
* Correct markup preservation
187+
188+
Contributors are responsible for the final quality of submitted translations.
189+
190+
---
191+
192+
## Validation Before Commit
193+
194+
Run:
195+
196+
```bash
197+
msgfmt --check tutorial/FILENAME.po
198+
```
199+
200+
Check progress:
201+
202+
```bash
203+
msgfmt --statistics tutorial/FILENAME.po
204+
```
205+
206+
Review untranslated entries:
207+
208+
```bash
209+
msgattrib --untranslated tutorial/FILENAME.po
210+
```
211+
212+
All files should pass validation before submission.
52213

53214
---
54215

55216
## Tone
56217

57-
- Use formal Punjabi
58-
- Follow GLOSSARY.md terminology
59-
- Keep translations consistent across files
218+
* Use formal Punjabi.
219+
* Keep explanations clear and educational.
220+
* Prefer consistency over stylistic variation.
221+
* Follow Python documentation writing conventions whenever possible.

0 commit comments

Comments
 (0)