1
1
Core GIT Translations
2
2
=====================
3
3
4
- This directory holds the translations for the core of Git. This
5
- document describes how to add to and maintain these translations, and
6
- how to mark source strings for translation.
7
-
4
+ This directory holds the translations for the core of Git. This document
5
+ describes how you can contribute to the effort of enhancing the language
6
+ coverage and maintaining the translation.
7
+
8
+ The localization (l10n) coordinator, Jiang Xin <
[email protected] >,
9
+ coordinates our localization effort in his repository:
10
+
11
+ https://github.com/gotgit/git-po/
12
+
13
+ As a contributor for a language XX, you would fork this repository,
14
+ prepare and/or update the translated message file po/XX.po (described
15
+ later), and ask the l10n coordinator to pull your work.
16
+
17
+ If there are multiple contributors for the same language, please first
18
+ coordinate among yourselves and nominate the team leader for your
19
+ language, so that the l10n coordinator only needs to interact with one
20
+ person per language.
21
+
22
+ For the list of exiting translations and language teams, see TEAMS file in
23
+ this directory.
24
+
25
+ The overall data-flow looks like this:
26
+
27
+ +-------------------+ +------------------+
28
+ | Git source code | ---(1)---> | L10n coordinator |
29
+ | repository | <---(4)--- | repository |
30
+ +-------------------+ +------------------+
31
+ | ^
32
+ (2) (3)
33
+ V |
34
+ +------------------+
35
+ | Language Team XX |
36
+ +------------------+
37
+
38
+ * Translatable strings are marked in the source file.
39
+ * L10n coordinator pulls from the source (1)
40
+ * L10n coordinator updates the message template po/git.pot
41
+ * Language team pulls from L10n coordinator (2)
42
+ * Language team updates the message file po/XX.po
43
+ * L10n coordinator pulls from Language team (3)
44
+ * L10n coordinator asks the result to be pulled (4).
45
+
46
+
47
+ Maintaining the po/git.pot file
48
+ -------------------------------
8
49
9
- Generating a .pot file
10
- ----------------------
50
+ (This is done by the l10n coordinator).
11
51
12
52
The po/git.pot file contains a message catalog extracted from Git's
13
- sources. You need to generate it to add new translations with
14
- msginit(1), or update existing ones with msgmerge(1).
53
+ sources. The l10n coordinator maintains it by adding new translations with
54
+ msginit(1), or update existing ones with msgmerge(1). In order to update
55
+ the Git sources to extract the messages from, the l10n coordinator is
56
+ expected to pull from the main git repository at strategic point in
57
+ history (e.g. when a major release and release candidates are tagged),
58
+ and then run "make pot" at the top-level directory.
15
59
16
- Since the file can be automatically generated it's not checked into
17
- git.git. To generate it do, at the top-level:
60
+ Language contributors use this file to prepare translations for their
61
+ language, but they are not expected to modify it.
18
62
19
- make pot
20
63
64
+ Initializing a XX.po file
65
+ -------------------------
21
66
22
- Initializing a .po file
23
- -----------------------
67
+ (This is done by the language teams).
24
68
25
- To add a new translation first generate git.pot (see above) and then
26
- in the po/ directory do :
69
+ If your language XX does not have translated message file po/XX.po yet,
70
+ you add a translation for the first time by running :
27
71
28
72
msginit --locale=XX
29
73
30
- Where XX is your locale, e.g. "is", "de" or "pt_BR".
74
+ in the po/ directory, where XX is the locale, e.g. "de", "is", "pt_BR",
75
+ "zh_CN", etc.
31
76
32
77
Then edit the automatically generated copyright info in your new XX.po
33
78
to be correct, e.g. for Icelandic:
@@ -46,21 +91,36 @@ just "Git":
46
91
47
92
perl -pi -e 's/(?<="Project-Id-Version: )PACKAGE VERSION/Git/' XX.po
48
93
94
+ Once you are done testing the translation (see below), commit the result
95
+ and ask the l10n coordinator to pull from you.
96
+
97
+
98
+ Updating a XX.po file
99
+ ---------------------
49
100
50
- Updating a .po file
51
- -------------------
101
+ (This is done by the language teams).
52
102
53
- If there's an existing *.po file for your language but you need to
54
- update the translation you first need to generate git.pot (see above)
55
- and then in the po/ directory do:
103
+ If you are replacing translation strings in an existing XX.po file to
104
+ improve the translation, just edit the file.
105
+
106
+ If there's an existing XX.po file for your language, but the repository
107
+ of the l10n coordinator has newer po/git.pot file, you would need to first
108
+ pull from the l10n coordinator (see the beginning of this document for its
109
+ URL), and then update the existing translation by running:
56
110
57
111
msgmerge --add-location --backup=off -U XX.po git.pot
58
112
59
- Where XX.po is the file you want to update.
113
+ in the po/ directory, where XX.po is the file you want to update.
114
+
115
+ Once you are done testing the translation (see below), commit the result
116
+ and ask the l10n coordinator to pull from you.
117
+
60
118
61
119
Testing your changes
62
120
--------------------
63
121
122
+ (This is done by the language teams, after creating or updating XX.po file).
123
+
64
124
Before you submit your changes go back to the top-level and do:
65
125
66
126
make
@@ -75,6 +135,8 @@ with a newline or not.
75
135
Marking strings for translation
76
136
-------------------------------
77
137
138
+ (This is done by the core developers).
139
+
78
140
Before strings can be translated they first have to be marked for
79
141
translation.
80
142
0 commit comments