Found issue with references.
parent
b26e703002
commit
70a07d6ae3
File diff suppressed because it is too large
Load Diff
17
trans.sh
17
trans.sh
|
@ -38,7 +38,7 @@ pons_request() {
|
|||
PONS_QUERY="$PONS_QUERY&ref=true"
|
||||
fi
|
||||
#echo "$PONS_QUERY"
|
||||
PONS_JSON=$( curl -s --header "X-Secret: $PONS_SECRET" $PONS_URI$PONS_QUERY )
|
||||
PONS_JSON=$( curl -s --header "X-Secret: $PONS_SECRET" $PONS_URI$PONS_QUERY | tr '\r\n' ' ' )
|
||||
# check if type of hit is translation
|
||||
pons_hits
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ pons_filter() {
|
|||
pons_tags() {
|
||||
source_t="$1"
|
||||
source_t=$( recode html..latin1 <<< $source_t )
|
||||
#source_t=$( recode html..latin9 <<< $source_t )
|
||||
old_color="$2"
|
||||
spn_color="$3"
|
||||
if [ -z $PONS_NOCOLOR ] ; then
|
||||
|
@ -100,8 +101,8 @@ pons_parse() {
|
|||
COLS=$(( $(tput cols) / 2 - 4 ))
|
||||
PONS_COUNT=0
|
||||
for lang_key in $(jq -r '.| keys | .[]' <<< $PONS_JSON); do
|
||||
cur_lang=$(echo $PONS_JSON | jq ".[$lang_key] | .language_p" | sed -e 's/^"//' -e 's/"$//')
|
||||
sub_lang=$(echo $PONS_JSON | jq ".[$lang_key]");
|
||||
cur_lang=$(echo "$PONS_JSON" | jq ".[$lang_key] | .language_p" | sed -e 's/^"//' -e 's/"$//')
|
||||
sub_lang=$(echo "$PONS_JSON" | jq ".[$lang_key]");
|
||||
if [ ! -z $PONS_LIMIT ] && [ "$PONS_COUNT" -gt "$PONS_LIMIT" ] ; then
|
||||
break
|
||||
fi
|
||||
|
@ -229,7 +230,7 @@ do
|
|||
esac
|
||||
done
|
||||
shift $((OPTIND -1))
|
||||
PONS_WORD=$1
|
||||
PONS_WORD=$(php -r "echo rawurlencode('$1');")
|
||||
|
||||
if [ "$PONS_HELP" == "1" ] ; then
|
||||
pons_help
|
||||
|
@ -239,13 +240,15 @@ elif [ "$PONS_RAW" == "1" ] ; then
|
|||
pons_config
|
||||
pons_request
|
||||
pons_filter
|
||||
PONS_JSON=$(echo $PONS_JSON | jq "$PONS_FILTER")
|
||||
echo -e $PONS_JSON | jq .
|
||||
PONS_JSON=$(echo "$PONS_JSON" | jq "$PONS_FILTER")
|
||||
PONS_JSON=$(echo -e $PONS_JSON) #| jq '.'
|
||||
echo $PONS_JSON | jq .
|
||||
else
|
||||
pons_config
|
||||
pons_request
|
||||
pons_filter
|
||||
PONS_JSON=$(echo $PONS_JSON | jq "$PONS_FILTER")
|
||||
PONS_JSON=$( echo "$PONS_JSON" | jq "$PONS_FILTER" )
|
||||
#PONS_JSON=$(jq $PONS_FILTER <<< $PONS_JSON)
|
||||
if [ "$PONS_HITS" -gt 0 ] ; then
|
||||
pons_parse_translate
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue