Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/smshex_r.../bin
File: gettext.sh
#! /bin/sh
[0] Fix | Delete
#
[1] Fix | Delete
# Copyright (C) 2003, 2005-2007, 2011, 2015-2016 Free Software Foundation, Inc.
[2] Fix | Delete
#
[3] Fix | Delete
# This program is free software: you can redistribute it and/or modify
[4] Fix | Delete
# it under the terms of the GNU Lesser General Public License as published by
[5] Fix | Delete
# the Free Software Foundation; either version 2.1 of the License, or
[6] Fix | Delete
# (at your option) any later version.
[7] Fix | Delete
#
[8] Fix | Delete
# This program is distributed in the hope that it will be useful,
[9] Fix | Delete
# but WITHOUT ANY WARRANTY; without even the implied warranty of
[10] Fix | Delete
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[11] Fix | Delete
# GNU Lesser General Public License for more details.
[12] Fix | Delete
#
[13] Fix | Delete
# You should have received a copy of the GNU Lesser General Public License
[14] Fix | Delete
# along with this program. If not, see <http://www.gnu.org/licenses/>.
[15] Fix | Delete
#
[16] Fix | Delete
[17] Fix | Delete
# Find a way to echo strings without interpreting backslash.
[18] Fix | Delete
if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
[19] Fix | Delete
echo='echo'
[20] Fix | Delete
else
[21] Fix | Delete
if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
[22] Fix | Delete
echo='printf %s\n'
[23] Fix | Delete
else
[24] Fix | Delete
echo_func () {
[25] Fix | Delete
cat <<EOT
[26] Fix | Delete
$*
[27] Fix | Delete
EOT
[28] Fix | Delete
}
[29] Fix | Delete
echo='echo_func'
[30] Fix | Delete
fi
[31] Fix | Delete
fi
[32] Fix | Delete
[33] Fix | Delete
# This script is primarily a shell function library. In order for
[34] Fix | Delete
# ". gettext.sh" to find it, we install it in $PREFIX/bin (that is usually
[35] Fix | Delete
# contained in $PATH), rather than in some other location such as
[36] Fix | Delete
# $PREFIX/share/sh-scripts or $PREFIX/share/gettext. In order to not violate
[37] Fix | Delete
# the Filesystem Hierarchy Standard when doing so, this script is executable.
[38] Fix | Delete
# Therefore it needs to support the standard --help and --version.
[39] Fix | Delete
if test -z "${ZSH_VERSION+set}"; then
[40] Fix | Delete
# zsh is not POSIX compliant: By default, while ". gettext.sh" is executed,
[41] Fix | Delete
# it sets $0 to "gettext.sh", defeating the purpose of this test. But
[42] Fix | Delete
# fortunately we know that when running under zsh, this script is always
[43] Fix | Delete
# being sourced, not executed, because hardly anyone is crazy enough to
[44] Fix | Delete
# install zsh as /bin/sh.
[45] Fix | Delete
case "$0" in
[46] Fix | Delete
gettext.sh | */gettext.sh | *\\gettext.sh)
[47] Fix | Delete
progname=$0
[48] Fix | Delete
package=gettext-runtime
[49] Fix | Delete
version=0.19.8.1
[50] Fix | Delete
# func_usage
[51] Fix | Delete
# outputs to stdout the --help usage message.
[52] Fix | Delete
func_usage ()
[53] Fix | Delete
{
[54] Fix | Delete
echo "GNU gettext shell script function library version $version"
[55] Fix | Delete
echo "Usage: . gettext.sh"
[56] Fix | Delete
}
[57] Fix | Delete
# func_version
[58] Fix | Delete
# outputs to stdout the --version message.
[59] Fix | Delete
func_version ()
[60] Fix | Delete
{
[61] Fix | Delete
echo "$progname (GNU $package) $version"
[62] Fix | Delete
echo "Copyright (C) 2003-2007 Free Software Foundation, Inc.
[63] Fix | Delete
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
[64] Fix | Delete
This is free software: you are free to change and redistribute it.
[65] Fix | Delete
There is NO WARRANTY, to the extent permitted by law."
[66] Fix | Delete
echo "Written by" "Bruno Haible"
[67] Fix | Delete
}
[68] Fix | Delete
if test $# = 1; then
[69] Fix | Delete
case "$1" in
[70] Fix | Delete
--help | --hel | --he | --h )
[71] Fix | Delete
func_usage; exit 0 ;;
[72] Fix | Delete
--version | --versio | --versi | --vers | --ver | --ve | --v )
[73] Fix | Delete
func_version; exit 0 ;;
[74] Fix | Delete
esac
[75] Fix | Delete
fi
[76] Fix | Delete
func_usage 1>&2
[77] Fix | Delete
exit 1
[78] Fix | Delete
;;
[79] Fix | Delete
esac
[80] Fix | Delete
fi
[81] Fix | Delete
[82] Fix | Delete
# eval_gettext MSGID
[83] Fix | Delete
# looks up the translation of MSGID and substitutes shell variables in the
[84] Fix | Delete
# result.
[85] Fix | Delete
eval_gettext () {
[86] Fix | Delete
gettext "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1")
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
# eval_ngettext MSGID MSGID-PLURAL COUNT
[90] Fix | Delete
# looks up the translation of MSGID / MSGID-PLURAL for COUNT and substitutes
[91] Fix | Delete
# shell variables in the result.
[92] Fix | Delete
eval_ngettext () {
[93] Fix | Delete
ngettext "$1" "$2" "$3" | (export PATH `envsubst --variables "$1 $2"`; envsubst "$1 $2")
[94] Fix | Delete
}
[95] Fix | Delete
[96] Fix | Delete
# Note: This use of envsubst is much safer than using the shell built-in 'eval'
[97] Fix | Delete
# would be.
[98] Fix | Delete
# 1) The security problem with Chinese translations that happen to use a
[99] Fix | Delete
# character such as \xe0\x60 is avoided.
[100] Fix | Delete
# 2) The security problem with malevolent translators who put in command lists
[101] Fix | Delete
# like "$(...)" or "`...`" is avoided.
[102] Fix | Delete
# 3) The translations can only refer to shell variables that are already
[103] Fix | Delete
# mentioned in MSGID or MSGID-PLURAL.
[104] Fix | Delete
#
[105] Fix | Delete
# Note: "export PATH" above is a dummy; this is for the case when
[106] Fix | Delete
# `envsubst --variables ...` returns nothing.
[107] Fix | Delete
#
[108] Fix | Delete
# Note: In eval_ngettext above, "$1 $2" means a string whose variables set is
[109] Fix | Delete
# the union of the variables set of "$1" and "$2".
[110] Fix | Delete
#
[111] Fix | Delete
# Note: The minimal use of backquote above ensures that trailing newlines are
[112] Fix | Delete
# not dropped, not from the gettext invocation and not from the value of any
[113] Fix | Delete
# shell variable.
[114] Fix | Delete
#
[115] Fix | Delete
# Note: Field splitting on the `envsubst --variables ...` result is desired,
[116] Fix | Delete
# since envsubst outputs the variables, separated by newlines. Pathname
[117] Fix | Delete
# wildcard expansion or tilde expansion has no effect here, since the words
[118] Fix | Delete
# output by "envsubst --variables ..." consist solely of alphanumeric
[119] Fix | Delete
# characters and underscore.
[120] Fix | Delete
[121] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function