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