]> granicus.if.org Git - procps-ng/commitdiff
top: fix a flaw in excluding a string from translation
authorJim Warner <james.warner@comcast.net>
Tue, 4 Oct 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Thu, 6 Oct 2022 11:05:36 +0000 (22:05 +1100)
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 <james.warner@comcast.net>
src/top/top_nls.c

index 6dde025820a8db6601de090f6c4fa70ad9ec1772..84d8acd1b53652d5bbf9a800c22ed18aa4fb4aa1 100644 (file)
 #include <stdlib.h>
 #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):