]> granicus.if.org Git - procps-ng/commitdiff
top: adapt 'locate/find next' search capability for nls
authorJim Warner <james.warner@comcast.net>
Tue, 20 Dec 2011 20:43:54 +0000 (14:43 -0600)
committerCraig Small <csmall@enc.com.au>
Thu, 22 Dec 2011 12:48:06 +0000 (23:48 +1100)
top/top.c
top/top_nls.c
top/top_nls.h

index 4604fa437100e1d2e8240976c814718f0fd9ca91..e224dc25bab06e57ac658f00ea9b333a83879475 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -2698,18 +2698,18 @@ static void file_writerc (void) {
 
 
 static void find_string (int ch) {
- #define reDUX (found) ? "another " : ""
+ #define reDUX (found) ? N_txt(WORD_another_txt) : ""
    static char str[SCREENMAX];
    static int found;
    char buf[ROWMINSIZ];
    int i;
 
    if ('&' == ch && !str[0]) {
-      show_msg("Locate next inactive, use \"L\"");
+      show_msg(N_txt(FIND_no_next_txt));
       return;
    }
    if ('L' == ch) {
-      strcpy(str, linein("Locate string"));
+      strcpy(str, linein(N_txt(GET_find_str_txt)));
       found = 0;
    }
    if (str[0]) {
@@ -2722,7 +2722,7 @@ static void find_string (int ch) {
             return;
          }
       }
-      show_msg(fmtmk("%s\"%s\" not found", reDUX, str));
+      show_msg(fmtmk(N_fmt(FIND_no_find_fmt), reDUX, str));
    }
  #undef reDUX
 } // end: find_string
index 3da3d4b7aebbced250ced5cc6e36720e9db8ebc9..43c76fa6dd831b89613d966ec61b1e31cd070492 100644 (file)
@@ -255,6 +255,11 @@ static void build_norm_nlstab (void) {
 /* Translation Hint: The following "word" is meant to represent a single processor
    .                 (should be exactly 3 characters) */
    Norm_nlstab[WORD_eachcpu_fmt] = _("Cpu%-3d:");
+/* Translation Hint: The following word "another" must have 1 trailing space */
+   Norm_nlstab[WORD_another_txt] = _("another ");
+   Norm_nlstab[FIND_no_next_txt] = _("Locate next inactive, use \"L\"");
+   Norm_nlstab[GET_find_str_txt] = _("Locate string");
+   Norm_nlstab[FIND_no_find_fmt] = _("%s\"%s\" not found");
 }
 
 
@@ -297,7 +302,7 @@ static void build_uniq_nlstab (void) {
       "  1,I       Toggle SMP view: '~11~2' single/separate states; '~1I~2' Irix/Solaris mode\n"
       "  f,F       Manage Fields: add/remove; change order; select sort field\n"
       "\n"
-      "  <,>     . Move sort field: '~1<~2' next col left; '~1>~2' next col right\n"
+      "  L,&,<,> . Locate: '~1L~2'/'~1&~2' find/again; Move sort column: '~1<~2'/'~1>~2' left/right\n" \
       "  R,H,V   . Toggle: '~1R~2' norm/rev sort; '~1H~2' show threads; '~1V~2' forest view\n"
       "  c,i,S   . Toggle: '~1c~2' cmd name/line; '~1i~2' idle tasks; '~1S~2' cumulative time\n"
       "  x~5,~1y~5     . Toggle highlights: '~1x~2' sort field; '~1y~2' running tasks\n"
index 6e0b0c2fc4d6a0dad6c5199690580d7c7ea61ea0..3f554e63e5fe4f340499c83ebe9c554591f200b6 100644 (file)
@@ -56,14 +56,15 @@ enum norm_nls {
    FAIL_alloc_c_txt, FAIL_alloc_r_txt, FAIL_openlib_fmt, FAIL_rc_open_fmt,
    FAIL_re_nice_fmt, FAIL_sigmask_fmt, FAIL_signals_fmt, FAIL_sigstop_fmt,
    FAIL_statget_txt, FAIL_statopn_fmt, FAIL_tty_get_txt, FAIL_tty_mod_fmt,
-   FAIL_tty_raw_fmt, FAIL_widecpu_txt, FAIL_widepid_txt, FOREST_modes_fmt,
-   FOREST_views_txt, GET_max_task_fmt, GET_nice_num_fmt, GET_pid2kill_txt,
-   GET_pid2nice_txt, GET_sigs_num_fmt, GET_user_ids_txt, HELP_cmdline_fmt,
-   HILIGHT_cant_txt, IRIX_curmode_fmt, LIMIT_exceed_fmt, MISSING_args_fmt,
-   NAME_windows_fmt, NOT_onsecure_txt, NOT_smp_cpus_txt, OFF_one_word_txt,
-   ON_word_only_txt, RC_bad_entry_fmt, RC_bad_files_fmt, SCROLL_coord_fmt,
-   SELECT_clash_txt, THREADS_show_fmt, TIME_accumed_fmt, UNKNOWN_cmds_txt,
-   UNKNOWN_opts_fmt, USAGE_abbrev_txt, WORD_allcpus_txt, WORD_eachcpu_fmt,
+   FAIL_tty_raw_fmt, FAIL_widecpu_txt, FAIL_widepid_txt, FIND_no_find_fmt,
+   FIND_no_next_txt, FOREST_modes_fmt, FOREST_views_txt, GET_find_str_txt,
+   GET_max_task_fmt, GET_nice_num_fmt, GET_pid2kill_txt, GET_pid2nice_txt,
+   GET_sigs_num_fmt, GET_user_ids_txt, HELP_cmdline_fmt, HILIGHT_cant_txt,
+   IRIX_curmode_fmt, LIMIT_exceed_fmt, MISSING_args_fmt, NAME_windows_fmt,
+   NOT_onsecure_txt, NOT_smp_cpus_txt, OFF_one_word_txt, ON_word_only_txt,
+   RC_bad_entry_fmt, RC_bad_files_fmt, SCROLL_coord_fmt, SELECT_clash_txt,
+   THREADS_show_fmt, TIME_accumed_fmt, UNKNOWN_cmds_txt, UNKNOWN_opts_fmt,
+   USAGE_abbrev_txt, WORD_allcpus_txt, WORD_another_txt, WORD_eachcpu_fmt,
    WORD_process_txt, WORD_threads_txt, WRITE_rcfile_fmt, WRONG_switch_fmt,
       norm_MAX
 };