ps: generalize help text logic, add related translator hints

This commit represents an experiment in nls help text support.

The word --help itself been made translatable along with the
help section names and their abbreviations.  Thus, the work of
the translators will ultimately alter program run-time behavior.

Perhaps someday all "long" options can behave in a similar way
which could offer a considerable benefit to other languages.
Instead of translationg just option descriptions, the long
forms of those options could also be transalated.

This commit also:
 . includes the section abbreviations in --help output
 . isolates all --help support in the ps/help.c module
 . provides (hopefully) meaningful Translator guidance
 . removes --help support from the ps/common.h header
 . removes --help support from the ps/parser.c module
 . eliminates tabs in line with the style of other ps modules
 . eliminates the need for the include/c.h header file
This commit is contained in:
Jim Warner
2012-01-02 01:33:34 -06:00
committed by Craig Small
parent b8c3288594
commit 4fb48c0bdb
5 changed files with 214 additions and 131 deletions

View File

@@ -81,7 +81,7 @@ unsigned thread_flags = 0xffffffff;
int unix_f_option = -1;
int user_is_number = -1;
int wchan_is_number = -1;
const char *the_word_help;
static void reset_selection_list(void){
selection_node *old;
@@ -391,6 +391,14 @@ void reset_global(void){
unix_f_option = 0;
user_is_number = 0;
wchan_is_number = 0;
/* Translation Note:
. The following translatable word will be used to recognize the
. user's request for help text. In other words, the translation
. you provide will alter program behavior.
.
. It must be limited to 15 characters or less.
*/
the_word_help = _("help");
}
static const char archdefs[] =