I'm preparing to update devel/gettext to 0.22.  The gettext tools have
become more strict and no longer accept various dodgy input.

/usr/obj/xtrkcad-5.2.2/xtrkcad-source-5.2.2GA/app/i18n/fi.po:12820: 'msgstr' is 
not a valid C format string, unlike 'msgid'. Reason: In the directive number 1, 
the argument size specifier is invalid.
/usr/local/bin/msgfmt: found 1 fatal error

msgfmt complains specifically about the Finnish translation because
"% j" is not a valid printf(3) format specifier, while the "% a" of
the English text as well as those of the other translations accidentally
are.

As far as I can tell, this one and related texts strings aren't
intended as C format strings at all.  They are extracted from .xtr
files and only dumped into a custmsg.h file for the translation
tools to pick up.

In short, the briefest, if hacky fix is to remove the "c format"
marker from the rejected string in fi.po.

OK?

-----------------------------------------------
commit fdc89cfeea676b8c04373147ab8138681168fc7a (gettext)
from: Christian Weisgerber <na...@mips.inka.de>
date: Mon Sep 11 14:20:32 2023 UTC
 
 cad/xtrkcad: fix build with gettext 0.22
 
 M  cad/xtrkcad/Makefile
 A  cad/xtrkcad/patches/patch-app_i18n_fi_po

diff 0bb98a17accf9c882a24b2e40736c997021f03f9 
fdc89cfeea676b8c04373147ab8138681168fc7a
commit - 0bb98a17accf9c882a24b2e40736c997021f03f9
commit + fdc89cfeea676b8c04373147ab8138681168fc7a
blob - c0f2ea2809c11faa6dac4a3358219b751d61f193
blob + f32b845ab0687ecf926df09d7ecca0438694f21c
--- cad/xtrkcad/Makefile
+++ cad/xtrkcad/Makefile
@@ -39,4 +39,7 @@ CONFIGURE_ARGS +=     -DXTRKCAD_USE_GETTEXT=on
 CONFIGURE_ENV +=       CFLAGS=-I${PREFIX}/include \
                LDFLAGS="-pthread -L/usr/X11R6/lib -L${PREFIX}/lib -liconv 
-lintl"
 
+# patches/patch-app_i18n_fi_po
+FIX_CRLF_FILES=        ${WRKSRC}/app/i18n/fi.po
+
 .include <bsd.port.mk>
blob - /dev/null
blob + 4d0df4291446ad49274a95a35b717f849425707e (mode 644)
--- /dev/null
+++ cad/xtrkcad/patches/patch-app_i18n_fi_po
@@ -0,0 +1,13 @@
+Erroneously marked as a C format string and flagged as invalid by msgfmt.
+
+Index: app/i18n/fi.po
+--- app/i18n/fi.po.orig
++++ app/i18n/fi.po
+@@ -12813,7 +12813,6 @@ msgstr ""
+ 
+ #. i18n: C:/Users/mf/Documents/XTrackCAD/src/work/app/lib/demos/dmhelix.xtr:28
+ #: ../../../../build/work/app/i18n/custmsg.h:627
+-#, c-format
+ msgid ""
+ "We will be creating a helix with a Elevation Difference of 12\", Grade of "
+ "1.5% and limit the Vertical Separation to at least 2\".\n"

-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to