From ab05a3785f29cc4b754e17c53bfb3d8ba054563e Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 4 Oct 2022 00:00:00 -0500 Subject: [PATCH] top: fix a flaw in excluding a string from translation In that commit referenced below, I removed the command line help text from any translation so the TP wouldn't delay our 4.0.1 release any further. In looking to the future, when we might be able to reverse that, I found gettext tools blocking use of the compile conditional. They are too primitive for the original approach so we must modify that exclusion mechanism hack accordingly. ____________________________excerpted program comments The provision excluding some strings is intended to be used very sparingly. It exists in case we collide with some translation project person in a position to delay a future release over his or her personal preferences. If it's ever enabled, it will produce a fatal compiler error as our only option since those gettext tools are far too primitive to be influenced with a conditional. They always ignore a '_X()' macro no matter its state. Reference(s): commit 8a368bfb05a978a9904647f128dec8f1c4d4cc84 Signed-off-by: Jim Warner --- src/top/top_nls.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/top/top_nls.c b/src/top/top_nls.c index 6dde0258..84d8acd1 100644 --- a/src/top/top_nls.c +++ b/src/top/top_nls.c @@ -28,16 +28,23 @@ #include #endif + /* * The provision excluding some strings is intended to be * used very sparingly. It exists in case we collide with * some translation project person in a position to delay * a future release over his or her personal preferences. - * (it's currently used only on v4.0.1 command line help) */ -#ifdef NLS_INCLUDED -# define _X(str) _(str) -#else + * + * If it's ever enabled, it will produce a fatal compiler + * error as our only option since those gettext tools are + * far too primitive to be influenced with a conditional. + * They always ignore a '_X()' macro no matter its state. */ + +#ifndef NLS_INCLUDED # define _X(str) (str) +#else +# define _X(str) +# error instead of this #define, restore the true gettext macro(s) #endif // Programmer Note(s):