Author Topic: PHP for WXSIM icons/forecast (ala carterlake, multilingual)  (Read 4717 times)

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9293
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
PHP for WXSIM icons/forecast (ala carterlake, multilingual)
« on: March 30, 2007, 03:15:42 PM »
I know that WXSIM is used for plaintext.txt forecasts by some of you, so I'm posting here in addition to the primary WXSIM forum on weather-watch.com in this thread.  The ID names/links are on the Weather-Watch.com forum.
----------------------

I started this script based on an idea from doornenburgweer -- He had adapted Jordan Gerth's wsofd.php script to convert the plaintext.txt English forecast into Dutch. (see this thread).

I thought it was a great idea to make WXSIM output available in multiple languages. I wrote the plaintext-parser.php to create a carterlake-style forecast output that would use the carterlake (NOAA) icon set, would be easy to include in a weather website, generate XHTML 1.0-Strict output, and have built-in support for translations to other languages.  It also has the ability to display sky condition instead of the 'rain' icon for 'Chance rain' conditions where PoP is < 40% (adjustable in a setting in the script).. this idea was thanks to 'stuntman'.  An add-on set of PoP-stamped sky condition icons is included for folks already using the carterlake advforecast NOAA script.

My special thanks go to Jordan Gerth for creating the first set of plaintext.txt parsing/display functions, to doornenburgweer for his pioneering work on a Dutch translation, and to the folks who generated the language translation files (listed below) that this script uses and for testing the script set.

Thanks to your all! I hope you enjoy the script/translations .. this was truly an international effort.

Language plugins available for:

Danish thanks to jwwd
Dutch thanks to doornenburgweer
French thanks to Devil
Italian thanks to MD5
Norwegian thanks to Rush
Spanish thanks to Breitling
Swedish thanks to sm6kiw

The script, icons/add-on icons to the carterlake set, and language plugins along with demos are available at http://saratoga-weather.org/scripts-WXSIM.php

If you'd like to create a language translation plugin for other languages, please PM or email me -- I'd be pleased to support your effort!

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9293
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP for WXSIM icons/forecast (ala carterlake, multilingu
« Reply #1 on: June 03, 2007, 01:49:54 PM »
Just a bump to let folks know that the PHP and translation files have been updated to support display of wind direction/speed/units on the icons display.

To make the translations of wind cardinal directions work, a single line needs to be added to the associated plaintext-parser-lang-LL.txt file to enable the translations.  For the currently released language plugin files, I've added them to the respective files:

plaintext-parser-lang-dk.txt: added 'langlookup|NESW|NØSV|'
plaintext-parser-lang-es.txt: added 'langlookup|NESW|NESO|'
plaintext-parser-lang-fr.txt: added 'langlookup|NESW|NESO|'
plaintext-parser-lang-it.txt: added 'langlookup|NESW|NESO|'
plaintext-parser-lang-nl.txt: added 'langlookup|NESW|NOZW|'
 (note: also changed 'lang|A|Een|' to 'lang|A |Een |' in the -nl file)
plaintext-parser-lang-no.txt: added 'langlookup|NESW|NØSV|'
plaintext-parser-lang-pt.txt: added 'langlookup|NESW|NESO|'
plaintext-parser-lang-se.txt: added 'langlookup|NESW|NOSV|'

The wind parsing will show full values of the wind forecasts, including 'calm' (translated), '5 gust to 14' as '5-14' and 'becoming 3' as '⇒3'.

You can either add the one line 'langlookup' entry to your copy of the language plugin file, or download a new copy (and plaintext-parser.php V1.03) from
http://saratoga-weather.org/scripts-WXSIM.php#plaintext

Also, the calculation of <td> width for the icon cells was added to the code so it spreads the icons evenly through the space allowed.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9293
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP for WXSIM icons/forecast (ala carterlake, multilingu
« Reply #2 on: July 28, 2007, 12:02:27 AM »
I've done an update to the plaintext-parser.php (V1.04) to allow display of Beaufort scale for the highest wind forecast during the period (including gusts).  The setting is enabled by a $showBeaufort variable in the script.

Setting $showBeaufort = false;  will cause the script to NOT display the Beaufort scale for the highest wind for the period.

Setting $showBeaufort = 'V';  will show the Beaufort scale for the highest wind as 'n Bft' below the current wind units.

Setting $showBeaufort = 'T';  will show the Beaufort scale text description (translated) below the current wind units.

So far, I only have the Danish and Dutch translations for the scale values (they're added as new langlookup entries in the associated plaintext-parser-lang-LL.txt files i.e. -dk and -nl ) -- if other folks would provide the translations for the other supported languages, I'll add them to the lang files and redistribute.

A parallel update was done to plaintext-rss.php to support then new Beaufort Scale display (if it is enabled in the plaintext-parser.php).

Both are downloadable from http://saratoga-weather.org/scripts-WXSIM.php#plaintext
along with the updated Danish and Dutch language files.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9293
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP for WXSIM icons/forecast (ala carterlake, multilingu
« Reply #3 on: September 06, 2007, 08:24:00 PM »
Thanks to Thanos at http://www.meteothes.gr/ we now have a Greek language translation available for you.

To use it, you'll need an updated plaintext-parser.php (Version 1.06) which now supports a 'charset' directive in the language file.  Thanos' translation file uses ISO-8859-7 (Greek), so be sure the calling page for plaintext-parser.php (if you embed plaintext-parser.php in your website page) also uses
Code: [Select]
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7" /> in the <head></head> section for the Greek characters to display correctly.  The basic display page for the plaintext-parser.php switches from ISO-8859-1 to ISO-8859-7 for the lang=el parameter.

Download from the scripts page at http://saratoga-weather.org/scripts-WXSIM.php#plaintext

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

 

anything