From: Jim Meyering Date: Tue, 12 Mar 1996 23:49:29 +0000 (+0000) Subject: (main): Initialize for internationalized message support: X-Git-Tag: SH-UTILS-1_12d~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6fc4ae7a28f4603daee61672949835aa6e6059ff;p=platform%2Fupstream%2Fcoreutils.git (main): Initialize for internationalized message support: call setlocale, bindtextdomain, and textdomain. --- diff --git a/src/basename.c b/src/basename.c index ad2dcda..6d2ea21 100644 --- a/src/basename.c +++ b/src/basename.c @@ -72,6 +72,9 @@ main (int argc, char **argv) char *name; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); parse_long_options (argc, argv, "basename", version_string, usage); diff --git a/src/date.c b/src/date.c index 744900e..7b0c456 100644 --- a/src/date.c +++ b/src/date.c @@ -159,6 +159,9 @@ main (int argc, char **argv) int option_specified_date; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); while ((optc = getopt_long (argc, argv, "d:f:r:Rs:u", long_options, NULL)) != EOF) diff --git a/src/dirname.c b/src/dirname.c index 52ef010..82eca22 100644 --- a/src/dirname.c +++ b/src/dirname.c @@ -62,6 +62,9 @@ main (int argc, char **argv) register char *slash; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); parse_long_options (argc, argv, "dirname", version_string, usage); diff --git a/src/echo.c b/src/echo.c index 9a72b55..3f31a44 100644 --- a/src/echo.c +++ b/src/echo.c @@ -107,6 +107,9 @@ main (int argc, char **argv) int display_return = 1, do_v9 = 0; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); parse_long_options (argc, argv, "echo", version_string, usage); diff --git a/src/env.c b/src/env.c index 0711de8..24ad743 100644 --- a/src/env.c +++ b/src/env.c @@ -119,6 +119,9 @@ main (register int argc, register char **argv, char **envp) int ignore_environment = 0; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); while ((optc = getopt_long (argc, argv, "+iu:", longopts, (int *) 0)) != EOF) { diff --git a/src/expr.c b/src/expr.c index f6e13aa..3376a6d 100644 --- a/src/expr.c +++ b/src/expr.c @@ -155,6 +155,9 @@ main (int argc, char **argv) VALUE *v; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); parse_long_options (argc, argv, "expr", version_string, usage); diff --git a/src/factor.c b/src/factor.c index 816b266..1125124 100644 --- a/src/factor.c +++ b/src/factor.c @@ -174,6 +174,9 @@ main (int argc, char **argv) int fail; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); parse_long_options (argc, argv, "factor", version_string, usage); diff --git a/src/hostname.c b/src/hostname.c index fff5954..239dba0 100644 --- a/src/hostname.c +++ b/src/hostname.c @@ -38,9 +38,9 @@ sethostname (name, namelen) { /* Using sysinfo() is the SVR4 mechanism to set a hostname. */ int result; - + result = sysinfo (SI_SET_HOSTNAME, name, namelen); - + return (result == -1 ? result : 0); } @@ -79,6 +79,9 @@ main (int argc, char **argv) char *hostname; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); parse_long_options (argc, argv, "hostname", version_string, usage); diff --git a/src/id.c b/src/id.c index 5864415..a03ba6e 100644 --- a/src/id.c +++ b/src/id.c @@ -101,6 +101,9 @@ main (int argc, char **argv) int optc; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); while ((optc = getopt_long (argc, argv, "gnruG", longopts, (int *) 0)) != EOF) diff --git a/src/logname.c b/src/logname.c index 9a0b0ec..9d71c75 100644 --- a/src/logname.c +++ b/src/logname.c @@ -65,6 +65,9 @@ main (int argc, char **argv) int c; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); while ((c = getopt_long (argc, argv, "", long_options, (int *) 0)) != EOF) { diff --git a/src/nice.c b/src/nice.c index 61d4d87..579a206 100644 --- a/src/nice.c +++ b/src/nice.c @@ -64,6 +64,10 @@ main (int argc, char **argv) int last_optind = 0; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + parse_long_options (argc, argv, "nice", version_string, usage); for (optind = 1; optind < argc; /* empty */) diff --git a/src/pathchk.c b/src/pathchk.c index 3aaa099..ad5dadd 100644 --- a/src/pathchk.c +++ b/src/pathchk.c @@ -121,6 +121,9 @@ main (int argc, char **argv) int optc; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); while ((optc = getopt_long (argc, argv, "p", longopts, (int *) 0)) != EOF) { diff --git a/src/printenv.c b/src/printenv.c index 9e13aa3..6bc45c1 100644 --- a/src/printenv.c +++ b/src/printenv.c @@ -83,6 +83,9 @@ main (int argc, char **argv) int exit_status; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); while ((c = getopt_long (argc, argv, "", long_options, (int *) 0)) != EOF) { diff --git a/src/printf.c b/src/printf.c index 35eb193..7c5f338 100644 --- a/src/printf.c +++ b/src/printf.c @@ -132,6 +132,10 @@ main (int argc, char **argv) int args_used; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + exit_status = 0; parse_long_options (argc, argv, "printf", version_string, usage); diff --git a/src/pwd.c b/src/pwd.c index ff9f6d9..c61c194 100644 --- a/src/pwd.c +++ b/src/pwd.c @@ -56,6 +56,9 @@ main (int argc, char **argv) char *wd; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); parse_long_options (argc, argv, "pwd", version_string, usage); diff --git a/src/seq.c b/src/seq.c index dae55db..cdfcd6d 100644 --- a/src/seq.c +++ b/src/seq.c @@ -103,6 +103,10 @@ main (int argc, char **argv) int step_is_set; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + equal_width = 0; format_str = NULL; separator = "\n"; diff --git a/src/sleep.c b/src/sleep.c index dcf4db6..b37e943 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -69,6 +69,9 @@ main (int argc, char **argv) int c; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); while ((c = getopt_long (argc, argv, "", long_options, (int *) 0)) != EOF) { diff --git a/src/stty.c b/src/stty.c index 72a6f1a..e18e34b 100644 --- a/src/stty.c +++ b/src/stty.c @@ -650,6 +650,9 @@ main (int argc, char **argv) int k; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); parse_long_options (argc, argv, "stty", version_string, usage); diff --git a/src/su.c b/src/su.c index 44cacbb..25168fc 100644 --- a/src/su.c +++ b/src/su.c @@ -195,6 +195,10 @@ main (argc, argv) struct passwd pw_copy; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + fast_startup = 0; simulate_login = 0; change_environment = 1; diff --git a/src/tee.c b/src/tee.c index 34dc614..95018dd 100644 --- a/src/tee.c +++ b/src/tee.c @@ -84,6 +84,10 @@ main (int argc, char **argv) int optc; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + append = 0; ignore_interrupts = 0; diff --git a/src/test.c b/src/test.c index 512ccfb..face6a5 100644 --- a/src/test.c +++ b/src/test.c @@ -1065,6 +1065,9 @@ main (int margc, char **margv) return (test_error_return); #else /* TEST_STANDALONE */ program_name = margv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); #endif /* TEST_STANDALONE */ argv = margv; diff --git a/src/tty.c b/src/tty.c index 5986063..26c293b 100644 --- a/src/tty.c +++ b/src/tty.c @@ -61,6 +61,10 @@ main (int argc, char **argv) int optc; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + silent = 0; while ((optc = getopt_long (argc, argv, "s", longopts, (int *) 0)) != EOF) diff --git a/src/uname.c b/src/uname.c index ca1caa0..e64af98 100644 --- a/src/uname.c +++ b/src/uname.c @@ -88,6 +88,10 @@ main (int argc, char **argv) int c; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + toprint = 0; while ((c = getopt_long (argc, argv, "snrvma", long_options, (int *) 0)) diff --git a/src/who-users.c b/src/who-users.c index 4518e15..4cc9206 100644 --- a/src/who-users.c +++ b/src/who-users.c @@ -573,6 +573,9 @@ main (int argc, char **argv) #endif /* WHO */ program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); #ifdef WHO while ((optc = getopt_long (argc, argv, "imqsuwHT", longopts, &longind)) diff --git a/src/whoami.c b/src/whoami.c index 66293d8..0bd3cdd 100644 --- a/src/whoami.c +++ b/src/whoami.c @@ -70,6 +70,9 @@ main (int argc, char **argv) int c; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); while ((c = getopt_long (argc, argv, "", long_options, (int *) 0)) != EOF) { diff --git a/src/yes.c b/src/yes.c index 2b78ea5..58a06d6 100644 --- a/src/yes.c +++ b/src/yes.c @@ -50,6 +50,9 @@ void main (int argc, char **argv) { program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); parse_long_options (argc, argv, "yes", version_string, usage);