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

@ -34,6 +34,8 @@
#define SIGCHLD SIGCLD
#endif
char *myname;
/* just reports a crash */
static void signal_handler(int signo){
if(signo==SIGPIPE) _exit(0); /* "ps | head" will cause this */
@ -44,7 +46,7 @@ static void signal_handler(int signo){
"Please send bug reports to <procps@freelists.org>\n"),
signo,
signal_number_to_name(signo),
program_invocation_short_name,
myname,
procps_version
);
_exit(signo+128);
@ -523,6 +525,9 @@ static void fancy_spew(void){
/***** no comment */
int main(int argc, char *argv[]){
myname = strrchr(*argv, '/');
if (myname) ++myname; else myname = *argv;
setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);