nls: add functions which take translations to be used
Add the following three functions to most of the commands. setlocale (LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); 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:
parent
b40353c91e
commit
c862a4caa5
4
pgrep.c
4
pgrep.c
@ -761,6 +761,10 @@ int main (int argc, char **argv)
|
|||||||
union el *procs;
|
union el *procs;
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
|
setlocale (LC_ALL, "");
|
||||||
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
textdomain(PACKAGE);
|
||||||
|
|
||||||
parse_opts (argc, argv);
|
parse_opts (argc, argv);
|
||||||
|
|
||||||
procs = select_procs (&num);
|
procs = select_procs (&num);
|
||||||
|
4
pmap.c
4
pmap.c
@ -384,6 +384,10 @@ int main(int argc, char **argv)
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setlocale (LC_ALL, "");
|
||||||
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
textdomain(PACKAGE);
|
||||||
|
|
||||||
x_option = d_option = q_option = 0;
|
x_option = d_option = q_option = 0;
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "xrdqA:hV", longopts, NULL)) != -1)
|
while ((c = getopt_long(argc, argv, "xrdqA:hV", longopts, NULL)) != -1)
|
||||||
|
@ -530,7 +530,9 @@ static void fancy_spew(void){
|
|||||||
/***** no comment */
|
/***** no comment */
|
||||||
int main(int argc, char *argv[]){
|
int main(int argc, char *argv[]){
|
||||||
#if (__GNU_LIBRARY__ >= 6)
|
#if (__GNU_LIBRARY__ >= 6)
|
||||||
setlocale (LC_CTYPE, "");
|
setlocale (LC_ALL, "");
|
||||||
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
textdomain(PACKAGE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
4
pwdx.c
4
pwdx.c
@ -48,6 +48,10 @@ int main(int argc, char *argv[])
|
|||||||
{NULL, 0, 0, 0}
|
{NULL, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setlocale (LC_ALL, "");
|
||||||
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
textdomain(PACKAGE);
|
||||||
|
|
||||||
while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
|
while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'V':
|
case 'V':
|
||||||
|
4
skill.c
4
skill.c
@ -363,6 +363,10 @@ static void __attribute__ ((__noreturn__))
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setlocale (LC_ALL, "");
|
||||||
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
textdomain(PACKAGE);
|
||||||
|
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
kill_usage(stderr);
|
kill_usage(stderr);
|
||||||
|
|
||||||
|
4
sysctl.c
4
sysctl.c
@ -610,6 +610,10 @@ int main(int argc, char *argv[])
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setlocale (LC_ALL, "");
|
||||||
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
textdomain(PACKAGE);
|
||||||
|
|
||||||
PrintName = true;
|
PrintName = true;
|
||||||
PrintNewline = true;
|
PrintNewline = true;
|
||||||
IgnoreError = false;
|
IgnoreError = false;
|
||||||
|
7
tload.c
7
tload.c
@ -96,7 +96,12 @@ int main(int argc, char **argv)
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
while ((opt = getopt_long(argc, argv, "s:d:Vh", longopts, NULL)) != -1)
|
setlocale (LC_ALL, "");
|
||||||
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
textdomain(PACKAGE);
|
||||||
|
|
||||||
|
while ((opt =
|
||||||
|
getopt_long(argc, argv, "s:d:Vh", longopts, NULL)) != -1)
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 's':
|
case 's':
|
||||||
scale_arg = optarg;
|
scale_arg = optarg;
|
||||||
|
4
uptime.c
4
uptime.c
@ -30,6 +30,10 @@ int main(int argc, char **argv)
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setlocale (LC_ALL, "");
|
||||||
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
textdomain(PACKAGE);
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "hV", longopts, NULL)) != -1)
|
while ((c = getopt_long(argc, argv, "hV", longopts, NULL)) != -1)
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h':
|
case 'h':
|
||||||
|
4
vmstat.c
4
vmstat.c
@ -620,6 +620,10 @@ int main(int argc, char *argv[])
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setlocale (LC_ALL, "");
|
||||||
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
textdomain(PACKAGE);
|
||||||
|
|
||||||
while ((c =
|
while ((c =
|
||||||
getopt_long(argc, argv, "afmnsdDp:S:hV", longopts,
|
getopt_long(argc, argv, "afmnsdDp:S:hV", longopts,
|
||||||
NULL)) != EOF)
|
NULL)) != EOF)
|
||||||
|
8
w.c
8
w.c
@ -343,12 +343,16 @@ int main(int argc, char **argv)
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setlocale (LC_ALL, "");
|
||||||
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
textdomain(PACKAGE);
|
||||||
|
|
||||||
#ifndef W_SHOWFROM
|
#ifndef W_SHOWFROM
|
||||||
from = 0;
|
from = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
while ((ch =
|
||||||
while ((ch = getopt_long(argc, argv, "hlusfVo", longopts, NULL)) != -1)
|
getopt_long(argc, argv, "hlusfV", longopts, NULL)) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'h':
|
case 'h':
|
||||||
header = 0;
|
header = 0;
|
||||||
|
2
watch.c
2
watch.c
@ -309,6 +309,8 @@ int main(int argc, char *argv[])
|
|||||||
};
|
};
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
textdomain(PACKAGE);
|
||||||
|
|
||||||
while ((optc =
|
while ((optc =
|
||||||
getopt_long(argc, argv, "+bced::hn:pvtx", longopts, (int *)0))
|
getopt_long(argc, argv, "+bced::hn:pvtx", longopts, (int *)0))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user