From 2a4fe76e65a66a71939150e61c6e4021587b478b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Oct 2026 20:50:49 +0000 Subject: [PATCH 1/3] libvector: Use the same plural string for vertices registered in build_sfa.c The message "One vertex registered" is used in build_nat.c with the plural "%" PRId64 " vertices registered" and in build_sfa.c with "%d vertices registered". A .pot file keeps only one plural form per singular msgid, and xgettext keeps the first one it reads. The input file list comes from find, whose order is not stable, so the template flipped between the two forms from one update to the next. Each flip changed the msgid and made the existing translations fuzzy. Use the 64-bit form in build_sfa.c as well, casting the int counters, so all three call sites share one msgid_plural. Prepared with AI assistance (Claude Code); the root cause was found from the history of locale/templates/grasslibs.pot. Co-Authored-By: Claude Sonnet 5.5 --- lib/vector/Vlib/build_sfa.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/vector/Vlib/build_sfa.c b/lib/vector/Vlib/build_sfa.c index 9b34d374810..49b1652f2d8 100644 --- a/lib/vector/Vlib/build_sfa.c +++ b/lib/vector/Vlib/build_sfa.c @@ -17,6 +17,7 @@ \author Various updates for GRASS 7 by Martin Landa */ +#include #include #include @@ -374,8 +375,9 @@ void build_pg(struct Map_info *Map, int build) G_message(n_("One primitive registered", "%d primitives registered", Map->plus.n_lines), Map->plus.n_lines); - G_message(n_("One vertex registered", "%d vertices registered", npoints), - npoints); + G_message(n_("One vertex registered", "%" PRId64 " vertices registered", + (grass_int64)npoints), + (grass_int64)npoints); Map->plus.built = GV_BUILD_BASE; @@ -660,8 +662,9 @@ void build_ogr(struct Map_info *Map, int build) G_message(n_("One primitive registered", "%d primitives registered", Map->plus.n_lines), Map->plus.n_lines); - G_message(n_("One vertex registered", "%d vertices registered", npoints), - npoints); + G_message(n_("One vertex registered", "%" PRId64 " vertices registered", + (grass_int64)npoints), + (grass_int64)npoints); if (nskipped > 0) G_warning(n_("One feature without geometry skipped", From b56281768fc09d422831d4fb63a8c03feef916ed Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Oct 2026 20:53:05 +0000 Subject: [PATCH 2/3] locale: Sort the input file lists for xgettext The lists of files given to xgettext come from find, whose order depends on the filesystem and can differ between runners. When the same msgid is used with different plural forms, xgettext keeps the first one it reads, so the generated .pot files could change without any change in the code. Sort the lists with LC_ALL=C so that the order is the same everywhere. Prepared with AI assistance (Claude Code). Co-Authored-By: Claude Sonnet 5.5 --- locale/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/Makefile b/locale/Makefile index 6c5df6a7567..d60b091b680 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -31,11 +31,11 @@ MODDOMAIN = grassmods WXPYDOMAIN = grasswxpy DOMAINS = $(LIBDOMAIN) $(MODDOMAIN) $(WXPYDOMAIN) -LIB_POTFILES = find ../lib \( -name "*.c" -o -name "*.py" \) | xargs grep -l "_(\"\|n_(\"" -MOD_POTFILES = find ../ \( -name "*.c" -o -name "*.cpp" \) | grep -v '../lib' | xargs grep -l "_(\"\|n_(\"" -WXPY_POTFILES = find ../gui/wxpython -name '*.py' | xargs grep -l "_(\"\|n_(\"" +LIB_POTFILES = find ../lib \( -name "*.c" -o -name "*.py" \) | LC_ALL=C sort | xargs grep -l "_(\"\|n_(\"" +MOD_POTFILES = find ../ \( -name "*.c" -o -name "*.cpp" \) | grep -v '../lib' | LC_ALL=C sort | xargs grep -l "_(\"\|n_(\"" +WXPY_POTFILES = find ../gui/wxpython -name '*.py' | LC_ALL=C sort | xargs grep -l "_(\"\|n_(\"" #For Python script module messages -MOD_PYFILES = find ../scripts -name '*.py' | xargs grep -l "_(\"\|n_(\"" +MOD_PYFILES = find ../scripts -name '*.py' | LC_ALL=C sort | xargs grep -l "_(\"\|n_(\"" XGETTEXT_ARGS = --no-wrap --sort-by-file MSGMERGE_ARGS = --no-wrap --sort-by-file --previous From 50e84cbf11e16c52e6c8e416834718fe8223ca3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Mon, 5 Oct 2026 09:47:04 -0400 Subject: [PATCH 3/3] Apply batched suggestions from code review Co-authored-by: Nicklas Larsson --- lib/vector/Vlib/build_sfa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/vector/Vlib/build_sfa.c b/lib/vector/Vlib/build_sfa.c index 49b1652f2d8..5eec69f4f57 100644 --- a/lib/vector/Vlib/build_sfa.c +++ b/lib/vector/Vlib/build_sfa.c @@ -376,8 +376,8 @@ void build_pg(struct Map_info *Map, int build) Map->plus.n_lines), Map->plus.n_lines); G_message(n_("One vertex registered", "%" PRId64 " vertices registered", - (grass_int64)npoints), - (grass_int64)npoints); + (int64_t)npoints), + (int64_t)npoints); Map->plus.built = GV_BUILD_BASE; @@ -663,8 +663,8 @@ void build_ogr(struct Map_info *Map, int build) Map->plus.n_lines), Map->plus.n_lines); G_message(n_("One vertex registered", "%" PRId64 " vertices registered", - (grass_int64)npoints), - (grass_int64)npoints); + (int64_t)npoints), + (int64_t)npoints); if (nskipped > 0) G_warning(n_("One feature without geometry skipped",