weather widget shows incorrect language

For efforts in internationalising Puppy and solving problems in this area
Post Reply
Message
Author
tenochslb

weather widget shows incorrect language

#1 Post by tenochslb »

It is important to be able to get the weather info in lets say Spanish. I am able to translate the layout but how would i go about changing the actual data to Spanish or any other language?
Attachments
pwidgets.png
(154.48 KiB) Downloaded 631 times
Last edited by tenochslb on Mon 15 Aug 2011, 14:00, edited 2 times in total.

tenochslb

Weather info in Englich

#2 Post by tenochslb »

Looking for an answer to my question i came across a website that solves this problem implementing some type of script. This applies to conky and I do not have the knowledge to understand it but some of you guys sure can adapt this to pwidgets:

Code: Select all

#!/bin/sh
#AccuWeather (r) RSS weather tool for conky
#
#USAGE: weather.sh <locationcode>
#
#(c) Michael Seiler 2007

METRIC=0 #Should be 0 or 1; 0 for F, 1 for C

if [ -z $1 ]; then
    echo
    echo "USAGE: weather.sh <locationcode>"
    echo
    exit 0;
fi

#curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 | perl -ne 'if (/Currently/) {chomp;/\<title\>Currently: (.*)?\<\/title\>/; print "$1"; }'

out=`curl --connect-timeout 30 -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 | perl -ne 'if (/Currently/) {chomp;/\<title\>Currently: (.*)?\<\/title\>/; print "$1"; }'`

#echo $out

cond=`echo $out | cut -d':' -f 1`
temp=`echo $out | cut -d':' -f 2`

case "$cond" in

'Fog')
    echo -e "Nombre\c"
;;
'Snow')
    echo -e "Nevado\c"
;;
'Cloudy')
    echo -e "Nublado\c"
;;
'Sunny')
   echo -e "Ensolarado\c"
;;
'T-Storms')
   echo -e "Pancada\c"
;;
*)
   echo -e  $cond'\c'
esac

echo : $temp
If you need help translating to spanish just let me know.
This particular script translates to portuguese.
Source: https://bbs.archlinux.org/viewtopic.php?id=37381

Post Reply