You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I just got pointed to this program by noone else but Nelson H. F. Beebe (after noting that dict.cc is so slow to access with the lynx text mode browser on the lynx list), who says he uses this for many purposes for many years, and so i tried it, and it is a really great tool to have. Thank you! (I have created a CRUX Linux package now, but i am no longer in "official" contrib, it is only in my private user repository .. that some people seem to access; anyhow).
So you can very well ignore the rest and close this "issue", i only stumbled upon it and thought i share that.
Iooked into the script, and i saw it looks for $LANG. Whereas that is ok, since many in the Linux world (GNU etc) document users should set that, $LANG is only a secondary switch, and i for example do not set it, but LC_ALL (this is also much much much faster). (C.UTF-8 is coming along, too, but checking for it would make installation more lengthy.)
It also seems bash is not really needed. Ie the following snippet should work just fine in any POSIX shell, and since the /usr/bin/trans thing is a cumulation generated via script the (possibly) necessary quoting in the manual page could very easily be done. This is just a quick hack, of course.
Ciao! And thanks for this tool!
y=en_US.UTF-8
if [ -n "$LC_ALL" ]; then x=$LC_ALL
elif [ -n "$LANG" ]; then x=$LANG
else x=
fi
if [ -n "$x" ] && [ "$x" != "${x%UTF*}" ]; then
x=${x#*UTF}
x=${x#*-}
[ "$x" != 8 ] && x=$y || x=
else
x=$y
fi
if [ -n "$x" ]; then
LC_ALL=$x
export LC_ALL
fi
TRANS_MANPAGE='
.TH "TRANS" "1" "2023\-02\-08" "0.9.7.1" ""
.hy
.SH NAME
.PP
trans \- yeah
.SH SYNOPSIS
dudia
'
export TRANS_MANPAGE
cat <<'EOT' | gawk -f - "$@"
function initPager() { Pager = "less" }
function showMan( temp) {
PIPE=" | "
if (ENVIRON["TRANS_MANPAGE"]) {
initPager()
Groff = "/usr/bin/groff"
if (Pager && Groff) {
temp = "printf '%s' \"${TRANS_MANPAGE}\""
temp = temp PIPE\
Groff " -Wall -mtty-char -mandoc -Tutf8 "
temp = temp PIPE\
Pager " -s -P\"\\ \\Manual page " Command "(1) line %lt (press h for help or q to quit)\""
}
system(temp)
}
}
BEGIN{showMan()}
EOT
The text was updated successfully, but these errors were encountered:
(And have you ever thought on asking Arnold Robbins of gawk whether he would be interested to support switching the locale? If he does not do that already. He is a very friendly and helpful person. Btw on some boxes there is "mandoc" as a replacement of groff, just say "mandoc -Tutf8" and it will do the rest.)
But now really Ciao!
Hello!
I just got pointed to this program by noone else but Nelson H. F. Beebe (after noting that dict.cc is so slow to access with the lynx text mode browser on the lynx list), who says he uses this for many purposes for many years, and so i tried it, and it is a really great tool to have. Thank you! (I have created a CRUX Linux package now, but i am no longer in "official" contrib, it is only in my private user repository .. that some people seem to access; anyhow).
So you can very well ignore the rest and close this "issue", i only stumbled upon it and thought i share that.
Iooked into the script, and i saw it looks for $LANG. Whereas that is ok, since many in the Linux world (GNU etc) document users should set that, $LANG is only a secondary switch, and i for example do not set it, but LC_ALL (this is also much much much faster). (C.UTF-8 is coming along, too, but checking for it would make installation more lengthy.)
It also seems bash is not really needed. Ie the following snippet should work just fine in any POSIX shell, and since the /usr/bin/trans thing is a cumulation generated via script the (possibly) necessary quoting in the manual page could very easily be done. This is just a quick hack, of course.
Ciao! And thanks for this tool!
The text was updated successfully, but these errors were encountered: