summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Warner <james.warner@comcast.net>2022-10-01 00:00:00 -0500
committerCraig Small <csmall@dropbear.xyz>2022-10-04 10:57:34 +1100
commit8a368bfb05a978a9904647f128dec8f1c4d4cc84 (patch)
treecdad11a099cae35da365f82b376d70eda8450c77 /src
parentc7568b28fbca2d808e8773c1db939fddf2d00f8a (diff)
downloadprocps-ng-8a368bfb05a978a9904647f128dec8f1c4d4cc84.tar.gz
top: enable exclusion of some strings from translation
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) Signed-off-by: Jim Warner <james.warner@comcast.net>
Diffstat (limited to 'src')
-rw-r--r--src/top/top.h3
-rw-r--r--src/top/top_nls.c20
2 files changed, 18 insertions, 5 deletions
diff --git a/src/top/top.h b/src/top/top.h
index 1792002..937152b 100644
--- a/src/top/top.h
+++ b/src/top/top.h
@@ -42,6 +42,8 @@
//#define INSP_SAVEBUF /* preserve 'Insp_buf' contents via a file */
//#define INSP_SLIDE_1 /* when scrolling left/right, don't move 8 */
//#define MEMGRAPH_OLD /* don't use 'available' when graphing Mem */
+//#define NLS_INCLUDED /* provides for excluding from translation */
+//#define NLS_VALIDATE /* ensure the integrity of four nls tables */
//#define OFF_SCROLLBK /* disable tty emulators scrollback buffer */
//#define OFF_STDERROR /* disable our stderr buffering (redirect) */
//#define OFF_STDIOLBF /* disable our own stdout 'IOFBF' override */
@@ -74,7 +76,6 @@
//#define TREE_VPROMPT /* pid collapse/expand prompt, vs. top row */
//#define TREE_VWINALL /* pid collapse/expand impacts all windows */
//#define USE_X_COLHDR /* emphasize header vs. whole col, for 'x' */
-//#define VALIDATE_NLS /* ensure the integrity of four nls tables */
//#define WIDEN_COLUMN /* base column widths on translated header */
diff --git a/src/top/top_nls.c b/src/top/top_nls.c
index 869a88c..6dde025 100644
--- a/src/top/top_nls.c
+++ b/src/top/top_nls.c
@@ -24,10 +24,22 @@
#include "top.h"
#include "top_nls.h"
-#ifdef VALIDATE_NLS
+#ifdef NLS_VALIDATE
#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
+# define _X(str) (str)
+#endif
+
// Programmer Note(s):
// Preparation ---------------------------------------------
// Unless you have *something* following the gettext macro,
@@ -393,7 +405,7 @@ static void build_norm_nlstab (void) {
Norm_nlstab[WRONG_switch_fmt] = _(""
"inappropriate '%s'\n"
"Usage:\n %s%s");
- Norm_nlstab[HELP_cmdline_fmt] = _("\n"
+ Norm_nlstab[HELP_cmdline_fmt] = _X("\n"
"Usage:\n"
" %s [options]\n"
"\n"
@@ -787,7 +799,7 @@ static void build_uniq_nlstab (void) {
/*
* This function must be called very early at startup, before
* any other function call, and especially before any changes
- * have been made to the terminal if VALIDATE_NLS is defined!
+ * have been made to the terminal if NLS_VALIDATE is defined!
*
* The gettext documentation suggests that alone among locale
* variables LANGUAGE=ll_CC may be abbreviated as LANGUAGE=ll
@@ -804,7 +816,7 @@ static void build_uniq_nlstab (void) {
* enable any translations.
*/
void initialize_nls (void) {
-#ifdef VALIDATE_NLS
+#ifdef NLS_VALIDATE
static const char *nls_err ="\t%s_nlstab[%d] == NULL\n";
int i;