Skip to content

Commit 271ce19

Browse files
committed
Update l10n guide
Signed-off-by: Junio C Hamano <[email protected]>
1 parent 71eb878 commit 271ce19

File tree

2 files changed

+94
-22
lines changed

2 files changed

+94
-22
lines changed

po/README

Lines changed: 84 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,78 @@
11
Core GIT Translations
22
=====================
33

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+
-------------------------------
849

9-
Generating a .pot file
10-
----------------------
50+
(This is done by the l10n coordinator).
1151

1252
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.
1559

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.
1862

19-
make pot
2063

64+
Initializing a XX.po file
65+
-------------------------
2166

22-
Initializing a .po file
23-
-----------------------
67+
(This is done by the language teams).
2468

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:
2771

2872
msginit --locale=XX
2973

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.
3176

3277
Then edit the automatically generated copyright info in your new XX.po
3378
to be correct, e.g. for Icelandic:
@@ -46,21 +91,36 @@ just "Git":
4691

4792
perl -pi -e 's/(?<="Project-Id-Version: )PACKAGE VERSION/Git/' XX.po
4893

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+
---------------------
49100

50-
Updating a .po file
51-
-------------------
101+
(This is done by the language teams).
52102

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:
56110

57111
msgmerge --add-location --backup=off -U XX.po git.pot
58112

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+
60118

61119
Testing your changes
62120
--------------------
63121

122+
(This is done by the language teams, after creating or updating XX.po file).
123+
64124
Before you submit your changes go back to the top-level and do:
65125

66126
make
@@ -75,6 +135,8 @@ with a newline or not.
75135
Marking strings for translation
76136
-------------------------------
77137

138+
(This is done by the core developers).
139+
78140
Before strings can be translated they first have to be marked for
79141
translation.
80142

po/TEAMS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Core Git translation language teams
2+
(please keep the list sorted alphabetically on language field)
3+
4+
Language: is (Icelandic)
5+
Leader: Ævar Arnfjörð Bjarmason <[email protected]>
6+
7+
Language: zh_CN (Simplified Chinese)
8+
Leader: Jiang Xin <[email protected]>
9+
Members: Yichao Yu <[email protected]>
10+

0 commit comments

Comments
 (0)