]> granicus.if.org Git - procps-ng/commitdiff
top: don't make translatable text subject to a #define <=== port of newlib b587d946
authorJim Warner <james.warner@comcast.net>
Wed, 15 Jun 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Sun, 19 Jun 2022 10:58:51 +0000 (20:58 +1000)
______________________________ original newlib message

While it is acceptable to make text usage conditional,
one must never make the text itself conditional. After
all, the translators must be presented with all of the
text so the opportunity to translate it is never lost.

[ one wonders who the idiot was that did this anyway ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c
top/top_nls.c
top/top_nls.h

index f5ef62011bcc604ccb41c833d69f56b2393b3ce2..8a152480da7a0eca5d926a2c67bb3ac256cc8a05 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -5675,7 +5675,11 @@ static void keys_global (int ch) {
          break;
       case 'Y':
          if (!Inspect.total)
-            ioline(N_txt(YINSP_noents_txt));
+#ifndef INSP_OFFDEMO
+            ioline(N_txt(YINSP_noent1_txt));
+#else
+            ioline(N_txt(YINSP_noent2_txt));
+#endif
          else {
             def = w->ppt[w->begtask]->tid;
             pid = get_int(fmtmk(N_fmt(YINSP_pidsee_fmt), def));
index f830cc62d37155599a5ae9103850cb93bf3580b4..77a8faa3a41076da800607417bacc8772854e937 100644 (file)
@@ -450,7 +450,6 @@ static void build_norm_nlstab (void) {
    Norm_nlstab[XTRA_warncfg_txt] = _("rcfile has inspect/other-filter error(s), save anyway?");
    Norm_nlstab[XTRA_badflds_fmt] = _("unrecognized field name '%s'");
    Norm_nlstab[XTRA_winsize_txt] = _("even using field names only, window is now too small");
-#ifndef INSP_OFFDEMO
    Norm_nlstab[YINSP_demo01_txt] = _("Open Files");
    Norm_nlstab[YINSP_demo02_txt] = _("NUMA Info");
    Norm_nlstab[YINSP_demo03_txt] = _("Log");
@@ -488,10 +487,8 @@ static void build_norm_nlstab (void) {
       "Then, enhance top with your very own customized 'file' and/or 'pipe' entries.\n"
       "\n"
       "Enjoy!\n");
-   Norm_nlstab[YINSP_noents_txt] = _("to enable 'Y' press <Enter> then type 'W' and restart top");
-#else
-   Norm_nlstab[YINSP_noents_txt] = _("to enable 'Y' please consult the top man page (press Enter)");
-#endif
+   Norm_nlstab[YINSP_noent1_txt] = _("to enable 'Y' press <Enter> then type 'W' and restart top");
+   Norm_nlstab[YINSP_noent2_txt] = _("to enable 'Y' please consult the top man page (press Enter)");
    Norm_nlstab[YINSP_failed_fmt] = _("Selection failed with: %s\n");
    Norm_nlstab[YINSP_pidbad_fmt] = _("unable to inspect, pid %d not found");
    Norm_nlstab[YINSP_pidsee_fmt] = _("inspect at PID [default pid = %d]");
index 2137c667c4793a84ff2520ea0752f4ff96ddb486..7cb41eb3a5db6d4e6371b886bf8bd83962717c41 100644 (file)
@@ -84,12 +84,10 @@ enum norm_nls {
    WORD_process_txt, WORD_threads_txt, WRITE_rcfile_fmt, WRONG_switch_fmt,
    XTRA_badflds_fmt, XTRA_fixwide_fmt, XTRA_modebad_txt, XTRA_size2up_txt,
    XTRA_vforest_fmt, XTRA_warncfg_txt, XTRA_warnold_txt, XTRA_winsize_txt,
-#ifndef INSP_OFFDEMO
    YINSP_demo01_txt, YINSP_demo02_txt, YINSP_demo03_txt, YINSP_deqfmt_txt,
    YINSP_deqtyp_txt, YINSP_dstory_txt,
-#endif
-   YINSP_failed_fmt, YINSP_noents_txt, YINSP_pidbad_fmt, YINSP_pidsee_fmt,
-   YINSP_status_fmt, YINSP_waitin_txt, YINSP_workin_txt,
+   YINSP_failed_fmt, YINSP_noent1_txt, YINSP_noent2_txt, YINSP_pidbad_fmt,
+   YINSP_pidsee_fmt, YINSP_status_fmt, YINSP_waitin_txt, YINSP_workin_txt,
       norm_MAX
 };