2017-05-22 22:12:09 +00:00
|
|
|
|
This is the French Translation of the Python Documentation
|
|
|
|
|
==========================================================
|
|
|
|
|
|
2017-05-31 19:57:10 +00:00
|
|
|
|
Documentation Contribution Agreement
|
|
|
|
|
------------------------------------
|
|
|
|
|
|
|
|
|
|
NOTE REGARDING THE LICENSE FOR TRANSLATIONS: Python's documentation is
|
|
|
|
|
maintained using a global network of volunteers. By posting this
|
|
|
|
|
project on Transifex, Github, and other public places, and inviting
|
|
|
|
|
you to participate, we are proposing an agreement that you will
|
|
|
|
|
provide your improvements to Python's documentation or the translation
|
|
|
|
|
of Python's documentation for the PSF's use under the CC0 license
|
|
|
|
|
(available at
|
2017-08-01 11:17:19 +00:00
|
|
|
|
https://creativecommons.org/publicdomain/zero/1.0/legalcode). In
|
2017-05-31 19:57:10 +00:00
|
|
|
|
return, you may publicly claim credit for the portion of the
|
|
|
|
|
translation you contributed and if your translation is accepted by the
|
|
|
|
|
PSF, you may (but are not required to) submit a patch including an
|
|
|
|
|
appropriate annotation in the Misc/ACKS or TRANSLATORS file. Although
|
|
|
|
|
nothing in this Documentation Contribution Agreement obligates the PSF
|
|
|
|
|
to incorporate your textual contribution, your participation in the
|
|
|
|
|
Python community is welcomed and appreciated.
|
|
|
|
|
|
|
|
|
|
You signify acceptance of this agreement by submitting your work to
|
|
|
|
|
the PSF for inclusion in the documentation.
|
|
|
|
|
|
|
|
|
|
|
2017-05-22 22:12:09 +00:00
|
|
|
|
Contributing to the Translation
|
|
|
|
|
-------------------------------
|
|
|
|
|
|
2017-09-22 08:17:36 +00:00
|
|
|
|
To clone, as we're working on the ``3.6`` branch, you can use ``git
|
|
|
|
|
clone --branch 3.6``.
|
2017-05-22 22:12:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
How to Contribute
|
|
|
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
2017-05-24 11:19:23 +00:00
|
|
|
|
You can either contribute on `transifex/python-doc/public
|
|
|
|
|
<https://www.transifex.com/python-doc/public/>`_, or by simply openning an
|
2017-05-22 22:34:24 +00:00
|
|
|
|
issue on this repository, or by editing the ``po`` files.
|
2017-05-22 22:12:09 +00:00
|
|
|
|
|
2017-05-22 22:34:24 +00:00
|
|
|
|
To modify those files you first have to fork this project and follow
|
2017-05-22 22:33:34 +00:00
|
|
|
|
github instructions to clone it.
|
2017-05-22 22:12:09 +00:00
|
|
|
|
|
|
|
|
|
Next, to edit the files, you can use an editor of your choice, there's many:
|
|
|
|
|
|
|
|
|
|
- Highly recommended: `poedit <http://www.poedit.net/>`_
|
|
|
|
|
- gted
|
|
|
|
|
- gtranslator
|
|
|
|
|
- lokalize
|
|
|
|
|
- betterpoeditor
|
|
|
|
|
- vim or emacs with an appropriate mode
|
|
|
|
|
- Vé on Android
|
|
|
|
|
- Probably many others
|
|
|
|
|
|
|
|
|
|
Finally, once your contribution is done, do a ``pull request`` so we
|
|
|
|
|
can review and merge it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
What to translate
|
|
|
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
2017-09-22 08:17:36 +00:00
|
|
|
|
You can start with easy tasks like reviewing fuzzy entries to help
|
|
|
|
|
keeping the documentation up to date. You can also proofread already
|
|
|
|
|
translated entries, and finally translate untranslated ones.
|
|
|
|
|
|
2017-05-22 22:12:09 +00:00
|
|
|
|
- Do not translate content of ``:ref:...`` and ``:term:...``
|
|
|
|
|
- Put english words, if you have to use them, in *italics* (surrounded
|
|
|
|
|
by stars).
|
2017-09-22 08:17:36 +00:00
|
|
|
|
- ``::`` at the end of some paragraphs have to be translated to `` :
|
2017-05-22 22:12:09 +00:00
|
|
|
|
::`` in French to place the space before the column.
|
|
|
|
|
|
2017-09-22 08:32:57 +00:00
|
|
|
|
You can find files with a few translations missing::
|
|
|
|
|
|
|
|
|
|
for file in library/*; do echo $(msgattrib --untranslated $file | grep ^msgid | sed 1d | wc -l ) $file; done | grep -v ^0 | sort -gr | tail
|
|
|
|
|
|
|
|
|
|
Or replace the ``tail`` by a ``head`` to get files with a lot of work.
|
|
|
|
|
|
2017-05-22 22:12:09 +00:00
|
|
|
|
|
2017-05-22 22:27:43 +00:00
|
|
|
|
Where to get help
|
|
|
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
The coordinator for this translation is `mdk <https://mdk.fr/>`_.
|
|
|
|
|
|
|
|
|
|
Feel free to ask your questions on ``#python-fr`` on `freenode
|
|
|
|
|
<https://webchat.freenode.net/>`_.
|
|
|
|
|
|
|
|
|
|
|
2017-09-22 08:17:36 +00:00
|
|
|
|
Translation Progression
|
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
|
|
============ ===== ===== =====
|
|
|
|
|
.. 2.7 3.5 3.6
|
|
|
|
|
============ ===== ===== =====
|
|
|
|
|
about.po 100% 100% 100%
|
|
|
|
|
bugs.po 100% 100% 100%
|
|
|
|
|
c-api 9% 12% 11%
|
|
|
|
|
contents.po 100% 100% 100%
|
|
|
|
|
copyright.po 100% 100% 100%
|
|
|
|
|
distributing 100% 100% 100%
|
|
|
|
|
distutils 32% 33% 33%
|
|
|
|
|
extending 21% 24% 24%
|
|
|
|
|
faq 29% 33% 32%
|
|
|
|
|
glossary.po 85% 100% 100%
|
|
|
|
|
howto 7% 6% 6%
|
|
|
|
|
install 45% 46% 43%
|
|
|
|
|
installing 100% 100% 66%
|
|
|
|
|
library 16% 20% 19%
|
|
|
|
|
license.po 100% 100% 100%
|
|
|
|
|
reference 5% 5% 5%
|
|
|
|
|
sphinx.po 100% 100% 100%
|
|
|
|
|
tutorial 100% 100% 100%
|
|
|
|
|
using 31% 21% 19%
|
|
|
|
|
whatsnew 6% 41% 7%
|
|
|
|
|
~total~ 19% 25% 19%
|
|
|
|
|
============ ===== ===== =====
|
|
|
|
|
|
|
|
|
|
|
2017-05-22 22:12:09 +00:00
|
|
|
|
Priorities
|
|
|
|
|
----------
|
|
|
|
|
|
|
|
|
|
The ``tutorial/`` directory has a high priority as translations aim
|
|
|
|
|
for newcomers, then here are files most read in the original version:
|
|
|
|
|
|
|
|
|
|
- library/functions.po
|
|
|
|
|
- library/stdtypes.po
|
|
|
|
|
- library/string.po
|
|
|
|
|
- library/re.po
|
|
|
|
|
- library/datetime.po
|
|
|
|
|
- library/csv.po
|
|
|
|
|
- library/os.po
|
|
|
|
|
- library/random.po
|
|
|
|
|
- library/json.po
|
|
|
|
|
- library/subprocess.po
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Translation Resources
|
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
|
|
- `Le Grand Dictionnaire Terminologique <http://gdt.oqlf.gouv.qc.ca/>`_
|
|
|
|
|
- IRC channel `#python-fr <irc.lc/freenode/python-fr>`_ on freenode.
|
|
|
|
|
- The `liste traductions <http://lists.afpy.org/mailman/listinfo/traductions>`_
|
|
|
|
|
- `Glossaire traduc.org <http://glossaire.traduc.org>`_
|
|
|
|
|
- `Glossaires et Dictionnaires of traduc.org
|
|
|
|
|
<https://traduc.org/Glossaires_et_dictionnaires>`_
|
|
|
|
|
- glossary.po, as it's already translated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Glossary
|
|
|
|
|
--------
|
|
|
|
|
|
|
|
|
|
For consistency in our translations, here are some propositions and
|
|
|
|
|
reminders for frequent terms you'll have to translate, don't hesitate
|
|
|
|
|
to open an issue if you disagree.
|
|
|
|
|
|
|
|
|
|
- double quote: *guillemet*
|
|
|
|
|
- simple quote: *guillemet simple*, *apostrophe* (*apostrophe* is to glue,
|
|
|
|
|
*guillemet* is to surround, use when appropriate)
|
|
|
|
|
- -like: *-compatible* (when appropriate)
|
|
|
|
|
- abstract data type: *type abstrait*
|
|
|
|
|
- argument: *argument* (Don't mix with parameter)
|
|
|
|
|
- parameter: *paramètre*
|
|
|
|
|
- backslash: *antislash*, *backslash* (in italics)
|
|
|
|
|
- bound: *lier*
|
|
|
|
|
- bug: *bogue*, *bug* (in italics)
|
|
|
|
|
- debugging: *débogage*
|
|
|
|
|
- built-in: *primitive*, *native*
|
|
|
|
|
- identifier: *identifiant*
|
|
|
|
|
- immutable: *immuable*
|
|
|
|
|
- interpreter: *interpréteur*
|
|
|
|
|
- library: *bibliothèque*
|
|
|
|
|
- list compréhension: *liste en compréhension*
|
|
|
|
|
- mutable: *variable*
|
|
|
|
|
- prompt: *invite*
|
2017-05-24 12:06:48 +00:00
|
|
|
|
- regular expression: *expression rationnelle*, *expression régulière*
|
2017-05-22 22:12:09 +00:00
|
|
|
|
- socket: *socket* (in italics)
|
|
|
|
|
- statement: *instruction*
|
|
|
|
|
- underscore: *tiret bas*, *underscore* (in italics)
|
|
|
|
|
- little-endian, big-endian: `petit-boutise, gros-boutiste
|
|
|
|
|
<https://fr.wikipedia.org/wiki/Endianness>`_
|
2017-05-22 22:24:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Project History
|
|
|
|
|
---------------
|
|
|
|
|
|
|
|
|
|
This project was started `around 2012
|
|
|
|
|
<https://github.com/AFPy/python_doc_fr/commit/b77bdff59036b6b5a4804d5f519ce3ea341e027c>`_
|
|
|
|
|
by `afpy <https://www.afpy.org/>`_ members, in 2017 this project
|
|
|
|
|
became the official french Python documentation translation thanks to
|
|
|
|
|
`PEP 545 <https://www.python.org/dev/peps/pep-0545/>`_.
|
2017-05-27 12:17:28 +00:00
|
|
|
|
|
|
|
|
|
|
2017-08-01 11:36:07 +00:00
|
|
|
|
Simplify git diffs
|
|
|
|
|
------------------
|
|
|
|
|
|
|
|
|
|
Git diffs are often crowded with useless line number changes, like:
|
|
|
|
|
|
|
|
|
|
-#: ../Doc/library/signal.rst:406
|
|
|
|
|
+#: ../Doc/library/signal.rst:408
|
|
|
|
|
|
|
|
|
|
To tell git they are not usefull information, you can do the following
|
|
|
|
|
after ensuring ``~/.local/bin/`` is in your ``PATH``.
|
|
|
|
|
|
|
|
|
|
cat <<EOF > ~/.local/bin/podiff
|
|
|
|
|
#!/bin/sh
|
2017-09-21 07:21:41 +00:00
|
|
|
|
grep -v '^#:' "\$1"
|
2017-08-01 11:36:07 +00:00
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
chmod a+x ~/.local/bin/podiff
|
|
|
|
|
|
|
|
|
|
git config diff.podiff.textconv podiff
|
|
|
|
|
|
2017-08-11 21:33:03 +00:00
|
|
|
|
|
2017-05-27 12:17:28 +00:00
|
|
|
|
Maintenance
|
|
|
|
|
-----------
|
|
|
|
|
|
2017-08-11 21:33:03 +00:00
|
|
|
|
All those snippets are to run from the root of a ``python-docs-fr``
|
|
|
|
|
clone, and some expect to find an up-to-date CPython clone near to it,
|
|
|
|
|
like::
|
2017-05-27 12:17:28 +00:00
|
|
|
|
|
2017-08-11 21:33:03 +00:00
|
|
|
|
~/
|
|
|
|
|
├── python-docs-fr/
|
|
|
|
|
└── cpython/
|
2017-05-27 12:17:28 +00:00
|
|
|
|
|
2017-08-11 21:33:03 +00:00
|
|
|
|
To clone CPython you may use::
|
2017-05-27 17:51:09 +00:00
|
|
|
|
|
2017-08-11 21:33:03 +00:00
|
|
|
|
git clone --depth 1 --no-single-branch https://github.com/python/cpython.git
|
2017-05-27 17:51:09 +00:00
|
|
|
|
|
2017-08-11 21:33:03 +00:00
|
|
|
|
This avoids to download the whole history (not usefull to build
|
|
|
|
|
documentation) but still fetches all branches.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Merge pot files from CPython
|
2017-08-29 12:24:39 +00:00
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-05-27 17:51:09 +00:00
|
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
2017-08-01 11:24:45 +00:00
|
|
|
|
VERSION="$(git describe --contains --all HEAD)"
|
2017-08-11 21:33:03 +00:00
|
|
|
|
(cd ../cpython; git checkout $VERSION && git pull --ff-only && sphinx-build -Q -b gettext -D gettext_compact=0 Doc pot/)
|
|
|
|
|
find ../cpython/pot/ -name '*.pot' |
|
2017-05-27 17:51:09 +00:00
|
|
|
|
while read -r POT
|
|
|
|
|
do
|
2017-08-11 21:33:03 +00:00
|
|
|
|
PO="./$(echo "$POT" | sed "s#../cpython/pot/##; s#\.pot\$#.po#")"
|
2017-05-27 17:51:09 +00:00
|
|
|
|
mkdir -p "$(dirname "$PO")"
|
|
|
|
|
if [ -f "$PO" ]
|
|
|
|
|
then
|
|
|
|
|
msgmerge --backup=off --force-po -U "$PO" "$POT"
|
|
|
|
|
else
|
|
|
|
|
msgcat -o "$PO" "$POT"
|
|
|
|
|
fi
|
|
|
|
|
done
|
2017-08-01 12:48:06 +00:00
|
|
|
|
|
|
|
|
|
|
2017-08-11 21:33:03 +00:00
|
|
|
|
Find fuzzy strings
|
2017-08-29 12:24:39 +00:00
|
|
|
|
~~~~~~~~~~~~~~~~~~
|
2017-08-11 21:33:03 +00:00
|
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
|
|
find -name '*.po' | xargs -L1 msgattrib --only-fuzzy --no-obsolete
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Run a test build locally
|
2017-08-29 12:24:39 +00:00
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-08-01 12:48:06 +00:00
|
|
|
|
|
2017-08-11 21:33:03 +00:00
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
|
|
mkdir -p /tmp/$USER/locales/fr
|
|
|
|
|
ln -nfs $(readlink -f .) /tmp/$USER/locales/fr/LC_MESSAGES
|
2017-08-13 22:10:51 +00:00
|
|
|
|
make -C ../cpython/Doc SPHINXOPTS="-D locale_dirs=/tmp/$USER/locales/ -D language=fr -D gettext_compact=0" autobuild-dev-html
|
2017-08-11 21:33:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Synchronize translation with Transifex
|
2017-08-29 12:24:39 +00:00
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-08-11 21:33:03 +00:00
|
|
|
|
|
|
|
|
|
You'll need the ``transifex-client``, ``pomerge``, and ``poindent``
|
|
|
|
|
from Pypi, and you'll need to configure ``tx`` via ``tx init``, and then:
|
|
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
|
|
tx pull
|
|
|
|
|
pomerge --from .tx/*.po .tx/**/*.po --to *.po **/*.po
|
|
|
|
|
poindent --modified
|
|
|
|
|
|
|
|
|
|
Now you should review and commit the pull, then push:
|
|
|
|
|
|
|
|
|
|
.. code-block:: bash
|
2017-08-01 12:48:06 +00:00
|
|
|
|
|
2017-08-11 21:33:03 +00:00
|
|
|
|
pomerge --from *.po **/*.po --to .tx/*.po .tx/**/*.po
|
|
|
|
|
tx push -t
|