@@ -40,6 +40,30 @@ language, so that the l10n coordinator only needs to interact with one
40
40
person per language.
41
41
42
42
43
+ Core translation
44
+ ----------------
45
+ The core translation is the smallest set of work that must be completed
46
+ for a new language translation. Because there are more than 5000 messages
47
+ in the template message file "po/git.pot" that need to be translated,
48
+ this is not a piece of cake for the contributor for a new language.
49
+
50
+ The core template message file which contains a small set of messages
51
+ will be generated in "po-core/core.pot" automatically by running a helper
52
+ program named "git-po-helper" (described later).
53
+
54
+ git-po-helper init --core XX.po
55
+
56
+ After translating the generated "po-core/XX.po", you can merge it to
57
+ "po/XX.po" using the following commands:
58
+
59
+ msgcat po-core/XX.po po/XX.po -s -o /tmp/XX.po
60
+ mv /tmp/XX.po po/XX.po
61
+ git-po-helper update XX.po
62
+
63
+ Edit "po/XX.po" by hand to fix "fuzzy" messages, which may have misplaced
64
+ translated messages and duplicate messages.
65
+
66
+
43
67
Translation Process Flow
44
68
------------------------
45
69
The overall data-flow looks like this:
@@ -135,6 +159,18 @@ in the po/ directory, where XX.po is the file you want to update.
135
159
Once you are done testing the translation (see below), commit the result
136
160
and ask the l10n coordinator to pull from you.
137
161
162
+ Fuzzy translation
163
+ -----------------
164
+
165
+ Fuzzy translation is a translation marked by comment "fuzzy" to let you
166
+ know that the translation is out of date because the "msgid" has been
167
+ changed. A fuzzy translation will be ignored when compiling using "msgfmt".
168
+ Fuzzy translation can be marked by hands, but for most cases they are
169
+ marked automatically when running "msgmerge" to update your "XX.po" file.
170
+
171
+ After fixing the corresponding translation, you must remove the "fuzzy"
172
+ tag in the comment.
173
+
138
174
139
175
Testing your changes
140
176
--------------------
@@ -286,3 +322,80 @@ Testing marked strings
286
322
287
323
Git's tests are run under LANG=C LC_ALL=C. So the tests do not need be
288
324
changed to account for translations as they're added.
325
+
326
+
327
+ PO helper
328
+ ---------
329
+
330
+ To make the maintenance of XX.po easier, the l10n coordinator and l10n
331
+ team leaders can use a helper program named "git-po-helper". It is a
332
+ wrapper to gettext suite, specifically written for the purpose of Git
333
+ l10n workflow.
334
+
335
+ To build and install the helper program from source, see
336
+ [ git-po-helper/README] [ ] .
337
+
338
+ Usage for git-po-helper:
339
+
340
+ - To start a new language translation:
341
+
342
+ git-po-helper init XX.po
343
+
344
+ - To update your XX.po file:
345
+
346
+ git-po-helper update XX.po
347
+
348
+ - To check commit log and syntax of XX.po:
349
+
350
+ git-po-helper check-po XX.po
351
+ git-po-helper check-commits
352
+
353
+ Run "git-po-helper" without arguments to show usage.
354
+
355
+
356
+ Conventions
357
+ -----------
358
+
359
+ There are some conventions that l10n contributors must follow:
360
+
361
+ 1 . The subject of each l10n commit should be prefixed with "l10n: ".
362
+ 2 . Do not use non-ASCII characters in the subject of a commit.
363
+ 3 . The length of commit subject (first line of the commit log) should
364
+ be less than 50 characters, and the length of other lines of the
365
+ commit log should be no more than 72 characters.
366
+ 4 . Add "Signed-off-by" trailer to your commit log, like other commits
367
+ in Git. You can automatically add the trailer by committing with
368
+ the following command:
369
+
370
+ git commit -s
371
+
372
+ 5 . Check syntax with "msgfmt" or the following command before creating
373
+ your commit:
374
+
375
+ git-po-helper check-po <XX.po>
376
+
377
+ 6 . Squash trivial commits to make history clear.
378
+ 7 . DO NOT edit files outside "po/" directory.
379
+ 8 . Other subsystems ("git-gui", "gitk", and Git itself) have their
380
+ own workflow. See [ Documentation/SubmittingPatches] [ ] for
381
+ instructions on how to contribute patches to these subsystems.
382
+
383
+ To contribute for a new l10n language, contributor should follow
384
+ additional conventions:
385
+
386
+ 1 . Initialize proper filename of the "XX.po" file conforming to
387
+ iso-639 and iso-3166.
388
+ 2 . Must complete a minimal translation based on the "po-core/core.pot"
389
+ template. Using the following command to initialize the minimal
390
+ "po-core/XX.po" file:
391
+
392
+ git-po-helper init --core <your-language>
393
+
394
+ 3 . Add a new entry in the "po/TEAMS" file with proper format, and check
395
+ the syntax of "po/TEAMS" by runnning the following command:
396
+
397
+ git-po-helper team --check
398
+
399
+
400
+ [ git-po-helper/README ] : https://github.com/git-l10n/git-po-helper#readme
401
+ [ Documentation/SubmittingPatches ] : Documentation/SubmittingPatches
0 commit comments