Hello,
While messing around with NLS under Make for commit [1], I noticed in the Ninja manual [2] that apparently calling the
i18n.gettext()function generates a few "hidden" targets -- most notably, things like <module>-update-po and
<module>-pottargets. These would presumably be used to build the POT and update the PO files fresh, using the source
files. And you know what? It works! I tried this:
$ ninja --verbose postgres-19-pot
[0/1] /usr/bin/meson --internal gettext pot --pkgname=postgres-19
--source-root=/mnt/crypthome/alvherre/Code/pgsql/source/master/--subdir=src/backend/po --xgettext=/usr/bin/xgettext
Could not find file POTFILES in /mnt/crypthome/alvherre/Code/pgsql/source/master/src/backend/po
FAILED: meson-internal__postgres-19-pot
/usr/bin/meson --internal gettext pot --pkgname=postgres-19
--source-root=/mnt/crypthome/alvherre/Code/pgsql/source/master/--subdir=src/backend/po --xgettext=/usr/bin/xgettext
ninja: build stopped: subcommand failed.
I mean, it doesn't _actually_ work, but AFAICS we're quite close, we just need to populate a src/backend/po/POTFILES
file.One way might be by looking at the recipe used by src/backend/nls.mk,
find src/backend src/common src/port src/include/ \( -name '*.c' -o -name "proctypelist.h" \) -print | LC_ALL=C sort
>src/backend/po/POTFILES
Then running "ninja postgres-19.pot" works (no promises on its contents though, I think it's quite bogus). Something to
playwith, if anyone gets any round tuits.
[1] https://git.postgresql.org/cgit/postgresql.git/commit/?id=dbf8cfb4f02eb9ec5525de1761675f9babfd30e3
[2] https://mesonbuild.com/i18n-module.html
--
Álvaro Herrera