Page 1 of 1
weather widget shows incorrect language
Posted: Sat 13 Aug 2011, 14:47
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?
Weather info in Englich
Posted: Mon 15 Aug 2011, 11:38
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