Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 07:26
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects » Localization Project
weather widget shows incorrect language
Moderators: Lobster, MU, raffy
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
tenochslb

Joined: 10 Jul 2010
Posts: 36
Location: Mexico

PostPosted: Sat 13 Aug 2011, 10:47    Post_subject:  weather widget shows incorrect language
Sub_title: Is there a fix so that weather can correctly be shown in local language?
 

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?
pwidgets.png
 Description   
 Filesize   154.48 KB
 Viewed   540 Time(s)

pwidgets.png


Edited_times_total
Back to top
View user's profile Send_private_message 
tenochslb

Joined: 10 Jul 2010
Posts: 36
Location: Mexico

PostPosted: Mon 15 Aug 2011, 07:38    Post_subject: Weather info in Englich
Sub_title: Arch script
 

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:
#!/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
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Puppy Projects » Localization Project
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0461s ][ Queries: 13 (0.0063s) ][ GZIP on ]