nls: improve translations and provide translator help comments

Reference: http://www.freelists.org/post/procps/backporting,1
Reported-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola
2011-12-17 18:32:47 +01:00
parent 7b6084451d
commit 0022b6ec5d
15 changed files with 153 additions and 49 deletions

View File

@ -496,5 +496,5 @@ void self_info(void){
fprintf(stderr, _("archdefs:%s\n"), archdefs);
open_psdb(namelist_file);
fprintf(stderr,_("namelist_file=\"%s\"\n"),namelist_file?namelist_file:"<no System.map file>");
fprintf(stderr,_("namelist_file=\"%s\"\n"),namelist_file?namelist_file:_("<no System.map file>"));
}

View File

@ -19,7 +19,7 @@ void __attribute__ ((__noreturn__)) usage(FILE * out, int section)
{
fputs(USAGE_HEADER, out);
fprintf(out,
" %s [options]\n", program_invocation_short_name);
_(" %s [options]\n"), program_invocation_short_name);
if (section == USAGE_SELECTION || section == USAGE_ALL) {
fputs(_("\nSimple options:\n"), out);
fputs(_(" -A all processes\n"), out);
@ -95,9 +95,16 @@ void __attribute__ ((__noreturn__)) usage(FILE * out, int section)
fputs(_(" display help\n"), out);
}
if (section == USAGE_DEFAULT)
fprintf(out,
_("\n Try `%s --help <selection|list|output|threads|misc|all>'\n"
" for more information.\n"), program_invocation_short_name);
/* Translation Hint: do not translate arguments, that breaks
* string comparison. Outputting something like following
* might work.
*
* Zry `%s --help <selection|list|output|threads|misc|all>
* (zlekzio|lizt|czreen vrites|threadz|mizc|trezt)
*/
fprintf(out, _("\n Try `%s --help <selection|list|output|threads|misc|all>'\n"
" for more information.\n"), program_invocation_short_name);
fprintf(out, USAGE_MAN_TAIL("ps(1)"));
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}

View File

@ -1134,7 +1134,7 @@ static const char *parse_all_options(void){
return _("Garbage option.");
break;
default:
printf(_(" ? %s\n"),ps_argv[thisarg]);
printf(" ? %s\n",ps_argv[thisarg]);
return _("Something broke.");
} /* switch */
if(err) return err;

View File

@ -96,12 +96,12 @@ static void O_wrap(sf_node *sfn, int otype){
trailer = (otype=='b') ? "END_BSD" : "END_SYS5" ;
fnode = do_one_spec("pid",NULL);
if(!fnode)fprintf(stderr,"Seriously crashing. Goodbye cruel world.\n");
if(!fnode)fprintf(stderr,_("Seriously crashing. Goodbye cruel world.\n"));
endp = sfn->f_cooked; while(endp->next) endp = endp->next; /* find end */
endp->next = fnode;
fnode = do_one_spec(trailer,NULL);
if(!fnode) { fprintf(stderr,"Seriously crashing. Goodbye cruel world.\n"); exit(1); }
if(!fnode) { fprintf(stderr,_("Seriously crashing. Goodbye cruel world.\n")); exit(1); }
endp = fnode; while(endp->next) endp = endp->next; /* find end */
endp->next = sfn->f_cooked;
sfn->f_cooked = fnode;
@ -792,7 +792,7 @@ const char *process_sf_options(int localbroken){
// with sorting. Do the threads remain grouped, with sorting
// by process, or do the threads get sorted by themselves?
if(sort_list && (thread_flags&TF_no_sort)){
return _("Tell procps@freelists.org what you expected.");
return _("Tell PACKAGE_BUGREPORT what you expected.");
}
// If nothing else, try to use $PS_FORMAT before the default.
@ -802,7 +802,7 @@ const char *process_sf_options(int localbroken){
if(tmp && *tmp){
const char *err;
sf_node sfn;
if(thread_flags&TF_must_use) return _("Tell procps@freelists.org what you want. (-L/-T, -m/m/H, and $PS_FORMAT)");
if(thread_flags&TF_must_use) return _("Tell PACKAGE_BUGREPORT what you want. (-L/-T, -m/m/H, and $PS_FORMAT)");
sfn.sf = tmp;
sfn.f_cooked = NULL;
err = format_parse(&sfn);