On Mon, May 23, 2022 at 3:25 PM Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> wrote: > > > On Mon, May 23 2022, Jiang Xin wrote: > > > From: Jiang Xin <zhiyou.jx@xxxxxxxxxxxxxxx> > > > > A workflow change for translators are being proposed. > > > > Changes since v2: > > > > 1. Patch 1/9: reword. > > 2. Patch 2/9: reword. > > 3. Patch 3/9: reword, and add "FORCE" to prerequisites of "po/git.pot". > > 4. Patch 6/9: remove "FORCE" from prerequisites of "po/git.pot". > > 5. Patch 8/9: reword, and reuse "$(gen_pot_header)" to prepare pot > > header for "po/git-core.pot". > > 6. Patch 9/9: various updates on po/README.md. > > From skimming this the *.c.po v.s. *.c extension is still left in > comments. I'm not saying you need to go for my suggestions, but it would > be very useful in CL's to note things that were suggested but not > changed, such as that. I've tried to improve some commit logs to make my point that we should name the po files in ".build/po/" with ".po" extension instead of ".c" extension. We can choose plan A, move forward with this patch series, and start using the new workflow in 2.37. If you want, we can try Plan B during next release cycle. > Right now I haven't paged that v2 discussion into my brain again, so I > don't know if that was the only thing, it's the only thing I remember > right now... > > But let's read on: > > > Range-diff vs v2: > > > > 1: c45f34f233 ! 1: 362cd0cbe1 Makefile: sort "po/git.pot" by file location > > @@ Metadata > > ## Commit message ## > > Makefile: sort "po/git.pot" by file location > > > > - Before feeding xgettext with more C souce files which may be ignored > > - by various compiler conditions, add new option "--sort-by-file" to > > - xgettext program to create stable message template file "po/git.pot". > > + We will feed xgettext with more C souce files and in different order in > > + subsequent commit. To generate a stable "po/git.pot" regardless of the > > + number and order of input source files, we add a new option > > + "--sort-by-file" to xgettext program. > > > > With this update, the newly generated "po/git.pot" will has the same > > - entries while in a different order. We won't checkin the newly generated > > - "po/git.pot", because we will remove it from tree in a later commit. > > + entries while in a different order. > > + > > + With the help of a custom diff driver as shown below, > > + > > + git config --global diff.gettext-fmt.textconv \ > > + "msgcat --no-location --sort-by-file" > > + > > + and appending a new entry "*.po diff=gettext-fmt" to git attributes, > > + we can see that there are no substantial changes in "po/git.pot". > > + > > + We won't checkin the newly generated "po/git.pot", because we will > > + remove it from tree in a later commit. > > > Does this actually work? This seems to suggest adding a driver for *.po, > but using it against the *.pot file. Isn't that a typo (I haven't tested > it)> Thanks, it's really a typo. s/*.po/*.pot/ > > > But it is much simpler to use variables "$(FOUND_C_SOURCES)" and > > - "$(FOUND_C_SOURCES)" to form a stable "LOCALIZED_C". > > + "$(FOUND_C_SOURCES)" to form a stable "LOCALIZED_C". We also add > > + "$(SCALAR_SOURCES)" files, which are part of C_OBJ but not included in > > + "$(FOUND_C_SOURCES)" because they are in the "contrib/" directory. > > Thanks, good to note that. > > [snipped the rest, will re-read individual commits]