Skip to content

Commit 80389e6

Browse files
committed
Merge remote-tracking branch 'python/2.6' into exceptions
2 parents ac7da30 + ceb04f1 commit 80389e6

File tree

294 files changed

+24362
-36580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+24362
-36580
lines changed

.tx/config

Lines changed: 466 additions & 466 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Makefile for French Python Documentation
2+
#
3+
# Here is what you can do:
4+
#
5+
# - make # Automatically build an html local version
6+
# - make todo # To list remaining tasks
7+
# - make merge # To merge pot from upstream
8+
# - make fuzzy # To find fuzzy strings
9+
# - make progress # To compute current progression
10+
# - make upgrade_venv # To upgrade the venv that compiles the doc
11+
#
12+
# Modes are: autobuild-stable, autobuild-dev, and autobuild-html,
13+
# documented in gen/src/3.6/Doc/Makefile as we're only delegating the
14+
# real work to the Python Doc Makefile.
15+
16+
CPYTHON_CLONE := ../cpython/
17+
SPHINX_CONF := $(CPYTHON_CLONE)/Doc/conf.py
18+
LANGUAGE := fr
19+
VENV := ~/.venvs/python-docs-i18n/
20+
PYTHON := $(shell which python3)
21+
MODE := autobuild-dev-html
22+
BRANCH = $(shell git describe --contains --all HEAD)
23+
JOBS = 1
24+
25+
26+
.PHONY: all
27+
all: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb $(SPHINX_CONF)
28+
mkdir -p $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/
29+
ln -nfs $(shell readlink -f .) $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/LC_MESSAGES
30+
. $(VENV)/bin/activate; $(MAKE) -C $(CPYTHON_CLONE)/Doc/ SPHINXOPTS='-j$(JOBS) -D locale_dirs=locales -D language=$(LANGUAGE) -D gettext_compact=0' $(MODE)
31+
32+
33+
$(SPHINX_CONF):
34+
git clone --depth 1 --no-single-branch https://github.com/python/cpython.git $(CPYTHON_CLONE)
35+
36+
37+
$(VENV)/bin/activate:
38+
mkdir -p $(VENV)
39+
$(PYTHON) -m venv $(VENV)
40+
41+
42+
$(VENV)/bin/sphinx-build: $(VENV)/bin/activate
43+
. $(VENV)/bin/activate; python3 -m pip install sphinx
44+
45+
46+
$(VENV)/bin/blurb: $(VENV)/bin/activate
47+
. $(VENV)/bin/activate; python3 -m pip install blurb
48+
49+
50+
.PHONY: upgrade_venv
51+
upgrade_venv: $(VENV)/bin/activate
52+
. $(VENV)/bin/activate; python3 -m pip install --upgrade sphinx blurb
53+
54+
55+
.PHONY: progress
56+
progress:
57+
@python3 -c 'import sys; print("{:.1%}".format(int(sys.argv[1]) / int(sys.argv[2])))' \
58+
$(shell msgcat *.po */*.po | msgattrib --translated | grep -c '^msgid') \
59+
$(shell msgcat *.po */*.po | grep -c '^msgid')
60+
61+
62+
.PHONY: todo
63+
todo:
64+
for file in *.po */*.po; do echo $$(msgattrib --untranslated $$file | grep ^msgid | sed 1d | wc -l ) $$file; done | grep -v ^0 | sort -gr
65+
66+
67+
.PHONY: merge
68+
merge: $(VENV)/bin/sphinx-build
69+
ifneq "$(shell cd $(CPYTHON_CLONE) 2>/dev/null && git describe --contains --all HEAD)" "$(BRANCH)"
70+
$(error "You're merging from a different branch")
71+
endif
72+
(cd $(CPYTHON_CLONE)/Doc; rm -f build/NEWS)
73+
(cd $(CPYTHON_CLONE); $(VENV)/bin/sphinx-build -Q -b gettext -D gettext_compact=0 Doc pot/)
74+
find $(CPYTHON_CLONE)/pot/ -name '*.pot' |\
75+
while read -r POT;\
76+
do\
77+
PO="./$$(echo "$$POT" | sed "s#$(CPYTHON_CLONE)/pot/##; s#\.pot\$$#.po#")";\
78+
mkdir -p "$$(dirname "$$PO")";\
79+
if [ -f "$$PO" ];\
80+
then\
81+
case "$$POT" in\
82+
*whatsnew*) msgmerge --backup=off --force-po --no-fuzzy-matching -U "$$PO" "$$POT" ;;\
83+
*) msgmerge --backup=off --force-po -U "$$PO" "$$POT" ;;\
84+
esac\
85+
else\
86+
msgcat -o "$$PO" "$$POT";\
87+
fi\
88+
done
89+
90+
91+
.PHONY: fuzzy
92+
fuzzy:
93+
for file in *.po */*.po; do echo $$(msgattrib --only-fuzzy --no-obsolete "$$file" | grep -c ^msgid) $$file; done | grep -v ^0 | sort -gr

README.rst

Lines changed: 9 additions & 277 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
This is the French Translation of the Python Documentation
2-
==========================================================
1+
French Translation of the Python Documentation
2+
==============================================
3+
4+
**Translated: 28.0%**
5+
6+
See the `README.rst file on master
7+
<https://github.com/python/python-docs-fr/blob/master/README.rst>`_
8+
for more informations.
9+
310

411
Documentation Contribution Agreement
512
------------------------------------
@@ -22,278 +29,3 @@ Python community is welcomed and appreciated.
2229

2330
You signify acceptance of this agreement by submitting your work to
2431
the PSF for inclusion in the documentation.
25-
26-
27-
Contributing to the Translation
28-
-------------------------------
29-
30-
To clone, as we're working on the ``3.6`` branch, you can use ``git
31-
clone --branch 3.6``.
32-
33-
34-
How to Contribute
35-
~~~~~~~~~~~~~~~~~
36-
37-
You can either contribute on `transifex/python-doc/public
38-
<https://www.transifex.com/python-doc/public/>`_, or by simply openning an
39-
issue on this repository, or by editing the ``po`` files.
40-
41-
To modify those files you first have to fork this project and follow
42-
github instructions to clone it.
43-
44-
Next, to edit the files, you can use an editor of your choice, there's many:
45-
46-
- Highly recommended: `poedit <http://www.poedit.net/>`_
47-
- gted
48-
- gtranslator
49-
- lokalize
50-
- betterpoeditor
51-
- vim or emacs with an appropriate mode
52-
- Vé on Android
53-
- Probably many others
54-
55-
Finally, once your contribution is done, do a ``pull request`` so we
56-
can review and merge it.
57-
58-
59-
What to translate
60-
~~~~~~~~~~~~~~~~~
61-
62-
You can start with easy tasks like reviewing fuzzy entries to help
63-
keeping the documentation up to date. You can also proofread already
64-
translated entries, and finally translate untranslated ones.
65-
66-
- Do not translate content of ``:ref:...`` and ``:term:...``
67-
- Put english words, if you have to use them, in *italics* (surrounded
68-
by stars).
69-
- ``::`` at the end of some paragraphs have to be translated to `` :
70-
::`` in French to place the space before the column.
71-
72-
You can find files with a few translations missing::
73-
74-
for file in library/*; do echo $(msgattrib --untranslated $file | grep ^msgid | sed 1d | wc -l ) $file; done | grep -v ^0 | sort -gr | tail
75-
76-
Or replace the ``tail`` by a ``head`` to get files with a lot of work.
77-
78-
79-
Where to get help
80-
~~~~~~~~~~~~~~~~~
81-
82-
The coordinator for this translation is `mdk <https://mdk.fr/>`_.
83-
84-
Feel free to ask your questions on ``#python-fr`` on `freenode
85-
<https://webchat.freenode.net/>`_.
86-
87-
88-
Translation Progression
89-
-----------------------
90-
91-
============ ===== ===== =====
92-
.. 2.7 3.5 3.6
93-
============ ===== ===== =====
94-
about.po 100% 100% 100%
95-
bugs.po 100% 100% 100%
96-
c-api 9% 12% 11%
97-
contents.po 100% 100% 100%
98-
copyright.po 100% 100% 100%
99-
distributing 100% 100% 100%
100-
distutils 32% 33% 33%
101-
extending 21% 24% 24%
102-
faq 29% 33% 32%
103-
glossary.po 85% 100% 100%
104-
howto 7% 6% 6%
105-
install 45% 46% 43%
106-
installing 100% 100% 66%
107-
library 16% 20% 19%
108-
license.po 100% 100% 100%
109-
reference 5% 5% 5%
110-
sphinx.po 100% 100% 100%
111-
tutorial 100% 100% 100%
112-
using 31% 21% 19%
113-
whatsnew 6% 41% 7%
114-
~total~ 19% 25% 19%
115-
============ ===== ===== =====
116-
117-
118-
Priorities
119-
----------
120-
121-
The ``tutorial/`` directory has a high priority as translations aim
122-
for newcomers, then here are files most read in the original version:
123-
124-
- library/functions.po
125-
- library/stdtypes.po
126-
- library/string.po
127-
- library/re.po
128-
- library/datetime.po
129-
- library/csv.po
130-
- library/os.po
131-
- library/random.po
132-
- library/json.po
133-
- library/subprocess.po
134-
135-
136-
Translation Resources
137-
---------------------
138-
139-
- `Le Grand Dictionnaire Terminologique <http://gdt.oqlf.gouv.qc.ca/>`_
140-
- IRC channel `#python-fr <irc.lc/freenode/python-fr>`_ on freenode.
141-
- The `liste traductions <http://lists.afpy.org/mailman/listinfo/traductions>`_.
142-
- The `doc-sig mailing list
143-
<https://mail.python.org/mailman/listinfo/doc-sig>`_.
144-
- `Glossaire traduc.org <http://glossaire.traduc.org>`_
145-
- `Glossaires et Dictionnaires of traduc.org
146-
<https://traduc.org/Glossaires_et_dictionnaires>`_
147-
- `glossary.po <https://docs.python.org/fr/3/glossary.html>`_, as it's
148-
already translated.
149-
- `deepl.com/translator <https://www.deepl.com>`_
150-
151-
152-
Glossary
153-
--------
154-
155-
For consistency in our translations, here are some propositions and
156-
reminders for frequent terms you'll have to translate, don't hesitate
157-
to open an issue if you disagree.
158-
159-
========================== ===========================================
160-
Term Proposed Translation
161-
========================== ===========================================
162-
-like -compatible
163-
abstract data type type abstrait
164-
argument argument (Don't mix with parameter)
165-
backslash antislash, *backslash*
166-
bound lier
167-
bug bogue, *bug*
168-
built-in primitive, native
169-
debugging débogage
170-
double quote guillemet
171-
e.g. e.g. (pour *exempli gratia*)
172-
identifier identifiant
173-
immutable immuable
174-
interpreter interpréteur
175-
library bibliothèque
176-
list compréhension liste en compréhension
177-
little-endian, big-endian `petit-boutiste, gros-boutiste
178-
<https://fr.wikipedia.org/wiki/Endianness>`_
179-
mutable variable
180-
parameter paramètre
181-
prompt invite
182-
regular expression expression rationnelle, expression régulière
183-
return Renvoie, ou parfois donne. On évite
184-
"retourne" qui pourrait porter à confusion.
185-
simple quote guillemet simple, apostrophe (apostrophe
186-
is to glue, guillemet is to surround)
187-
socket *socket*
188-
statement instruction
189-
underscore tiret bas, *underscore*
190-
========================== ===========================================
191-
192-
193-
Project History
194-
---------------
195-
196-
This project was started `around 2012
197-
<https://github.com/AFPy/python_doc_fr/commit/b77bdff59036b6b5a4804d5f519ce3ea341e027c>`_
198-
by `afpy <https://www.afpy.org/>`_ members, in 2017 this project
199-
became the official french Python documentation translation thanks to
200-
`PEP 545 <https://www.python.org/dev/peps/pep-0545/>`_.
201-
202-
203-
Simplify git diffs
204-
------------------
205-
206-
Git diffs are often crowded with useless line number changes, like:
207-
208-
-#: ../Doc/library/signal.rst:406
209-
+#: ../Doc/library/signal.rst:408
210-
211-
To tell git they are not usefull information, you can do the following
212-
after ensuring ``~/.local/bin/`` is in your ``PATH``.
213-
214-
cat <<EOF > ~/.local/bin/podiff
215-
#!/bin/sh
216-
grep -v '^#:' "\$1"
217-
EOF
218-
219-
chmod a+x ~/.local/bin/podiff
220-
221-
git config diff.podiff.textconv podiff
222-
223-
224-
Maintenance
225-
-----------
226-
227-
All those snippets are to run from the root of a ``python-docs-fr``
228-
clone, and some expect to find an up-to-date CPython clone near to it,
229-
like::
230-
231-
~/
232-
├── python-docs-fr/
233-
└── cpython/
234-
235-
To clone CPython you may use::
236-
237-
git clone --depth 1 --no-single-branch https://github.com/python/cpython.git
238-
239-
This avoids to download the whole history (not usefull to build
240-
documentation) but still fetches all branches.
241-
242-
243-
Merge pot files from CPython
244-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
245-
246-
.. code-block:: bash
247-
248-
VERSION="$(git describe --contains --all HEAD)"
249-
(cd ../cpython; git checkout $VERSION && git pull --ff-only && sphinx-build -Q -b gettext -D gettext_compact=0 Doc pot/)
250-
find ../cpython/pot/ -name '*.pot' |
251-
while read -r POT
252-
do
253-
PO="./$(echo "$POT" | sed "s#../cpython/pot/##; s#\.pot\$#.po#")"
254-
mkdir -p "$(dirname "$PO")"
255-
if [ -f "$PO" ]
256-
then
257-
msgmerge --backup=off --force-po -U "$PO" "$POT"
258-
else
259-
msgcat -o "$PO" "$POT"
260-
fi
261-
done
262-
263-
264-
Find fuzzy strings
265-
~~~~~~~~~~~~~~~~~~
266-
267-
.. code-block:: bash
268-
269-
find -name '*.po' | xargs -L1 msgattrib --only-fuzzy --no-obsolete
270-
271-
272-
Run a test build locally
273-
~~~~~~~~~~~~~~~~~~~~~~~~
274-
275-
.. code-block:: bash
276-
277-
mkdir -p /tmp/$USER/locales/fr
278-
ln -nfs $(readlink -f .) /tmp/$USER/locales/fr/LC_MESSAGES
279-
make -C ../cpython/Doc SPHINXOPTS="-D locale_dirs=/tmp/$USER/locales/ -D language=fr -D gettext_compact=0" autobuild-dev-html
280-
281-
282-
Synchronize translation with Transifex
283-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
284-
285-
You'll need the ``transifex-client``, ``pomerge``, and ``poindent``
286-
from Pypi, and you'll need to configure ``tx`` via ``tx init``, and then:
287-
288-
.. code-block:: bash
289-
290-
tx pull
291-
pomerge --from .tx/*.po .tx/**/*.po --to *.po **/*.po
292-
poindent --modified
293-
294-
Now you should review and commit the pull, then push:
295-
296-
.. code-block:: bash
297-
298-
pomerge --from *.po **/*.po --to .tx/*.po .tx/**/*.po
299-
tx push -t

0 commit comments

Comments
 (0)