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