@@ -42,39 +42,83 @@ You can contribute using:
42
42
Contributing using Github
43
43
~~~~~~~~~~~~~~~~~~~~~~~~~
44
44
45
+ Prerequisites:
46
+
45
47
You'll first need a `github account <https://github.com/join >`_.
46
48
47
- Then you'll need to fork the project by clicking the ``Fork `` button
48
- on `python-docs-fr <https://github.com/python/python-docs-fr >`_. This
49
- creates a copy of the whole project on your github account: a place
50
- where you have the rights to do modifications.
49
+ You'll need ``git `` `installed
50
+ <https://help.github.com/articles/set-up-git/> `_ (for windows, see
51
+ https://gitforwindows.org/).
51
52
52
- To modify po files you'll need to synchronize the project files to
53
- your computer by using ``git ``: https://help.github.com/articles/set-up-git/.
53
+ You'll need a po file editor, typically `poedit <https://poedit.net/ >`_.
54
54
55
- Once the project files are synchronized to your computer, you'll be
56
- able to modify them, those are ``.po `` files and can be modified using
57
- various tools:
58
55
59
- - `poedit <http://www.poedit.net/ >`_ (recommended)
60
- - gted
61
- - gtranslator
62
- - lokalize
63
- - betterpoeditor
64
- - vim or emacs with an appropriate mode
65
- - Vé on Android
66
- - Probably many others
56
+ Let's start:
67
57
68
- Before commiting, you should use `grammalecte
69
- <https://www.dicollecte.org/> `_ to check for your translations.
58
+ You'll need to fork the `python-docs-fr
59
+ <https://github.com/python/python-docs-fr> `_ clicking its ``Fork ``
60
+ button. This creates a copy of the whole project on your github
61
+ account: a place where you have the rights to do modifications.
62
+
63
+ Step by steps::
64
+
65
+ # Git clone your github fork using ssh (replace JulienPalard):
66
+ $ git clone git@github.com:JulienPalard/python-docs-fr.git
67
+
68
+ # Go to the cloned directory:
69
+ $ cd python-docs-fr/
70
+
71
+ # Add the upstream (the public repository) using HTTPS (won't ask for password):
72
+ $ git remote add upstream https://github.com/python/python-docs-fr.git
73
+
74
+
75
+ Now you're ready to start a work session, each time you'll start a new task, start here::
76
+
77
+ # To work, we'll need a branch, based on an up-to-date (freshly fetched)
78
+ # upstream/3.7 branch, let's say we'll work on glossary so we name
79
+ # the branch "glossary":
80
+ $ git fetch upstream
81
+ $ git checkout -b glossary upstream/3.7
70
82
71
- After commiting (this is just "naming the modification"), synchronize
72
- the file back to github using ``git push ``.
83
+ # You can now work on the file, typically using poedit,
84
+ # then commit your work with a nice explicit message:
85
+ $ git commit -a -m "Working on glossary."
73
86
74
- And now, from your github project, a buttun should appear "Compare &
75
- pull request", this is asking us, the main project, to pull your
76
- modifications. This step may take some time as we'll review your
77
- modifications before accepting them, and we may ask for modifications.
87
+ # Then push your modifications to your github clone,
88
+ # as they are ephemeral branches, let's not configure git to track them all,
89
+ # "origin HEAD" is a "special" syntax to say "Push on origin,
90
+ # on a branch with the same name as the local one",
91
+ # it's nice as it's exactly what we want:
92
+ $ git push origin HEAD
93
+
94
+ # Now you can open the pull request on github, just go to
95
+ # https://github.com/python/python-docs-fr/ and a nice "Compare & pull request"
96
+ # button should appear after a few seconds telling you can ask for a pull request.
97
+
98
+ # Now someone is reviewing your modifications, and you'll want to fix their
99
+ # findings, get back to your branch
100
+ # (in case you started something else on another branch):
101
+ $ git checkout glossary
102
+ # Fix the issues, then commit again:
103
+ $ git commit -a -m "glossary: small fixes."
104
+ $ git push origin HEAD
105
+
106
+
107
+ You may have noted that this looks like a triangle, with a missing segment:
108
+
109
+ - You're fetching from upstream (public common repo on github)
110
+ - You're pushing to origin (your clone on github)
111
+
112
+ So yes it's the work of someone to add the last segment, from your
113
+ origin to the public upstream, to "close the loop", that's the role of
114
+ the people who merges pull requests after proofreading them.
115
+
116
+ You may also have noted you never ever commit on a version branch
117
+ (``3.6 ``, ``3.7 ``, ...), only pull from them, consider them read-only
118
+ you'll avoid problems.
119
+
120
+ Before commiting, you should use `grammalecte
121
+ <https://www.dicollecte.org/> `_ to check for your translations.
78
122
79
123
80
124
What to translate
0 commit comments