git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jiang Xin <worldhello.net@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Git List" <git@vger.kernel.org>
Cc: "Alexander Shopov" <ash@kambanaria.org>,
	"Jordi Mas" <jmas@softcatala.org>,
	"Matthias Rüster" <matthias.ruester@gmail.com>,
	"Jimmy Angelakos" <vyruss@hellug.gr>,
	"Christopher Díaz" <christopher.diaz.riv@gmail.com>,
	"Jean-Noël Avila" <jn.avila@free.fr>,
	"Bagas Sanjaya" <bagasdotme@gmail.com>,
	"Alessandro Menti" <alessandro.menti@alessandromenti.it>,
	"Gwan-gyeong Mun" <elongbug@gmail.com>, Arusekk <arek_koz@o2.pl>,
	"Daniel Santos" <dacs.git@brilhante.top>,
	"Dimitriy Ryazantcev" <DJm00n@mail.ru>,
	"Peter Krefting" <peter@softwolves.pp.se>,
	"Emir SARI" <bitigchi@me.com>,
	"Trần Ngọc Quân" <vnwildman@gmail.com>,
	"Fangyi Zhou" <me@fangyi.io>, "Yi-Jyun Pan" <pan93412@gmail.com>,
	"Jiang Xin" <zhiyou.jx@alibaba-inc.com>
Subject: [PATCH 9/9] l10n: Document the new l10n workflow
Date: Tue,  3 May 2022 21:23:54 +0800	[thread overview]
Message-ID: <20220503132354.9567-10-worldhello.net@gmail.com> (raw)
In-Reply-To: <20220503132354.9567-1-worldhello.net@gmail.com>

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

Change the "flow" of how translators interact with the l10n repository
at [1] to adjust it for a new workflow of not having a po/git.pot file
in-tree at all, and to not commit line numbers to the po/*.po files
that we do track in tree.

The current workflow was added in a combination of dce37b66fb0 (l10n:
initial git.pot for 1.7.10 upcoming release, 2012-02-13) and
271ce198cd0 (Update l10n guide, 2012-02-29).

As noted in preceding commits I think that it came about due to
technical debt I'd left behind in how the "po/git.pot" file was
created, and a mis-impression that the file:line comments were needed
as anything more than a transitory translation aid.

As the updated po/README.md shows the new workflow is substantially
the same, the difference is that translators no longer need to
initially pull from the l10n coordinator for a new po/git.pot, they
can simply use git.git's canonical source repository.

The l10n coordinator is still expected to announce a release to
translate, which presumably would always be Junio's latest release
tag. I'm not certain if this part of the process is actually
important. I.e. the delta translation-wise between that tag and
"master" is usually pretty small, so perhaps translators can just work
on "master" instead.

1. https://github.com/git-l10n/git-po/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
---
 po/README.md | 191 ++++++++++++++++++++++++---------------------------
 1 file changed, 88 insertions(+), 103 deletions(-)

diff --git a/po/README.md b/po/README.md
index 19fabb4acf..00c090e7c0 100644
--- a/po/README.md
+++ b/po/README.md
@@ -46,65 +46,67 @@ for a new language translation. Because there are more than 5000 messages
 in the template message file "po/git.pot" that need to be translated,
 this is not a piece of cake for the contributor for a new language.
 
-The core template message file which contains a small set of messages
-will be generated in "po-core/core.pot" automatically by running a helper
-program named "git-po-helper" (described later).
+The "core" set of messages can be generated at "po/git-core.pot" by
+running:
 
 ```shell
-git-po-helper init --core XX.po
+make core-pot
 ```
 
-After translating the generated "po-core/XX.po", you can merge it to
-"po/XX.po" using the following commands:
-
-```shell
-msgcat po-core/XX.po po/XX.po -s -o /tmp/XX.po
-mv /tmp/XX.po po/XX.po
-git-po-helper update XX.po
-```
-
-Edit "po/XX.po" by hand to fix "fuzzy" messages, which may have misplaced
-translated messages and duplicate messages.
+And then proceeding with the rest of these instructions on the new
+generated "po/git-core.pot" file.
 
 
 ## 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 |
-                                     +------------------+
+    +-------------------+             +------------------+
+    | Git source code   | ----(2)---> | L10n coordinator |
+    | repository        | <---(5)---- | repository       |
+    +-------------------+             +------------------+
+                    |                     |    ^
+                   (1)                   (3)  (4)
+                    V                     v    |
+               +----------------------------------+
+               |        Language Team XX          |
+               +----------------------------------+
 
 - Translatable strings are marked in the source file.
-- L10n coordinator pulls from the source (1)
-- L10n coordinator updates the message template "po/git.pot"
-- Language team pulls from L10n coordinator (2)
-- Language team updates the message file "po/XX.po"
-- L10n coordinator pulls from Language team (3)
-- L10n coordinator asks the result to be pulled (4).
+- Language teams can start translation iterations at any time, even
+  before the l10n window opens:
+
+  + Pull from the source (1)
+  + Update the message file by running "make po-update PO\_FILE=po/XX.po"
+  + Translate the message file "po/XX.po"
 
+- The L10n coordinator pulls from source and announces the l10n window
+  open (2)
+- Language team pulls from the l10n coordinator, starts another
+  translation iteration against the l10n coordinator's tree (3)
 
-## Maintaining the "po/git.pot" file
+  + Run "git pull --rebase" from the l10n coordinator
+  + Update the message file by running "make po-update PO\_FILE=po/XX.po"
+  + Translate the message file "po/XX.po"
+  + Squash trivial l10n git commits using "git rebase -i"
 
-(This is done by the l10n coordinator).
+- Language team sends pull request to the l10n coordinator (4)
+- L10n coordinator checks and merges
+- L10n coordinator asks the result to be pulled (5).
 
-The "po/git.pot" file contains a message catalog extracted from Git's
-sources. The l10n coordinator maintains it by adding new translations with
-msginit(1), or update existing ones with msgmerge(1).  In order to update
-the Git 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 pot" at the top-level directory.
 
-Language contributors use this file to prepare translations for their
-language, but they are not expected to modify it.
+## Creating the "po/git.pot" file
+
+The "po/git.pot" file, once generated by the the l10n coordinator had
+been removed from the tree. L10n contributors can generated it at
+runtime using command:
+
+```shell
+make pot
+```
+
+Then language contributors use this file to prepare translations for
+their language, but they are not expected to modify it.
 
 
 ## Initializing a "XX.po" file
@@ -115,32 +117,14 @@ If your language XX does not have translated message file "po/XX.po" yet,
 you add a translation for the first time by running:
 
 ```shell
-msginit --locale=XX
-```
-
-in the "po/" directory, where XX is the locale, e.g. "de", "is", "pt\_BR",
-"zh\_CN", etc.
-
-Then edit the automatically generated copyright info in your new "XX.po"
-to be correct, e.g. for Icelandic:
-
-```diff
-@@ -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.
-+# 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.
+make po-init PO_FILE=po/XX.po
 ```
 
-And change references to PACKAGE VERSION in the PO Header Entry to
-just "Git":
+Where XX is the locale, e.g. "de", "is", "pt\_BR", "zh\_CN", etc.
 
-```shell
-perl -pi -e 's/(?<="Project-Id-Version: )PACKAGE VERSION/Git/' XX.po
-```
+The newly generated message file "po/XX.po" is based on the core pot
+file "po/git-core.pot", so it contains only a minimal set of messages
+and it's a good start for a new language contribution.
 
 Once you are done testing the translation (see below), commit the result
 and ask the l10n coordinator to pull from you.
@@ -153,19 +137,40 @@ and ask the l10n coordinator to pull from you.
 If you are replacing translation strings in an existing "XX.po" file to
 improve the translation, just edit the file.
 
-If there's an existing "XX.po" file for your language, but the repository
-of the l10n coordinator has newer "po/git.pot" file, you would need to first
-pull from the l10n coordinator (see the beginning of this document for its
-URL), and then update the existing translation by running:
+If you want to find new translatable strings in source files of upstream
+repository and propagate them to your "po/XX.po", run command:
 
 ```shell
-msgmerge --add-location --backup=off -U XX.po git.pot
+make po-update PO_FILE=po/XX.po
 ```
 
-in the "po/" directory, where "XX.po" is the file you want to update.
+It will:
 
-Once you are done testing the translation (see below), commit the result
-and ask the l10n coordinator to pull from you.
+- Call "make pot" at runtime to generate new "po/git.pot" file
+- Call "msgmerge --add-location --backup=off -U po/XX.po po/git.pot"
+  to update your "po/XX.po"
+- The "--add-location" option for msgmerge will add location lines,
+  and these location lines will help translation tools to location
+  translation context easily.
+
+Once you are done testing the translation (see below), it's better
+to commit a location-less "po/XX.po" file to save repository space
+and make a user-friendly patch for review.
+
+To save a location-less "po/XX.po" automatically in repository, you
+can:
+
+- Define new attribute for "po/XX.po" by adding new line in
+  ".git/info/attributes":
+
+        /po/XX.po filter=gettext-no-location
+
+- Define driver for "gettext-no-location" filter:
+
+        $ git config --global filter.gettext-no-location.clean \
+              "msgcat --no-location -"
+
+You're now ready to ask the l10n coordinator to pull from you.
 
 
 ## Fuzzy translation
@@ -196,6 +201,14 @@ common errors, e.g. missing printf format strings, or translated
 messages that deviate from the originals in whether they begin/end
 with a newline or not.
 
+L10n coordinator will check your contributions using a helper program
+(see "PO helper" section below):
+
+```shell
+git-po-helper check-po po/XX.po
+git-po-helper check-commits <rev-list-opts>
+```
+
 
 ## Marking strings for translation
 
@@ -370,29 +383,6 @@ l10n workflow.
 To build and install the helper program from source, see
 [git-po-helper/README][].
 
-Usage for git-po-helper:
-
-- To start a new language translation:
-
-  ```shell
-  git-po-helper init XX.po
-  ```
-
-- To update your "XX.po" file:
-
-  ```shell
-  git-po-helper update XX.po
-  ```
-
-- To check commit log and syntax of "XX.po":
-
-  ```shell
-  git-po-helper check-po XX.po
-  git-po-helper check-commits
-  ```
-
-Run "git-po-helper" without arguments to show usage.
-
 
 ## Conventions
 
@@ -436,13 +426,8 @@ additional conventions:
 - Initialize proper filename of the "XX.po" file conforming to
   iso-639 and iso-3166.
 
-- Must complete a minimal translation based on the "po-core/core.pot"
-  template. Using the following command to initialize the minimal
-  "po-core/XX.po" file:
-
-  ```shell
-  git-po-helper init --core <your-language>
-  ```
+- Must complete a minimal translation based on the "Core
+  translation". See that section above.
 
 - Add a new entry in the "po/TEAMS" file with proper format, and check
   the syntax of "po/TEAMS" by running the following command:
-- 
2.35.1.577.g74cc1aa55f


  parent reply	other threads:[~2022-05-03 13:25 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 13:23 [PATCH 0/9] Incremental po/git.pot update and new l10n workflow Jiang Xin
2022-05-03 13:23 ` [PATCH 1/9] Makefile: sort "po/git.pot" by file location Jiang Xin
2022-05-03 13:23 ` [PATCH 2/9] Makefile: generate "po/git.pot" from stable LOCALIZED_C Jiang Xin
2022-05-03 13:23 ` [PATCH 3/9] Makefile: have "make pot" not "reset --hard" Jiang Xin
2022-05-03 13:23 ` [PATCH 4/9] i18n CI: stop allowing non-ASCII source messages in po/git.pot Jiang Xin
2022-05-03 13:23 ` [PATCH 5/9] po/git.pot: don't check in result of "make pot" Jiang Xin
2022-05-03 13:23 ` [PATCH 6/9] po/git.pot: remove this now generated file, see preceding commit Jiang Xin
2022-05-03 13:23 ` [PATCH 7/9] Makefile: add "po-update" rule to update po/XX.po Jiang Xin
2022-05-03 13:23 ` [PATCH 8/9] Makefile: add "po-init" rule to initialize po/XX.po Jiang Xin
2022-05-03 13:23 ` Jiang Xin [this message]
2022-05-03 14:07 ` [PATCH 0/9] Incremental po/git.pot update and new l10n workflow Peter Krefting
2022-05-04 12:41   ` Jiang Xin
2022-05-04 14:35 ` Junio C Hamano
2022-05-04 14:51   ` Daniel Santos
2022-05-05  0:20     ` Jiang Xin
2022-05-05 22:00       ` Daniel Santos
2022-05-05 22:49         ` Junio C Hamano
2022-05-06  0:50         ` Jiang Xin
2022-05-05  0:07   ` Jiang Xin
2022-05-04 17:58 ` Junio C Hamano
2022-05-19  8:15 ` [PATCH v2 " Jiang Xin
2022-05-19 10:28   ` Ævar Arnfjörð Bjarmason
2022-05-19 14:32     ` Jiang Xin
2022-05-19 14:41       ` Ævar Arnfjörð Bjarmason
2022-05-23  1:25   ` [PATCH v3 " Jiang Xin
2022-05-23  7:15     ` Ævar Arnfjörð Bjarmason
2022-05-23  8:12       ` Ævar Arnfjörð Bjarmason
2022-05-23 13:42         ` Jiang Xin
2022-05-23 14:38           ` Ævar Arnfjörð Bjarmason
2022-05-23 16:13             ` Jiang Xin
2022-05-23  8:26       ` Jiang Xin
2022-05-23 15:21     ` [PATCH v4 " Jiang Xin
2022-05-23 18:19       ` Junio C Hamano
2022-05-26 14:50       ` [PATCH v5 00/10] " Jiang Xin
2022-05-26 14:50       ` [PATCH v5 01/10] Makefile: sort source files before feeding to xgettext Jiang Xin
2022-05-26 14:50       ` [PATCH v5 02/10] Makefile: generate "po/git.pot" from stable LOCALIZED_C Jiang Xin
2022-05-26 14:50       ` [PATCH v5 03/10] Makefile: have "make pot" not "reset --hard" Jiang Xin
2022-05-26 14:50       ` [PATCH v5 04/10] i18n CI: stop allowing non-ASCII source messages in po/git.pot Jiang Xin
2022-05-26 14:50       ` [PATCH v5 05/10] Makefile: remove duplicate and unwanted files in FOUND_SOURCE_FILES Jiang Xin
2022-05-26 14:50       ` [PATCH v5 06/10] po/git.pot: this is now a generated file Jiang Xin
2022-05-26 17:32         ` Junio C Hamano
2022-05-26 14:50       ` [PATCH v5 07/10] po/git.pot: don't check in result of "make pot" Jiang Xin
2022-05-26 14:50       ` [PATCH v5 08/10] Makefile: add "po-update" rule to update po/XX.po Jiang Xin
2022-05-26 14:50       ` [PATCH v5 09/10] Makefile: add "po-init" rule to initialize po/XX.po Jiang Xin
2022-05-26 14:50       ` [PATCH v5 10/10] l10n: Document the new l10n workflow Jiang Xin
2022-05-23 15:21     ` [PATCH v4 1/9] Makefile: sort "po/git.pot" by file location Jiang Xin
2022-05-23 15:21     ` [PATCH v4 2/9] Makefile: generate "po/git.pot" from stable LOCALIZED_C Jiang Xin
2022-05-23 15:21     ` [PATCH v4 3/9] Makefile: have "make pot" not "reset --hard" Jiang Xin
2022-05-25 22:19       ` Junio C Hamano
2022-05-25 22:24         ` Junio C Hamano
2022-05-26  1:10           ` Jiang Xin
2022-05-26  2:15           ` [PATCH] Makefile: dedup git-ls-files output to prevent duplicate targets Jiang Xin
2022-05-26  4:02             ` Junio C Hamano
2022-05-26  6:06               ` Jiang Xin
2022-05-26  6:23                 ` Junio C Hamano
2022-05-26  7:04                   ` Jiang Xin
2022-05-26 10:00                     ` Ævar Arnfjörð Bjarmason
2022-05-26 11:06                       ` Jiang Xin
2022-05-26 17:18                       ` Junio C Hamano
2022-05-26 18:25                         ` Ævar Arnfjörð Bjarmason
2022-05-26 19:00                           ` Junio C Hamano
2022-05-26 19:17                             ` Ævar Arnfjörð Bjarmason
2022-05-23 15:21     ` [PATCH v4 4/9] i18n CI: stop allowing non-ASCII source messages in po/git.pot Jiang Xin
2022-05-23 15:21     ` [PATCH v4 5/9] po/git.pot: this is now a generated file Jiang Xin
2022-05-23 15:21     ` [PATCH v4 6/9] po/git.pot: don't check in result of "make pot" Jiang Xin
2022-05-23 15:21     ` [PATCH v4 7/9] Makefile: add "po-update" rule to update po/XX.po Jiang Xin
2022-05-23 15:21     ` [PATCH v4 8/9] Makefile: add "po-init" rule to initialize po/XX.po Jiang Xin
2022-05-23 15:21     ` [PATCH v4 9/9] l10n: Document the new l10n workflow Jiang Xin
2022-05-23  1:25   ` [PATCH v3 1/9] Makefile: sort "po/git.pot" by file location Jiang Xin
2022-05-23  8:05     ` Junio C Hamano
2022-05-23  8:50       ` Jiang Xin
2022-05-23  1:25   ` [PATCH v3 2/9] Makefile: generate "po/git.pot" from stable LOCALIZED_C Jiang Xin
2022-05-23  8:05     ` Junio C Hamano
2022-05-23  1:25   ` [PATCH v3 3/9] Makefile: have "make pot" not "reset --hard" Jiang Xin
2022-05-23  7:28     ` Ævar Arnfjörð Bjarmason
2022-05-23 15:00       ` Jiang Xin
2022-05-24  0:56       ` Jiang Xin
2022-05-23  8:15     ` Junio C Hamano
2022-05-23  9:37       ` Jiang Xin
2022-05-23  1:25   ` [PATCH v3 4/9] i18n CI: stop allowing non-ASCII source messages in po/git.pot Jiang Xin
2022-05-23  1:25   ` [PATCH v3 5/9] po/git.pot: this is now a generated file Jiang Xin
2022-05-23  1:25   ` [PATCH v3 6/9] po/git.pot: don't check in result of "make pot" Jiang Xin
2022-05-23  7:26     ` Ævar Arnfjörð Bjarmason
2022-05-23  8:30       ` Jiang Xin
2022-05-23  8:35         ` Jiang Xin
2022-05-23  9:28         ` Ævar Arnfjörð Bjarmason
2022-05-23  1:25   ` [PATCH v3 7/9] Makefile: add "po-update" rule to update po/XX.po Jiang Xin
2022-05-23  1:25   ` [PATCH v3 8/9] Makefile: add "po-init" rule to initialize po/XX.po Jiang Xin
2022-05-23  1:25   ` [PATCH v3 9/9] l10n: Document the new l10n workflow Jiang Xin
2022-05-19  8:15 ` [PATCH v2 1/9] Makefile: sort "po/git.pot" by file location Jiang Xin
2022-05-19  8:53   ` Ævar Arnfjörð Bjarmason
2022-05-19 12:41     ` Jiang Xin
2022-05-19  8:15 ` [PATCH v2 2/9] Makefile: generate "po/git.pot" from stable LOCALIZED_C Jiang Xin
2022-05-19  9:18   ` Ævar Arnfjörð Bjarmason
2022-05-19 12:48     ` Jiang Xin
2022-05-19  8:15 ` [PATCH v2 3/9] Makefile: have "make pot" not "reset --hard" Jiang Xin
2022-05-19  9:43   ` Ævar Arnfjörð Bjarmason
2022-05-19 13:19     ` Jiang Xin
2022-05-19 14:06       ` Ævar Arnfjörð Bjarmason
2022-05-19  8:15 ` [PATCH v2 4/9] i18n CI: stop allowing non-ASCII source messages in po/git.pot Jiang Xin
2022-05-19 10:02   ` Ævar Arnfjörð Bjarmason
2022-05-19  8:15 ` [PATCH v2 5/9] po/git.pot: this is now a generated file Jiang Xin
2022-05-19  8:15 ` [PATCH v2 6/9] po/git.pot: don't check in result of "make pot" Jiang Xin
2022-05-19  8:15 ` [PATCH v2 7/9] Makefile: add "po-update" rule to update po/XX.po Jiang Xin
2022-05-19 10:07   ` Ævar Arnfjörð Bjarmason
2022-05-19  8:15 ` [PATCH v2 8/9] Makefile: add "po-init" rule to initialize po/XX.po Jiang Xin
2022-05-19 10:22   ` Ævar Arnfjörð Bjarmason
2022-05-19  8:15 ` [PATCH v2 9/9] l10n: Document the new l10n workflow Jiang Xin
2022-05-19 17:18   ` Junio C Hamano
2022-05-21 15:06     ` Jiang Xin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220503132354.9567-10-worldhello.net@gmail.com \
    --to=worldhello.net@gmail.com \
    --cc=DJm00n@mail.ru \
    --cc=alessandro.menti@alessandromenti.it \
    --cc=arek_koz@o2.pl \
    --cc=ash@kambanaria.org \
    --cc=avarab@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=bitigchi@me.com \
    --cc=christopher.diaz.riv@gmail.com \
    --cc=dacs.git@brilhante.top \
    --cc=elongbug@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jmas@softcatala.org \
    --cc=jn.avila@free.fr \
    --cc=matthias.ruester@gmail.com \
    --cc=me@fangyi.io \
    --cc=pan93412@gmail.com \
    --cc=peter@softwolves.pp.se \
    --cc=vnwildman@gmail.com \
    --cc=vyruss@hellug.gr \
    --cc=zhiyou.jx@alibaba-inc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).