forked from jnavila/git-manpages-l10n
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
174 lines (127 loc) · 6.68 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
GIT Documentation Translations
=====================
This project holds the translations for the documentation of Git. This
document describes how you can contribute to the effort of enhancing
the language coverage and maintaining the translation.
The two character language translation codes are defined by ISO_639-1,
as stated in the gettext(1) full manual, appendix A.1, Usual Language
Codes.
Contributing to an existing translation
---------------------------------------
As a contributor for a language XX, you should first check TEAMS file
in this directory to see whether a dedicated team for your language XX
exists. Fork the dedicated repository and start to work if it exists.
Sometimes, contributors may find that the translations of their Git
documentation distributions are quite different with the translations
of the corresponding version from Git official. This is because some
Git distributions (such as from Ubuntu, etc.) have their own l10n
workflow. For this case, wrong translations should be reported and
fixed through their workflows.
Creating a new language translation (direct translation)
--------------------------------------------------------
If you are the first contributor for the language XX, please fork this
repository, prepare and/or update the translated message file
po/documentation.XX.po (described later), and ask the l10n coordinator
to pull your work.
If there are multiple contributors for the same language, please first
coordinate among yourselves and nominate the team leader for your
language, so that the l10n coordinator only needs to interact with one
person per language.
Creating a new language translation (direct translation)
--------------------------------------------------------
Alternatively, you can start translating in your own language by
registering to Weblate and starting a new language translation at
https://hosted.weblate.org/projects/git-manpages/translations/
Translation Process Flow
------------------------
The overall data-flow looks like this:
+-------------------+ +------------------+
| Git source code | ---(1)---> | L10n coordinator |
| repository | <---(4)--- | repository |
+-------------------+ +------------------+
| ^
(2) (3)
V |
+------------------+
| Language Team XX |
+------------------+
* The original documentation files are updated by the development team
* L10n coordinator pulls from the source (1) and updates the local
documentation source files and the message template
po/documentation.pot, and merges the changes into all
po/documentation.XX.po files
* Language team pulls from L10n coordinator (2)
* Language team updates the message file documentation.XX.po (2)
* L10n coordinator pulls from Language team (3)
* L10n coordinator asks the result to be integrated (4).
Maintaining the documentation.pot file
--------------------------------------
(This is done by the documentation l10n coordinator).
The documentation.pot file contains a message catalog extracted from
Git's documentation sources. The l10n coordinator maintains it by
adding new translations or update existing ones with po4a(1). In
order to update the document sources to extract the messages from, the
l10n coordinator is expected to pull from the main git repository at
strategic point in history (e.g. when a major release and release
candidates are tagged), and then run "make update-sources" at the
top-level directory.
Language contributors use this file to prepare translations for their
language, but they are not expected to modify it.
Initializing a documentation.XX.po file
---------------------------------------
(This is done by the language teams).
If your language XX does not have translated message file
documentation.XX.po yet, you add a translation for the first time by
* initializing the translation po file by running:
msginit --local=XX
in the po/directory, where XX is the locale, e.g. "de", "is", "pt_BR",
"zh_CN", etc.
* pre-translating the file for unchanged strings by running:
scripts/pre-translate-po po/documentation.XX.po
A file po/documentation.XX.po was created, corresponding
to the newly created translation and is ready for your translations.
Then edit the automatically generated copyright info in your new
documentation.XX.po to be correct, e.g. for Icelandic:
@@ -1,6 +1,6 @@
-# Icelandic translations for PACKAGE package.
-# Copyright (C) 2010 THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
+# Icelandic translations for Git documentation.
+# Copyright (C) 2010 Ævar Arnfjörð Bjarmason <avarab@gmail.com>
+# This file is distributed under the same license as the Git package.
# Ævar Arnfjörð Bjarmason <avarab@gmail.com>, 2010.
And change references to PACKAGE VERSION in the PO Header Entry to
just "Git Documentation":
perl -pi -e 's/(?<="Project-Id-Version: )PACKAGE VERSION/Git
Documentation/' documentation.XX.po
Once you are done testing the translation (see below), commit the
documentation.XX.po files and ask the l10n coordinator to pull from you.
Updating a documentation.XX.po file
-----------------------------------
(This is done by the language teams).
If you are replacing translation strings in an existing
documentation.XX.po file to improve the translation, just edit the
file.
If there's an existing documentation.XX.po file for your language, but
the repository of the l10n coordinator has newer documentation.pot
file, chances are the upstreamed documentation.XX.po already includes the
changes of the new version.
Once you are done testing the translation (see below), commit the result
and ask the l10n coordinator to pull from you.
Testing your changes
--------------------
(This is done by the language teams, after creating or updating
documentation.XX.po file).
Before being able to compile the documents, you need to have a working
compilation toolchain which you can get by running:
$ sh ci/install_po4a.sh # install a patched version of po4a
$ bundle install # install asciidoctor
Before you submit your changes do:
$ bundle exec make all
On systems with GNU gettext (i.e. not Solaris) and po4a this will try
to merge translations with the source asciidoc files into translated
asciidoc files and compile them to manpages.
Then you can check the translated manpages, for instance for `git add`
in French:
$ man -l fr/git-add.1
and verify how your translated manpage is rendered.