* find/parser.c (parse_table): Annotate predicate names as not being translated. (parse_entry_newerXY): Likewise. * find/pred.c (pred_table): Annotate predicate names as not being translated. (pred_delete): Likewise, the name of the current directory. (pred_empty): Annotate trivial format strings (e.g. "%s") as not needing translation. (pred_fprint): Likewise. (pred_print): Likewise. (pred_xtype): Likewise. (print_list): Annotate debug output and its printf formats as not needing translation. (print_parenthesised): Likewise. (print_optlist): Likewise. (show_success_rates): Likewise. * lib/safe-atoi.c (safe_atoi): Annotate trivial error message strings containing no human readable text (that is, "%s") as not needing translation. * lib/regextype.c (regex_map): Annotate regular expression type names (for use with find -regextype) as not needing translation. * lib/buildcmd.c (bc_args_exceed_testing_limit): Annotate the names of the environment variables as not needing translation. * lib/fdleak.c (o_cloexec_works): Mark "/" as not needing trranslation (it's the name of the root directory, not a bit of punctuation). --- ChangeLog | 28 +++++++++ find/parser.c | 178 +++++++++++++++++++++++++++--------------------------- find/pred.c | 161 +++++++++++++++++++++++++------------------------- lib/buildcmd.c | 9 ++- lib/fdleak.c | 2 +- lib/regextype.c | 26 ++++---- lib/safe-atoi.c | 6 +- 7 files changed, 220 insertions(+), 190 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 581de09..649289a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,33 @@ 2011-07-09 James Youngman <[email protected]> + Predicate names and trivial formats don't need translation. + * find/parser.c (parse_table): Annotate predicate names as not + being translated. + (parse_entry_newerXY): Likewise. + * find/pred.c (pred_table): Annotate predicate names as not being + translated. + (pred_delete): Likewise, the name of the current directory. + (pred_empty): Annotate trivial format strings (e.g. "%s") as not + needing translation. + (pred_fprint): Likewise. + (pred_print): Likewise. + (pred_xtype): Likewise. + (print_list): Annotate debug output and its printf formats as not + needing translation. + (print_parenthesised): Likewise. + (print_optlist): Likewise. + (show_success_rates): Likewise. + * lib/safe-atoi.c (safe_atoi): Annotate trivial error message + strings containing no human readable text (that is, "%s") as not + needing translation. + * lib/regextype.c (regex_map): Annotate regular expression type + names (for use with find -regextype) as not needing translation. + * lib/buildcmd.c (bc_args_exceed_testing_limit): Annotate the + names of the environment variables as not needing translation. + * lib/fdleak.c (o_cloexec_works): Mark "/" as not needing + trranslation (it's the name of the root directory, not a bit of + punctuation). + File system type names should be untranslated strings. * find/fstype.c (file_system_type_uncached): When the file system type is not known, return the literal string "unknown", instead of diff --git a/find/parser.c b/find/parser.c index aa01253..b114699 100644 --- a/find/parser.c +++ b/find/parser.c @@ -215,7 +215,7 @@ static bool parse_noop (const struct parser_table* entry, */ static struct parser_table const parse_entry_newerXY = { - ARG_SPECIAL_PARSE, "newerXY", parse_newerXY, pred_newerXY /* BSD */ + ARG_SPECIAL_PARSE, N_("newerXY"), parse_newerXY, pred_newerXY /* BSD */ }; /* GNU find predicates that are not mentioned in POSIX.2 are marked `GNU'. @@ -223,109 +223,109 @@ static struct parser_table const parse_entry_newerXY = static struct parser_table const parse_table[] = { - PARSE_PUNCTUATION("!", negate), /* POSIX */ - PARSE_PUNCTUATION("not", negate), /* GNU */ - PARSE_PUNCTUATION("(", openparen), /* POSIX */ - PARSE_PUNCTUATION(")", closeparen), /* POSIX */ - PARSE_PUNCTUATION(",", comma), /* GNU */ - PARSE_PUNCTUATION("a", and), /* POSIX */ - PARSE_TEST ("amin", amin), /* GNU */ - PARSE_PUNCTUATION("and", and), /* GNU */ - PARSE_TEST ("anewer", anewer), /* GNU */ - {ARG_TEST, "atime", parse_time, pred_atime}, /* POSIX */ - PARSE_TEST ("cmin", cmin), /* GNU */ - PARSE_TEST ("cnewer", cnewer), /* GNU */ - {ARG_TEST, "ctime", parse_time, pred_ctime}, /* POSIX */ - PARSE_TEST ("context", context), /* GNU */ - PARSE_POSOPT ("daystart", daystart), /* GNU */ - PARSE_ACTION ("delete", delete), /* GNU, Mac OS, FreeBSD */ - PARSE_OPTION ("d", d), /* Mac OS X, FreeBSD, NetBSD, OpenBSD, but deprecated in favour of -depth */ - PARSE_OPTION ("depth", depth), /* POSIX */ - PARSE_TEST ("empty", empty), /* GNU */ - {ARG_ACTION, "exec", parse_exec, pred_exec}, /* POSIX */ - {ARG_TEST, "executable", parse_accesscheck, pred_executable}, /* GNU, 4.3.0+ */ - PARSE_ACTION ("execdir", execdir), /* *BSD, GNU */ - PARSE_ACTION ("fls", fls), /* GNU */ - PARSE_POSOPT ("follow", follow), /* GNU, Unix */ - PARSE_ACTION ("fprint", fprint), /* GNU */ - PARSE_ACTION ("fprint0", fprint0), /* GNU */ - {ARG_ACTION, "fprintf", parse_fprintf, pred_fprintf}, /* GNU */ - PARSE_TEST ("fstype", fstype), /* GNU, Unix */ - PARSE_TEST ("gid", gid), /* GNU */ - PARSE_TEST ("group", group), /* POSIX */ - PARSE_OPTION ("ignore_readdir_race", ignore_race), /* GNU */ - PARSE_TEST ("ilname", ilname), /* GNU */ - PARSE_TEST ("iname", iname), /* GNU */ - PARSE_TEST ("inum", inum), /* GNU, Unix */ - PARSE_TEST ("ipath", ipath), /* GNU, deprecated in favour of iwholename */ - PARSE_TEST_NP ("iregex", iregex), /* GNU */ - PARSE_TEST_NP ("iwholename", iwholename), /* GNU */ - PARSE_TEST ("links", links), /* POSIX */ - PARSE_TEST ("lname", lname), /* GNU */ - PARSE_ACTION ("ls", ls), /* GNU, Unix */ - PARSE_OPTION ("maxdepth", maxdepth), /* GNU */ - PARSE_OPTION ("mindepth", mindepth), /* GNU */ - PARSE_TEST ("mmin", mmin), /* GNU */ - PARSE_OPTION ("mount", xdev), /* Unix */ - {ARG_TEST, "mtime", parse_time, pred_mtime}, /* POSIX */ - PARSE_TEST ("name", name), + PARSE_PUNCTUATION(N_("!"), negate), /* POSIX */ + PARSE_PUNCTUATION(N_("not"), negate), /* GNU */ + PARSE_PUNCTUATION(N_("("), openparen), /* POSIX */ + PARSE_PUNCTUATION(N_(")"), closeparen), /* POSIX */ + PARSE_PUNCTUATION(N_(","), comma), /* GNU */ + PARSE_PUNCTUATION(N_("a"), and), /* POSIX */ + PARSE_TEST( N_("amin"), amin), /* GNU */ + PARSE_PUNCTUATION(N_("and"), and), /* GNU */ + PARSE_TEST( N_("anewer"), anewer), /* GNU */ + {ARG_TEST, N_("atime"), parse_time, pred_atime}, /* POSIX */ + PARSE_TEST( N_("cmin"), cmin), /* GNU */ + PARSE_TEST( N_("cnewer"), cnewer), /* GNU */ + {ARG_TEST, N_("ctime"), parse_time, pred_ctime}, /* POSIX */ + PARSE_TEST( N_("context"), context), /* GNU */ + PARSE_POSOPT( N_("daystart"), daystart), /* GNU */ + PARSE_ACTION( N_("delete"), delete), /* GNU, Mac OS, FreeBSD */ + PARSE_OPTION( N_("d"), d), /* Mac OS X, FreeBSD, NetBSD, OpenBSD, but deprecated in favour of -depth */ + PARSE_OPTION( N_("depth"), depth), /* POSIX */ + PARSE_TEST( N_("empty"), empty), /* GNU */ + {ARG_ACTION, N_("exec"), parse_exec, pred_exec}, /* POSIX */ + {ARG_TEST, N_("executable"), parse_accesscheck, pred_executable}, /* GNU, 4.3.0+ */ + PARSE_ACTION( N_("execdir"), execdir), /* *BSD, GNU */ + PARSE_ACTION( N_("fls"), fls), /* GNU */ + PARSE_POSOPT( N_("follow"), follow), /* GNU, Unix */ + PARSE_ACTION( N_("fprint"), fprint), /* GNU */ + PARSE_ACTION( N_("fprint0"), fprint0), /* GNU */ + {ARG_ACTION, N_("fprintf"), parse_fprintf, pred_fprintf}, /* GNU */ + PARSE_TEST( N_("fstype"), fstype), /* GNU, Unix */ + PARSE_TEST( N_("gid"), gid), /* GNU */ + PARSE_TEST( N_("group"), group), /* POSIX */ + PARSE_OPTION( N_("ignore_readdir_race"), ignore_race), /* GNU */ + PARSE_TEST( N_("ilname"), ilname), /* GNU */ + PARSE_TEST( N_("iname"), iname), /* GNU */ + PARSE_TEST( N_("inum"), inum), /* GNU, Unix */ + PARSE_TEST( N_("ipath"), ipath), /* GNU, deprecated in favour of iwholename */ + PARSE_TEST_NP( N_("iregex"), iregex), /* GNU */ + PARSE_TEST_NP( N_("iwholename"), iwholename), /* GNU */ + PARSE_TEST( N_("links"), links), /* POSIX */ + PARSE_TEST( N_("lname"), lname), /* GNU */ + PARSE_ACTION( N_("ls"), ls), /* GNU, Unix */ + PARSE_OPTION( N_("maxdepth"), maxdepth), /* GNU */ + PARSE_OPTION( N_("mindepth"), mindepth), /* GNU */ + PARSE_TEST( N_("mmin"), mmin), /* GNU */ + PARSE_OPTION( N_("mount"), xdev), /* Unix */ + {ARG_TEST, N_("mtime"), parse_time, pred_mtime}, /* POSIX */ + PARSE_TEST( N_("name"), name), #ifdef UNIMPLEMENTED_UNIX - PARSE(ARG_UNIMPLEMENTED, "ncpio", ncpio), /* Unix */ + PARSE(ARG_UNIMPLEMENTED, N_("ncpio"), ncpio), /* Unix */ #endif - PARSE_TEST ("newer", newer), /* POSIX */ - {ARG_TEST, "atime", parse_time, pred_atime}, /* POSIX */ - PARSE_OPTION ("noleaf", noleaf), /* GNU */ - PARSE_TEST ("nogroup", nogroup), /* POSIX */ - PARSE_TEST ("nouser", nouser), /* POSIX */ - PARSE_OPTION ("noignore_readdir_race", noignore_race), /* GNU */ - PARSE_POSOPT ("nowarn", nowarn), /* GNU */ - PARSE_PUNCTUATION("o", or), /* POSIX */ - PARSE_PUNCTUATION("or", or), /* GNU */ - PARSE_ACTION ("ok", ok), /* POSIX */ - PARSE_ACTION ("okdir", okdir), /* GNU (-execdir is BSD) */ - PARSE_TEST ("path", path), /* GNU, HP-UX, RMS prefers wholename, but anyway soon POSIX */ - PARSE_TEST ("perm", perm), /* POSIX */ - PARSE_ACTION ("print", print), /* POSIX */ - PARSE_ACTION ("print0", print0), /* GNU */ - {ARG_ACTION, "printf", parse_printf, NULL}, /* GNU */ - PARSE_ACTION ("prune", prune), /* POSIX */ - PARSE_ACTION ("quit", quit), /* GNU */ - {ARG_TEST, "readable", parse_accesscheck, pred_readable}, /* GNU, 4.3.0+ */ - PARSE_TEST ("regex", regex), /* GNU */ - PARSE_POSOPT ("regextype", regextype), /* GNU */ - PARSE_TEST ("samefile", samefile), /* GNU */ + PARSE_TEST( N_("newer"), newer), /* POSIX */ + {ARG_TEST, N_("atime"), parse_time, pred_atime}, /* POSIX */ + PARSE_OPTION( N_("noleaf"), noleaf), /* GNU */ + PARSE_TEST( N_("nogroup"), nogroup), /* POSIX */ + PARSE_TEST( N_("nouser"), nouser), /* POSIX */ + PARSE_OPTION( N_("noignore_readdir_race"),noignore_race), /* GNU */ + PARSE_POSOPT( N_("nowarn"), nowarn), /* GNU */ + PARSE_PUNCTUATION(N_("o"), or), /* POSIX */ + PARSE_PUNCTUATION(N_("or"), or), /* GNU */ + PARSE_ACTION( N_("ok"), ok), /* POSIX */ + PARSE_ACTION( N_("okdir"), okdir), /* GNU (-execdir is BSD) */ + PARSE_TEST( N_("path"), path), /* GNU, HP-UX, RMS prefers wholename, but anyway soon POSIX */ + PARSE_TEST( N_("perm"), perm), /* POSIX */ + PARSE_ACTION( N_("print"), print), /* POSIX */ + PARSE_ACTION( N_("print0"), print0), /* GNU */ + {ARG_ACTION, N_("printf"), parse_printf, NULL}, /* GNU */ + PARSE_ACTION( N_("prune"), prune), /* POSIX */ + PARSE_ACTION( N_("quit"), quit), /* GNU */ + {ARG_TEST, N_("readable"), parse_accesscheck, pred_readable}, /* GNU, 4.3.0+ */ + PARSE_TEST( N_("regex"), regex), /* GNU */ + PARSE_POSOPT( N_("regextype"), regextype), /* GNU */ + PARSE_TEST( N_("samefile"), samefile), /* GNU */ #if 0 - PARSE_OPTION ("show-control-chars", show_control_chars), /* GNU, 4.3.0+ */ + PARSE_OPTION( N_("show-control-chars"), show_control_chars), /* GNU, 4.3.0+ */ #endif - PARSE_TEST ("size", size), /* POSIX */ - PARSE_TEST ("type", type), /* POSIX */ - PARSE_TEST ("uid", uid), /* GNU */ - PARSE_TEST ("used", used), /* GNU */ - PARSE_TEST ("user", user), /* POSIX */ - PARSE_OPTION ("warn", warn), /* GNU */ - PARSE_TEST_NP ("wholename", wholename), /* GNU, replaced -path, but anyway -path will soon be in POSIX */ - {ARG_TEST, "writable", parse_accesscheck, pred_writable}, /* GNU, 4.3.0+ */ - PARSE_OPTION ("xdev", xdev), /* POSIX */ - PARSE_TEST ("xtype", xtype), /* GNU */ + PARSE_TEST( N_("size"), size), /* POSIX */ + PARSE_TEST( N_("type"), type), /* POSIX */ + PARSE_TEST( N_("uid"), uid), /* GNU */ + PARSE_TEST( N_("used"), used), /* GNU */ + PARSE_TEST( N_("user"), user), /* POSIX */ + PARSE_OPTION( N_("warn"), warn), /* GNU */ + PARSE_TEST_NP( N_("wholename"), wholename), /* GNU, replaced -path, but anyway -path will soon be in POSIX */ + {ARG_TEST, N_("writable"), parse_accesscheck, pred_writable}, /* GNU, 4.3.0+ */ + PARSE_OPTION( N_("xdev"), xdev), /* POSIX */ + PARSE_TEST( N_("xtype"), xtype), /* GNU */ #ifdef UNIMPLEMENTED_UNIX /* It's pretty ugly for find to know about archive formats. Plus what it could do with cpio archives is very limited. Better to leave it out. */ - PARSE(ARG_UNIMPLEMENTED, "cpio", cpio), /* Unix */ + PARSE(ARG_UNIMPLEMENTED, N_("cpio"), cpio), /* Unix */ #endif /* gnulib's stdbool.h might have made true and false into macros, * so we can't leave named 'true' and 'false' tokens, so we have * to expeant the relevant entries longhand. */ - {ARG_TEST, "false", parse_false, pred_false}, /* GNU */ - {ARG_TEST, "true", parse_true, pred_true }, /* GNU */ - {ARG_NOOP, "noop", NULL, pred_true }, /* GNU, internal use only */ + {ARG_TEST, N_("false"), parse_false, pred_false}, /* GNU */ + {ARG_TEST, N_("true"), parse_true, pred_true }, /* GNU */ + {ARG_NOOP, N_("noop"), NULL, pred_true }, /* GNU, internal use only */ /* Various other cases that don't fit neatly into our macro scheme. */ - {ARG_TEST, "help", parse_help, NULL}, /* GNU */ - {ARG_TEST, "-help", parse_help, NULL}, /* GNU */ - {ARG_TEST, "version", parse_version, NULL}, /* GNU */ - {ARG_TEST, "-version", parse_version, NULL}, /* GNU */ + {ARG_TEST, N_("help"), parse_help, NULL}, /* GNU */ + {ARG_TEST, N_("-help"), parse_help, NULL}, /* GNU */ + {ARG_TEST, N_("version"), parse_version, NULL}, /* GNU */ + {ARG_TEST, N_("-version"), parse_version, NULL}, /* GNU */ {0, 0, 0, 0} }; diff --git a/find/pred.c b/find/pred.c index 88dacd9..08bcddb 100644 --- a/find/pred.c +++ b/find/pred.c @@ -85,65 +85,65 @@ struct pred_assoc struct pred_assoc pred_table[] = { - {pred_amin, "amin "}, - {pred_and, "and "}, - {pred_anewer, "anewer "}, - {pred_atime, "atime "}, - {pred_closeparen, ") "}, - {pred_cmin, "cmin "}, - {pred_cnewer, "cnewer "}, - {pred_comma, ", "}, - {pred_ctime, "ctime "}, - {pred_delete, "delete "}, - {pred_empty, "empty "}, - {pred_exec, "exec "}, - {pred_execdir, "execdir "}, - {pred_executable, "executable "}, - {pred_false, "false "}, - {pred_fprint, "fprint "}, - {pred_fprint0, "fprint0 "}, - {pred_fprintf, "fprintf "}, - {pred_fstype, "fstype "}, - {pred_gid, "gid "}, - {pred_group, "group "}, - {pred_ilname, "ilname "}, - {pred_iname, "iname "}, - {pred_inum, "inum "}, - {pred_ipath, "ipath "}, - {pred_links, "links "}, - {pred_lname, "lname "}, - {pred_ls, "ls "}, - {pred_mmin, "mmin "}, - {pred_mtime, "mtime "}, - {pred_name, "name "}, - {pred_negate, "not "}, - {pred_newer, "newer "}, - {pred_newerXY, "newerXY "}, - {pred_nogroup, "nogroup "}, - {pred_nouser, "nouser "}, - {pred_ok, "ok "}, - {pred_okdir, "okdir "}, - {pred_openparen, "( "}, - {pred_or, "or "}, - {pred_path, "path "}, - {pred_perm, "perm "}, - {pred_print, "print "}, - {pred_print0, "print0 "}, - {pred_prune, "prune "}, - {pred_quit, "quit "}, - {pred_readable, "readable "}, - {pred_regex, "regex "}, - {pred_samefile,"samefile "}, - {pred_size, "size "}, - {pred_true, "true "}, - {pred_type, "type "}, - {pred_uid, "uid "}, - {pred_used, "used "}, - {pred_user, "user "}, - {pred_writable, "writable "}, - {pred_xtype, "xtype "}, - {pred_context, "context"}, - {0, "none "} + {pred_amin, N_("amin ")}, + {pred_and, N_("and ")}, + {pred_anewer, N_("anewer ")}, + {pred_atime, N_("atime ")}, + {pred_closeparen, N_(") ")}, + {pred_cmin, N_("cmin ")}, + {pred_cnewer, N_("cnewer ")}, + {pred_comma, N_(", ")}, + {pred_ctime, N_("ctime ")}, + {pred_delete, N_("delete ")}, + {pred_empty, N_("empty ")}, + {pred_exec, N_("exec ")}, + {pred_execdir, N_("execdir ")}, + {pred_executable, N_("executable ")}, + {pred_false, N_("false ")}, + {pred_fprint, N_("fprint ")}, + {pred_fprint0, N_("fprint0 ")}, + {pred_fprintf, N_("fprintf ")}, + {pred_fstype, N_("fstype ")}, + {pred_gid, N_("gid ")}, + {pred_group, N_("group ")}, + {pred_ilname, N_("ilname ")}, + {pred_iname, N_("iname ")}, + {pred_inum, N_("inum ")}, + {pred_ipath, N_("ipath ")}, + {pred_links, N_("links ")}, + {pred_lname, N_("lname ")}, + {pred_ls, N_("ls ")}, + {pred_mmin, N_("mmin ")}, + {pred_mtime, N_("mtime ")}, + {pred_name, N_("name ")}, + {pred_negate, N_("not ")}, + {pred_newer, N_("newer ")}, + {pred_newerXY, N_("newerXY ")}, + {pred_nogroup, N_("nogroup ")}, + {pred_nouser, N_("nouser ")}, + {pred_ok, N_("ok ")}, + {pred_okdir, N_("okdir ")}, + {pred_openparen, N_("( ")}, + {pred_or, N_("or ")}, + {pred_path, N_("path ")}, + {pred_perm, N_("perm ")}, + {pred_print, N_("print ")}, + {pred_print0, N_("print0 ")}, + {pred_prune, N_("prune ")}, + {pred_quit, N_("quit ")}, + {pred_readable, N_("readable ")}, + {pred_regex, N_("regex ")}, + {pred_samefile,N_("samefile ")}, + {pred_size, N_("size ")}, + {pred_true, N_("true ")}, + {pred_type, N_("type ")}, + {pred_uid, N_("uid ")}, + {pred_used, N_("used ")}, + {pred_user, N_("user ")}, + {pred_writable, N_("writable ")}, + {pred_xtype, N_("xtype ")}, + {pred_context, N_("context")}, + {0, N_("none ")} }; #endif @@ -313,7 +313,7 @@ pred_delete (const char *pathname, struct stat *stat_buf, struct predicate *pred { (void) pred_ptr; (void) stat_buf; - if (strcmp (state.rel_pathname, ".")) + if (strcmp (state.rel_pathname, N_("."))) { int flags=0; if (state.have_stat && S_ISDIR(stat_buf->st_mode)) @@ -377,14 +377,14 @@ pred_empty (const char *pathname, struct stat *stat_buf, struct predicate *pred_ #endif )) < 0) { - error (0, errno, "%s", safely_quote_err_filename (0, pathname)); + error (0, errno, N_("%s"), safely_quote_err_filename (0, pathname)); state.exit_status = 1; return false; } d = fdopendir (fd); if (d == NULL) { - error (0, errno, "%s", safely_quote_err_filename (0, pathname)); + error (0, errno, N_("%s"), safely_quote_err_filename (0, pathname)); state.exit_status = 1; return false; } @@ -400,7 +400,7 @@ pred_empty (const char *pathname, struct stat *stat_buf, struct predicate *pred_ } if (CLOSEDIR (d)) { - error (0, errno, "%s", safely_quote_err_filename (0, pathname)); + error (0, errno, N_("%s"), safely_quote_err_filename (0, pathname)); state.exit_status = 1; return false; } @@ -457,7 +457,7 @@ pred_fprint (const char *pathname, struct stat *stat_buf, struct predicate *pred print_quoted (pred_ptr->args.printf_vec.stream, pred_ptr->args.printf_vec.quote_opts, pred_ptr->args.printf_vec.dest_is_tty, - "%s\n", + N_("%s\n"), pathname); return true; } @@ -914,7 +914,7 @@ pred_print (const char *pathname, struct stat *stat_buf, struct predicate *pred_ print_quoted (pred_ptr->args.printf_vec.stream, pred_ptr->args.printf_vec.quote_opts, pred_ptr->args.printf_vec.dest_is_tty, - "%s\n", pathname); + N_("%s\n"), pathname); return true; } @@ -1179,7 +1179,7 @@ pred_xtype (const char *pathname, struct stat *stat_buf, struct predicate *pred_ } else { - error (0, errno, "%s", safely_quote_err_filename (0, pathname)); + error (0, errno, N_("%s"), safely_quote_err_filename (0, pathname)); state.exit_status = 1; } return false; @@ -1240,10 +1240,10 @@ print_list (FILE *fp, struct predicate *node) cur = node; while (cur != NULL) { - fprintf (fp, "[%s] ", blank_rtrim (cur->p_name, name)); + fprintf (fp, N_("[%s] "), blank_rtrim (cur->p_name, name)); cur = cur->pred_next; } - fprintf (fp, "\n"); + fprintf (fp, N_("\n")); } /* Print out the predicate list starting at NODE. */ @@ -1268,10 +1268,10 @@ print_parenthesised (FILE *fp, struct predicate *node) parens = 1; if (parens) - fprintf (fp, "%s", " ( "); + fprintf (fp, N_(" ( ")); print_optlist (fp, node); if (parens) - fprintf (fp, "%s", " ) "); + fprintf (fp, N_(" ) ")); } } } @@ -1281,25 +1281,26 @@ print_optlist (FILE *fp, const struct predicate *p) { if (p) { + const char *nothing = N_(""); print_parenthesised (fp, p->pred_left); fprintf (fp, - "%s%s%s", - p->need_stat ? "[call stat] " : "", - p->need_type ? "[need type] " : "", - p->need_inum ? "[need inum] " : ""); + N_("%s%s%s"), + p->need_stat ? N_("[call stat] ") : nothing, + p->need_type ? N_("[need type] ") : nothing, + p->need_inum ? N_("[need inum] ") : nothing); print_predicate (fp, p); - fprintf (fp, " [%g] ", p->est_success_rate); + fprintf (fp, N_(" [%g] "), p->est_success_rate); if (options.debug_options & DebugSuccessRates) { - fprintf (fp, "[%ld/%ld", p->perf.successes, p->perf.visits); + fprintf (fp, N_("[%ld/%ld"), p->perf.successes, p->perf.visits); if (p->perf.visits) { double real_rate = (double)p->perf.successes / (double)p->perf.visits; - fprintf (fp, "=%g] ", real_rate); + fprintf (fp, N_("=%g] "), real_rate); } else { - fprintf (fp, "=_] "); + fprintf (fp, N_("=_] ")); } } print_parenthesised (fp, p->pred_right); @@ -1310,9 +1311,9 @@ void show_success_rates (const struct predicate *p) { if (options.debug_options & DebugSuccessRates) { - fprintf (stderr, "Predicate success rates after completion:\n"); + fprintf (stderr, N_("Predicate success rates after completion:\n")); print_optlist (stderr, p); - fprintf (stderr, "\n"); + fprintf (stderr, N_("\n")); } } diff --git a/lib/buildcmd.c b/lib/buildcmd.c index eb46486..f493f78 100644 --- a/lib/buildcmd.c +++ b/lib/buildcmd.c @@ -47,9 +47,10 @@ # define _(Text) gettext (Text) #else # define _(Text) Text -#define textdomain(Domain) -#define bindtextdomain(Package, Directory) +# define textdomain(Domain) +# define bindtextdomain(Package, Directory) #endif + #ifdef gettext_noop # define N_(String) gettext_noop (String) #else @@ -647,6 +648,6 @@ bc_args_exceed_testing_limit (const char **argv) chars += strlen(*argv); } - return (exceeds ("__GNU_FINDUTILS_EXEC_ARG_COUNT_LIMIT", args) || - exceeds ("__GNU_FINDUTILS_EXEC_ARG_LENGTH_LIMIT", chars)); + return (exceeds (N_("__GNU_FINDUTILS_EXEC_ARG_COUNT_LIMIT"), args) || + exceeds (N_("__GNU_FINDUTILS_EXEC_ARG_LENGTH_LIMIT"), chars)); } diff --git a/lib/fdleak.c b/lib/fdleak.c index c22d299..0811658 100644 --- a/lib/fdleak.c +++ b/lib/fdleak.c @@ -305,7 +305,7 @@ static bool o_cloexec_works (void) { bool result = false; - int fd = open ("/", O_RDONLY|O_CLOEXEC); + int fd = open (N_("/"), O_RDONLY|O_CLOEXEC); if (fd >= 0) { result = fd_is_cloexec (fd); diff --git a/lib/regextype.c b/lib/regextype.c index 352ffd4..ce6439a 100644 --- a/lib/regextype.c +++ b/lib/regextype.c @@ -59,19 +59,19 @@ struct tagRegexTypeMap struct tagRegexTypeMap regex_map[] = { - { "findutils-default", CONTEXT_FINDUTILS, RE_SYNTAX_EMACS|RE_DOT_NEWLINE }, - { "awk", CONTEXT_ALL, RE_SYNTAX_AWK }, - { "egrep", CONTEXT_ALL, RE_SYNTAX_EGREP }, - { "ed", CONTEXT_GENERIC, RE_SYNTAX_ED }, - { "emacs", CONTEXT_ALL, RE_SYNTAX_EMACS }, - { "gnu-awk", CONTEXT_ALL, RE_SYNTAX_GNU_AWK }, - { "grep", CONTEXT_ALL, RE_SYNTAX_GREP }, - { "posix-awk", CONTEXT_ALL, RE_SYNTAX_POSIX_AWK }, - { "posix-basic", CONTEXT_ALL, RE_SYNTAX_POSIX_BASIC }, - { "posix-egrep", CONTEXT_ALL, RE_SYNTAX_POSIX_EGREP }, - { "posix-extended", CONTEXT_ALL, RE_SYNTAX_POSIX_EXTENDED }, - { "posix-minimal-basic", CONTEXT_GENERIC, RE_SYNTAX_POSIX_MINIMAL_BASIC }, - { "sed", CONTEXT_GENERIC, RE_SYNTAX_SED }, + { N_("findutils-default"), CONTEXT_FINDUTILS, RE_SYNTAX_EMACS|RE_DOT_NEWLINE }, + { N_("awk"), CONTEXT_ALL, RE_SYNTAX_AWK }, + { N_("egrep"), CONTEXT_ALL, RE_SYNTAX_EGREP }, + { N_("ed"), CONTEXT_GENERIC, RE_SYNTAX_ED }, + { N_("emacs"), CONTEXT_ALL, RE_SYNTAX_EMACS }, + { N_("gnu-awk"), CONTEXT_ALL, RE_SYNTAX_GNU_AWK }, + { N_("grep"), CONTEXT_ALL, RE_SYNTAX_GREP }, + { N_("posix-awk"), CONTEXT_ALL, RE_SYNTAX_POSIX_AWK }, + { N_("posix-basic"), CONTEXT_ALL, RE_SYNTAX_POSIX_BASIC }, + { N_("posix-egrep"), CONTEXT_ALL, RE_SYNTAX_POSIX_EGREP }, + { N_("posix-extended"), CONTEXT_ALL, RE_SYNTAX_POSIX_EXTENDED }, + { N_("posix-minimal-basic"), CONTEXT_GENERIC, RE_SYNTAX_POSIX_MINIMAL_BASIC }, + { N_("sed"), CONTEXT_GENERIC, RE_SYNTAX_SED }, /* ,{ "posix-common", CONTEXT_GENERIC, _RE_SYNTAX_POSIX_COMMON } */ }; enum { N_REGEX_MAP_ENTRIES = sizeof (regex_map)/sizeof (regex_map[0]) }; diff --git a/lib/safe-atoi.c b/lib/safe-atoi.c index 45e64e9..db3f3e4 100644 --- a/lib/safe-atoi.c +++ b/lib/safe-atoi.c @@ -58,12 +58,12 @@ safe_atoi (const char *s, enum quoting_style style) if (errno == ERANGE) { /* too big, or too small. */ - error (EXIT_FAILURE, errno, "%s", s); + error (EXIT_FAILURE, errno, N_("%s"), s); } else { /* not a valid number */ - error (EXIT_FAILURE, errno, "%s", s); + error (EXIT_FAILURE, errno, N_("%s"), s); } /* Otherwise, we do a range chack against INT_MAX and INT_MIN * below. @@ -74,7 +74,7 @@ safe_atoi (const char *s, enum quoting_style style) { /* The number was in range for long, but not int. */ errno = ERANGE; - error (EXIT_FAILURE, errno, "%s", s); + error (EXIT_FAILURE, errno, N_("%s"), s); } else if (*end) { -- 1.7.2.5
