Hi Robert,
Your current forecast at http://www.meteo-bleiswijk.nl/verwachting.html doesn’t currently show the ‘Severe Storm’ icon, but maybe it will help you if I explain how plaintext-parser.php does its work at slicing the plaintext.txt forecast up for icons and for translation.
First the plaintext.txt is sliced up into paragraphs, one for each forecast period. The paragraph is scanned using a table built from the plaintext-parser-data.txt file ‘cond’ entries which look like this
# type | keyword(s) | day-icon | night-icon | Caption
#
cond|severe|nsvrtsra|nsvrtsra|Severe storm|
cond|showery or intermittent. Some thunder|scttsra|nscttsra|Showers storms|
cond|thunder possible|scttsra|nscttsra|Showers storms|
cond|thunder|tsra|ntsra|Thunder storm|
cond|rain and sleet|raip|nraip|Rain Sleet|
cond|freezing rain and snow|raip|nraip|FrzgRn Snow|
cond|rain and snow|rasn|nrasn|Rain and Snow|
cond|freezing rain|fzra|fzra|Freezing Rain|
cond|rain likely|ra|nra|Rain likely|
cond|chance of rain|ra|nra|Chance rain|
cond|mix|rasn|rasn|Mix|
cond|sleet|ip|ip|Sleet|
cond|snow|sn|nsn|Snow
cond|fog in the morning|sctfg|nbknfg|Fog a.m.|
cond|fog after midnight|sctfg|nbknfg|Fog late|
cond|fog|fg|nfg|Fog|
cond|wind chill down to -|cold|cold|Very Cold|
cond|heat index up to 1|hot|hot|Very Hot|
cond|partly cloudy|sct|nsct|Partly Cloudy|
cond|mostly cloudy|bkn|nbkn|Mostly Cloudy|
cond|cloudy|cloudy|ncloudy|Cloudy|
cond|overcast|ovc|novc|Overcast|
cond|partly sunny|sct|nsct|Partly Sunny|
cond|mostly sunny|few|nfew|Mostly Sunny|
cond|mostly clear|few|nfew|Mostly Clear|
cond|sunny|skc|nskc|Sunny|
cond|clear|skc|nskc|Clear|
cond|fair|few|nfew|Fair|
cond|cloud|bkn|nbkn|Variable Clouds|
#
The search for the english text in the forecast paragraph proceeds from the top of the list to the bottom, and stops with the first ‘hit’. That hit determines the icon names for day/night and the forecast caption to be used. If the word ‘severe’ appears in the forecast paragraph, then the severe icon and ‘Severe storm’ is the english caption used for the weather condition for that forecast period.
If a translation file is used, then the condition is translated by direct lookup in the ‘langlookup’ entries in the language file, which for Dutch look like this:
# Summary conditions lookup
langlookup|Severe storm|Zware storm
langlookup|Showers storms|Regen storm
langlookup|Thunder storm|Onweer
langlookup|Rain Sleet|Natte sneeuw
langlookup|FrzgRn Snow|Ijzel/sneeuw
langlookup|Rain and Snow|Sneeuwregen
langlookup|Freezing Rain|Ijzel
langlookup|Rain likely|Grote kans op regen
langlookup|Chance rain|Kans op regen
langlookup|Mix|Ijzel/sneeuw
langlookup|Sleet|Natte sneeuw
langlookup|Snow|Sneeuw
langlookup|Fog a.m.|Ochtend mist
langlookup|Fog late|Laat mist
langlookup|Fog|Mist
langlookup|Very Cold|Erg koud
langlookup|Very Hot|Erg warm
langlookup|Partly Cloudy|Gedeeltelijk bewolkt
langlookup|Mostly Cloudy|Overwegend bewolkt
langlookup|Cloudy|Bewolkt
langlookup|Overcast|Bewolkt
langlookup|Partly Sunny|Gedeeltelijk zonnig
langlookup|Mostly Sunny|Overwegend zonnig
langlookup|Mostly Clear|Overwegend helder
langlookup|Sunny|Zonnig
langlookup|Clear|Helder
langlookup|Fair|Stapelwolken
langlookup|Variable Clouds|Half bewolkt
while the text is translated based on applying all the substitutions for words/phrases in the ‘lang’ entries of the plaintext-parser-lang-nl.txt file, starting at the first ‘lang’ entry and proceeding to the last ‘lang’ entry.
The fixed words/phrases for forecast period name (day of week), UV condition description, Beaufort Wind scale value are all done via direct lookup in ‘langlookup’ entries in the language file.
So… if you want to change the condition icon description for ‘Zware storm’ to ‘Zware regen’, the best place to do it is in the plaintext-parser-lang-nl.txt file to change the line
langlookup|Severe storm|Zware storm
to
langlookup|Severe storm|Zware regen
You might want to discuss it with Gerard (doornenburgweer) since he’s the ‘keeper’ of the Dutch translation file.
Of course, you are free to modify the software and table in any way you like.
Hope this helps,
Best regards,
Ken