You are not logged in.
well, im puzzled!
@sector11, can you try running the new weather_testing.lua template with the new v9000.lua?
once its working, then line 1123 should be this
tmhr=24change to this
tmhr="00"so you get,for example, 00:30 instaed of 24:30
Oh for crying out loud and I've been going NUTZ![]()
Even playing with LUA as well:
end--function image ##################################################################
-- Start 24 HR Function ##############################################################
function convert24(tm,suf)
local tmlen=string.len(tm)
local colon=string.find(tm,":")
if colon~=nil then
tmhr=string.sub(tm,1,colon-1)
tmmn=string.sub(tm,colon+1,tmlen)
else
tmhr=tmhr
tmmn=""
end
-- if suf=="PM" and tonumber(tmhr)~=12 then
-- tmhr="tmhr+12"
-- elseif suf=="PM" and tonumber(tmhr)==12 then
-- tmhr=12
if suf=="PM" and tonumber(tmhr)==12 then tmhr=12
elseif suf=="PM" and tonumber(tmhr)~=12 then tmhr=tmhr+12
elseif suf=="AM" and tonumber(tmhr)<10 then tmhr="0"..tmhr
elseif suf=="AM" and tonumber(tmhr)>9 and tonumber(tmhr)<12 then tmhr=tmhr
elseif suf=="AM" and tonumber(tmhr)==12 then tmhr=00
end
if colon~=nil then
return tmhr..":"..tmmn
else
return tmhr
end--if colon~=nil
end--of function
--END OF SCRIPTChanging the code to: "am" & "pm"
end--function image ##################################################################
-- Start 24 HR Function ##############################################################
function convert24(tm,suf)
local tmlen=string.len(tm)
local colon=string.find(tm,":")
if colon~=nil then
tmhr=string.sub(tm,1,colon-1)
tmmn=string.sub(tm,colon+1,tmlen)
else
tmhr=tmhr
tmmn=""
end
-- if suf=="PM" and tonumber(tmhr)~=12 then
-- tmhr="tmhr+12"
-- elseif suf=="PM" and tonumber(tmhr)==12 then
-- tmhr=12
if suf=="pm" and tonumber(tmhr)==12 then tmhr=12
elseif suf=="pm" and tonumber(tmhr)~=12 then tmhr=tmhr+12
elseif suf=="am" and tonumber(tmhr)<10 then tmhr="0"..tmhr
elseif suf=="am" and tonumber(tmhr)>9 and tonumber(tmhr)<12 then tmhr=tmhr
elseif suf=="am" and tonumber(tmhr)==00 then tmhr=00
end
if colon~=nil then
return tmhr..":"..tmmn
else
return tmhr
end--if colon~=nil
end--of function
--END OF SCRIPTworks perfectly ... but your idea of putting it elsewhere for people that do NOT translate "AM"="am" (might be different in various languages) is a must.![]()
Online
here is a screenshot from the template:
http://omploader.org/vY3dhbg/2012-02-29 … _scrot.png
the time (up left) works but the times for the sun rise / sun set /moon rise and moon set are still in 12h format.
here is a new weather condition for the translation table:
["AM Fog/PM Sun"]="vormittags Nebel/nachmittags Sonne",
Last edited by lionhead (2012-02-29 16:24:08)
Offline
here is a screenshot from the template:
http://omploader.org/vY3dhbg/2012-02-29 … _scrot.pngthe time (up left) works but the times for the sun rise / sun set /moon rise and moon set are still in 12h format.
here is a new weather condition for the translation table:
["AM Fog/PM Sun"]="vormittags Nebel/nachmittags Sonne",
In the ~/v9000_config.lua file look for this line:
--translate time suffixIn mine what follows is:
--translate time suffix
tsuffix={
AM="am",
PM="pm",
}--end of time suffix tableIf you changed AM and PM to something other than "AM" and "PM"
you have two oprions:
Change it back to:
--translate time suffix
tsuffix={
AM="AM",
PM="AM",
}--end of time suffix tableOr open v9000.lua and change the bottom part to reflect whatever you have for AM & PM.
Best thing to do for NOW - change the Translation tables in ~/v9000_config.lua back to the origiinal until mrpeachy fixes the v9000 script. 
Last edited by Sector11 (2012-02-29 17:05:53)
Online
this only added another zero! 
Offline
fixed in this archive http://dl.dropbox.com/u/19008369/new%20 … 000.tar.gz
should work no matter what you set in translation because it takes PM or AM from intellicast before its changed
once tested and working, ill change the main link
has anyone noticed if the length matching in the translate function has solved the half translated conditions?
Offline
it works now!
but i still test it 
here is an update for the german translation table: ["Fog Late"]="dichter Nebel",
Last edited by lionhead (2012-02-29 18:31:36)
Offline
One thing did not work ... but it did work as advertised.
The "3 Hour Forecast" - it is designed to show only the HOUR so in the template I added the 00 minutes:
out({blah blah,txt=now["fc_hour1_time_24"]..":00"})
out({blah blah,txt=now["fc_hour2_time_24"]..":00"})
out({blah blah,txt=now["fc_hour3_time_24"]..":00"})And now it's doing what it is supposed to do! This is a combination of Desktop 2 and the right portion of Desktop 3!![]()
@ mrpeachy put a release date of: Feb 29, 2012 on that sucker and get it up on the first post!
Very Very Good stuff!
Online
here is a link to .v9000_config.lua files for italian and german
http://dl.dropbox.com/u/19008369/v9000% … ges.tar.gz
these config files contain the same settings, i have just reordered them so that there are general settings first then settings related to translation together
ive been updating the post with intellicast weather types and updating the german config with lionheads translaions
Offline
here is a link to .v9000_config.lua files for italian and german
http://dl.dropbox.com/u/19008369/v9000% … ges.tar.gzthese config files contain the same settings, i have just reordered them so that there are general settings first then settings related to translation together
ive been updating the post with intellicast weather types and updating the german config with lionheads translaions
HEY!!!!!!!! Good idea, a few language files for testing...
Now I do Spanish for my wife.
Online
put a release date of: Feb 29, 2012 on that sucker and get it up on the first post!
done, and updated the data options list
Offline
why is the weather conditon still english as standard. but it's translated if u use the preview:
http://omploader.org/vY3didA/2012-02-29 … _scrot.png
Offline
why is the weather conditon still english as standard. but it's translated if u use the preview:
http://omploader.org/vY3didA/2012-02-29 … _scrot.png
that because it is still using the regular conditions for current now["conditions"]
not conditions_short, now["conditions_short"]
Offline
Sector11 wrote:put a release date of: Feb 29, 2012 on that sucker and get it up on the first post!
done, and updated the data options list
data options? What's that? What did I miss?
Hi lionhead....
Online
mrpeachy wrote:Sector11 wrote:put a release date of: Feb 29, 2012 on that sucker and get it up on the first post!
done, and updated the data options list
data options? What's that? What did I miss?
Hi lionhead....
nothing missed... just the 24 hour clock options
Offline
is it possible to make an other number format just for the translation.
for example: in english u write 1,000.00 and in germany (and other contries) you write 1.000,00
Offline
nothing missed... just the 24 hour clock options
Oh that - B*E*A*U*T*I*F*U*L Thanks. 
Online
the german translation isn't perfect yet. but i will post 'updates'!
i wait for the russian and the turkish translation! but my translator is a bit slow 
use this:
["AM Clouds/PM Sun"]="vormittags bewölkt/nachmittags sonnig",
["AM Rain/Snow Showers"]="vormittags Regen-/Schneeschauer",
["AM Showers"]="vormittags Regenschauer",
["AM Snow Showers/Wind"]="vormittags Schneeschauer/windig",
["AM Fog/PM Sun"]="vormittags Nebel/nachmittags Sonne",
["AM Drizzle"]="vormittags Sprühregen",
["PM Light Rain"]="nachmittags leichter Regen",
["Broken Clouds"]="durchbrochene Bewölkung",
["Few Clouds"]="leichte Bewölkung",
["Few Snow Showers"]="wenig Schneeschauer",
["Isolated Thunderstorms"]="vereinzelt Gewitter",
["Light Rain"]="leichter Regen",
["Light Rain Late"]="leichter Regen nachmittags",
["Light Rain/Wind"]="leichter Regen/windig",
["Fog Late"]="dichter Nebel",
["Moderate Fog"]="mäßig neblig",
["Mostly Cloudy"]="meist bewölkt",
["Mostly Sunny"]="meist sonnig",
["Partly Cloudy"]="teilweise wolkig",
["Partly Cloudy/Wind"]="teilweise wolkig/windig",
["Rain/Snow Showers"]="Regen-/Schneeschauer",
["Scattered Thunderstorms"]="vereinzelt Gewitter",
["Scattered Clouds"]="gering bewölkt",
["Scattered Showers"]="vereinzelt leichter Regen",
["Snow Showers Late"]="Schneeschauer nachmittags",
["Snow Showers"]="Schneeschauer",
["Showers Early"]="leichter Regen",
["Clear"]="klar",
["Cloudy"]="bewölkt",
["Haze"]="neblig",
["Overcast"]="zunehmend bedeckt",
["Showers"]="Schauer",
["Sunny"]="sonnig",
["Thunderstorm"]="Sturm",
["Wind Early"]="leicht windig",
["Wind"]="windig", Last edited by lionhead (2012-02-29 20:03:03)
Offline
is it possible to make an other number format just for the translation.
for example: in english u write 1,000.00 and in germany (and other contries) you write 1.000,00
i dont think im going to write that into v9000 but you can do it in the template script
if you want to put commas in place of periods
put this function right at the bottom of the template like this
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
function p2c(num)
local a,b=string.gsub(tostring(num),"%.",",")
return a
endthen use it like this
instead of, for example
out({ x=160,y=ypos,txt=now["pressure_mb"] })resulting in 1004.7
put this
out({ x=160,y=ypos,txt=p2c(now["pressure_mb"]) })and you get 1004,7
p2c for period to comma 
Last edited by mrpeachy (2012-02-29 20:09:02)
Offline
hmm, it's not working here:
Conky: llua_do_call: function conky_weather execution failed: /home/alexander/v9000/v9000.lua:981: attempt to call field '?' (a nil value)
Offline
hmm, it's not working here:
Conky: llua_do_call: function conky_weather execution failed: /home/alexander/v9000/v9000.lua:981: attempt to call field '?' (a nil value)
post the template script you are using
Offline
here is the template:
--[[
The latest script is a lua only weather script. aka: v9000
http://crunchbanglinux.org/forums/topic/16100/weather-in-conky/
the file:
http://dl.dropbox.com/u/19008369/v9000.tar.gz
mrppeachys LUA Tutorial
http://crunchbanglinux.org/forums/topic/17246/how-to-using-lua-scripts-in-conky/
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="Anonymous Pro:bold"--font must be in quotes
default_font_size=11
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
out({c=0x00BFFF,a=1,x=10,y=15,txt=now["date"].." "..now["month"].." "..now["year"]..": Fetched @ "..now["time_24"]})
image({x=20,y=20,h=40,w=40,file=now["weather_icon"]})
-- Temp / FeelsLike & CONDITIONS TEXT
out({c=0x48D1CC,a=1,f="Digital-7",fs=50,x=80,y=60,txt=now["temp"]})
out({c=0x00BFFF,a=1,f="Digital-7",fs=50,x=140,y=60,txt=now["feels_like"]})
out({c=0xA4FFA4,a=1,x=81,y=72,txt="Temp WC · HI"})
out({c=0x48D1CC,a=1,f="Zekton",fs=18,x=10,y=94,txt=conditions_short[1]})
-- data titles
-- data output
datay=110 -- y=datay or
datayy=15 -- y=datay+(datayy*1) use 1 or more
image({x=480,y=ypos,w=40,h=40,file=now["wind_icon"]})
image({x=520,y=ypos,w=40,h=40,file=moon_icon[1]})
image({x=420,y=ypos,w=30,h=30,file=alert_icon})
out({c=0xFAFAEC,a=1,x=10,y=datay,txt="Wind Chill:"})
out({c=0x48D1CC,a=1,x=70,y=datay,txt=now["wind_chill"].."°"})
out({c=0xFAFAEC,a=1,x=100,y=datay,txt="Heat Index:"})
out({c=0xFF8C00,a=1,x=165,y=datay,txt=now["heat_index"].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*1),txt="Today's Hi·Lo:"})
out({c=0xFF8C00,a=1,x=100,y=datay+(datayy*1),txt=high_temp[1].."°"})
out({c=0x48D1CC,a=1,x=140,y=datay+(datayy*1),txt=low_temp[1].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*2),txt="Wind:"})
out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*2),txt=now["wind_km"]})
out({c=0x48D1CC,a=1,x=110,y=datay+(datayy*2),txt=now["wind_nesw"]})
out({c=0xFAFAEC,a=1,x=140,y=datay+(datayy*2),txt="@"})
out({c=0x48D1CC,a=1,x=165,y=datay+(datayy*2),txt=now["wind_deg"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*3),txt="Hum:"})
out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*3),txt=now["humidity"].."%"})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*3),txt="DP:"})
out({c=0x48D1CC,a=1,x=145,y=datay+(datayy*3),txt=now["dew_point"].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*4),txt="Bar:"})
out({ x=160,y=ypos,txt=now["pressure_mb"] })
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*4),txt="Vis:"})
out({c=0x48D1CC,a=1,x=145,y=datay+(datayy*4),txt=now["visibility"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*5),txt="Ceil:"})
out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*5),txt=now["ceiling"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*6),txt="Precip:"})
out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*6),txt=precipitation[1].."%"})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*6),txt="Cloud:"})
out({c=0x48D1CC,a=1,x=150,y=datay+(datayy*6),txt=cloud_cover[1].."%"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*7),txt="UV:"})
out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*7),txt=uv_index_num[1]})
out({c=0x48D1CC,a=1,x=110,y=datay+(datayy*7),txt=uv_index_txt[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*8),txt="Sonne:"})
out({c=0xFAFAEC,a=1,x=60,y=datay+(datayy*8),txt=sun_rise_24[1].." Uhr <>"})
out({c=0x48D1CC,a=1,x=145,y=datay+(datayy*8),txt=sun_set_24[1].." Uhr"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*9),txt="Mond:"})
out({c=0xFAFAEC,a=1,x=60,y=datay+(datayy*9),txt=moon_rise_24[1]})
out({c=0x48D1CC,a=1,x=120,y=datay+(datayy*9),txt=moon_set_24[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*10),txt="Phase:"})
out({c=0x48D1CC,a=1,x=55,y=datay+(datayy*10),txt=moon_phase[1]})
--start or weather forecast table section
--set start forecast day
start_day=1
--set total forecast days you want to display
number_of_days=5
topy=15
topyy=135 -- topy+(topyy*1)
topx=285
topxx=137.5
--set coordinates for top lef corners for each repeat
top_left_x_coordinate[1],top_left_y_coordinate[1] =topx ,topy
top_left_x_coordinate[2],top_left_y_coordinate[2] =topx ,150
top_left_x_coordinate[3],top_left_y_coordinate[3] =10 ,290
top_left_x_coordinate[4],top_left_y_coordinate[4] =10+(topxx*1) ,290
top_left_x_coordinate[5],top_left_y_coordinate[5] =10+(topxx*2) ,290
--########################################################################################
for i=start_day,number_of_days-(start_day-1) do --start of day repeat, do not edit #######
tlx=top_left_x_coordinate[i] --sets top left x position for each repeat ##################
tly=top_left_y_coordinate[i] --sets top left y position for each repeat ##################
--########################################################################################
out({c=0xA4FFA4,a=1,x=tlx,y=tly,txt=forecast_day_short[i].." "..forecast_date[i].." "..forecast_month_short[i]})
image({x=tlx,y=tly+5,h=30,w=30,file=weather_icon[i]})
out({c=0xFF8C00,a=1,x=tlx+35,y=tly+15,txt=high_temp[i].."°"})
out({c=0x48D1CC,a=1,x=tlx+35,y=tly+30,txt=low_temp[i].."°"})
out({c=0x48D1CC,a=1,x=tlx,y=tly+50,txt=conditions_short[i]})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+65,txt="P: "..precipitation[i].."%"})
out({c=0xFAFAEC,a=1,x=tlx+50,y=tly+65,txt="UV: "..uv_index_num[i]})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+80,txt="H: "..humidity[i].."%"})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+95,txt="S: "..sun_rise_24[i]})
out({c=0x48D1CC,a=1,x=tlx+73,y=tly+95,txt=sun_set_24[i]})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+110,txt="M: "..moon_rise_24[i]})
out({c=0x48D1CC,a=1,x=tlx+73,y=tly+110,txt=moon_set_24[i]})
--########################################################################################
end--of forecast repeat section ##########################################################
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################Offline
that template doesnt have the p2c function
and re-reading your error message, you put the function into v9000.lua
it goes in the template file and then is called in the template file
like this
--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION-
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--#######################################################################
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="mono"--font must be in quotes
default_font_size=10
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
out({ x=160,y=ypos,txt=p2c(now["pressure_mb"]) })
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
function p2c(num)
local a,b=string.gsub(tostring(num),"%.",",")
return a
endOffline
@mrpeachy
the script seems to work perfect now. what do u think?
Offline
@mrpeachy
the script seems to work perfect now. what do u think?
i think it is done in terms of features
i think perhaps a little more is needed for the translation
its pretty windy here and it seems that EVERY condition is now Condition/Wind
even "Thunderstorms/Wind" ... which is kind of pointless
but that does mean, using the length matching you are going to have a translation of
["Thunderstorms"]="T.Storms"
["Thunderstorms/Wind"]="T.Storms/Wnd"
["Clear"]="Clr"
["Clear/Wind"]="Clr/Wnd"
and so on and so on while it would be nice to have wind translated only once
["Wind"]="Wnd"
["Partly Cloudy"]="Prt Cldy"
then ignore the "/wind" part of any 2 part conditions, then length match just the first part
so intellicast gives "Partly Cloudy/Wind"
the script recognises the "/Wind" part and changes it to "/Wnd"
THEN it matches "Partly Cloudy" by both length and text and converts to "Prt Cldy"
and combines then to output
Prt Cldy/Wndit sounds complicated, but i dont think it would be too much extra code
and would cut down the length of the con_short table considerable
which has the added benefit of making the table matching part quicker
shorter table means less work for the script
BUT
i can also think of some reasons not to do it this way
it leads to an extra level of complexity in making entries into the table
ie more rules to follow when setting it up
Last edited by mrpeachy (2012-02-29 21:44:05)
Offline
its pretty windy here and it seems that EVERY condition is now Condition/Wind
even "Thunderstorms/Wind" ... which is kind of pointless
indeed,this sounds pointless

Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.