CVS: phpweather/output pw_images.php,NONE,1.1 pw_text.php,NONE,1.1 pw...
Brought to you by:
iridium
From: Martin G. <gim...@us...> - 2002-03-17 13:39:08
|
Update of /cvsroot/phpweather/phpweather/output In directory usw-pr-cvs1:/tmp/cvs-serv22745/output Added Files: pw_images.php pw_text.php pw_text_da.php pw_text_en.php pw_text_hu.php pw_text_no.php Log Message: The new output modules. pw_text does that locale_common did before, and pw_text_xx are the localized version of the class. pw_images is new - it selects suitable images for display with or instead of the textual report. --- NEW FILE --- <?php /* Copyright (c) 2002 Raymond van Beek <ra...@de...>. Licensed under the GPL, see the file COPYING. Parts of this code are derived from the phpweather.inc code by Martin Geisler <gim...@gi...> Also see http://www.gimpster.com/php/phpweather/ or http://www.sourceforge.net/projects/phpweather for updates and further instructions on how to use PHP Weather. */ class pw_images extends base_object { var $itime = ''; // ======================================================================= // This section contains user configurable items: The user can // configure the image filenames to be generated by the script. // An array to convert the weather group codes to an index of the // $images and $n_images array. var $phenomena_array = array ('#' => 'None', 'TS' => 'Thun', 'RA' => 'Rain', 'DZ' => 'Rain', 'SN' => 'Snow', 'SG' => 'Snow', 'GR' => 'Hail', 'GS' => 'Hail', 'PE' => 'Hail', 'IC' => 'Hail', 'BR' => 'Fog', 'FG' => 'Fog'); // An array to convert the cloud coverage codes to an index of the // $images and $n_images array. var $coverage = array ('CLR' => '0', 'SKC' => '0', 'FEW' => '1', 'SCT' => '2', 'BKN' => '3', 'OVC' => '4', 'VV' => '4'); var $sky_nodata_image = 'sky_nodata.gif'; // Define a lot of images for daylight weather-group/cloud // condition. It's a 2-dimensional array, indexed by the: // - Precipitation (first index) // - Cloud coverage (second index). var $images = array ('None' => array ('0' => '0cloud.gif', '1' => '1cloud_norain.gif', '2' => '2cloud_norain.gif', '3' => '3cloud_norain.gif', '4' => '4cloud_norain.gif'), '-Rain' => array ('0' => '0cloud.gif', '1' => '1cloud_lightrain.gif', '2' => '2cloud_lightrain.gif', '3' => '3cloud_lightrain.gif', '4' => '4cloud_lightrain.gif'), 'Rain' => array ('0' => '0cloud.gif', '1' => '1cloud_modrain.gif', '2' => '2cloud_modrain.gif', '3' => '3cloud_modrain.gif', '4' => '4cloud_modrain.gif'), '+Rain' => array ('0' => '0cloud.gif', '1' => '1cloud_heavyrain.gif', '2' => '2cloud_heavyrain.gif', '3' => '3cloud_heavyrain.gif', '4' => '4cloud_heavyrain.gif'), '-Snow' => array ('0' => '0cloud.gif', '1' => '2cloud_snow.gif', '2' => '2cloud_snow.gif', '3' => '3cloud_snow.gif', '4' => '4cloud_lightsnow.gif'), '+Snow' => array ('0' => '0cloud.gif', '1' => '2cloud_snow.gif', '2' => '2cloud_snow.gif', '3' => '3cloud_snow.gif', '4' => '4cloud_heavysnow.gif'), '-Hail' => array ('0' => '0cloud.gif', '1' => '2cloud_hail.gif', '2' => '2cloud_hail.gif', '3' => '3cloud_hail.gif', '4' => '4cloud_lighthail.gif'), '+Hail' => array ('0' => '0cloud.gif', '1' => '2cloud_hail.gif', '2' => '2cloud_hail.gif', '3' => '3cloud_hail.gif', '4' => '4cloud_heavyhail.gif'), 'Thun' => array ('0' => '0cloud.gif', '1' => '2cloud_thunders.gif', '2' => '2cloud_thunders.gif', '3' => '3cloud_thunders.gif', '4' => '4cloud_thunders.gif'), 'Fog' => array ('0' => '0cloud_fog.gif', '1' => '1cloud_fog.gif', '2' => '2cloud_fog.gif', '3' => '3cloud_fog.gif', '4' => '4cloud_fog.gif') ); // Define a lot of images for nigh time weather-group/cloud // condition. It has the same structure as the daylight array // $images It's a 2-dimensional array, indexed by the: // - Precipitation (first index) // - Cloud coverage (second index). var $n_images = array ( 'None' => array ('0' => 'n_0cloud.gif', '1' => 'n_1cloud_norain.gif', '2' => 'n_2cloud_norain.gif', '3' => 'n_3cloud_norain.gif', '4' => '4cloud_norain.gif'), '-Rain' => array ('0' => 'n_0cloud.gif', '1' => 'n_1cloud_lightrain.gif', '2' => 'n_2cloud_lightrain.gif', '3' => 'n_3cloud_lightrain.gif', '4' => '4cloud_lightrain.gif'), 'Rain' => array ('0' => 'n_0cloud.gif', '1' => 'n_1cloud_modrain.gif', '2' => 'n_2cloud_modrain.gif', '3' => 'n_3cloud_modrain.gif', '4' => '4cloud_modrain.gif'), '+Rain' => array ('0' => 'n_0cloud.gif', '1' => 'n_1cloud_heavyrain.gif', '2' => 'n_2cloud_heavyrain.gif', '3' => 'n_3cloud_heavyrain.gif', '4' => '4cloud_heavyrain.gif'), '-Snow' => array ('0' => 'n_0cloud.gif', '1' => 'n_2cloud_snow.gif', '2' => 'n_2cloud_snow.gif', '3' => 'n_3cloud_snow.gif', '4' => '4cloud_lightsnow.gif'), '+Snow' => array ('0' => 'n_0cloud.gif', '1' => 'n_2cloud_snow.gif', '2' => 'n_2cloud_snow.gif', '3' => 'n_3cloud_snow.gif', '4' => '4cloud_heavysnow.gif'), '-Hail' => array ('0' => 'n_0cloud.gif', '1' => 'n_2cloud_hail.gif', '2' => 'n_2cloud_hail.gif', '3' => 'n_3cloud_hail.gif', '4' => '4cloud_lighthail.gif'), '+Hail' => array ('0' => 'n_0cloud.gif', '1' => 'n_2cloud_hail.gif', '2' => 'n_2cloud_hail.gif', '3' => 'n_3cloud_hail.gif', '4' => '4cloud_heavyhail.gif'), 'Thun' => array ('0' => 'n_0cloud.gif', '1' => 'n_2cloud_thunders.gif', '2' => 'n_2cloud_thunders.gif', '3' => 'n_3cloud_thunders.gif', '4' => '4cloud_thunders.gif'), 'Fog' => array ('0' => 'n_0cloud_fog.gif', '1' => 'n_1cloud_fog.gif', '2' => 'n_2cloud_fog.gif', '3' => 'n_3cloud_fog.gif', '4' => '4cloud_fog.gif') ); // Define image filenames for: // - 16 wind directions, // - 'no wind direction data' // - variable wind direction (VRB) // - calm wind (00000KT), or 'nodir' var $wind_dir_images = array (0 => 'nnn.gif', 1 => 'nne.gif', 2 => 'ne.gif', 3 => 'nee.gif', 4 => 'eee.gif', 5 => 'see.gif', 6 => 'se.gif', 7 => 'sse.gif', 8 => 'sss.gif', 9 => 'ssw.gif', 10 => 'sw.gif', 11 => 'sww.gif', 12 => 'www.gif', 13 => 'nww.gif', 14 => 'nw.gif', 15 => 'nnw.gif', 16 => 'nnn.gif'); var $wind_nodata_image = 'wind_nodata.gif'; var $wind_vrb_image = 'vrb.gif'; var $wind_nodir_image = 'nodir.gif'; // Define image filenames for: // - 'no data' condition, // - 'temperature zero or below zero degrees Celcius // - 'temperature above zero degrees Celcius var $temp_nodata_image = 'temp_nodata.gif'; var $temp_low_image = 'templow.gif'; var $temp_high_image = 'temphigh.gif'; // ====================================================================== // The wind_speeds array can be used to convert wind speed values in // [m/s] to [Bft] (beaufort). var $wind_speeds = array ( 'beaufort' => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), 'ms' => array (0.3, 1.6, 3.4, 5.5, 8.0, 10.8, 13.9, 17.2, 20.8, 24.5, 28.5, 32.7, 999)); // ------------------------------------------------------------------------ /** * This is where the object with the weather is stored. * * @var phpweather $weather */ var $weather = null; function pw_images($w, $input) { $this->weather = $w; /* We call the parent constructor. */ $this->base_object($input); } // The get_sky_image() function takes the processed metar data and // returns the sky image filename. The function combines the weather // group and cloud group to a specific image. Example html code: // // <img src="< ?php // get_image($processed_metar) // ? >" height="50" width="80" border="1"> function get_sky_image() { $processed_metar_data = $this->weather->decode_metar(); $metar = $processed_metar_data['metar']; $parts = explode(' ', $metar); $num_parts = count($parts); $night = 0; $maxcoverage = 0; for ($i = 0; $i < $num_parts; $i++) { $part = $parts[$i]; if (ereg('RMK|TEMPO|BECMG', $part)) { /* The rest of the METAR is either a remark or temporary information. We skip the rest of the METAR. */ break; } elseif (ereg('([0-9]{2})([0-9]{2})([0-9]{2})Z', $part, $regs)) { if (($regs[2] < 6) || ($regs[2] > 18)) { $night = 1; } } elseif (ereg('^(-|\+|VC)?(TS|SH|FZ|BL|DR|MI|BC|PR|RA|DZ|SN|SG|GR|GS|PE|IC|UP|BR|FG|FU|VA|DU|SA|HZ|PY|PO|SQ|FC|SS|DS)+$', $part)) { /* * Is this the current weather group? */ // Get the intensity and get rid of it in the $part string $intensity = ''; if (ereg('^(-|\+|VC)(..)*$',$part)) { if ($part[0] == '-') { $intensity = '-'; $part = substr($part,1); } elseif ($part[0] == '+') { $intensity = '+'; $part = substr($part,1); } elseif ($part[0] . $part[1] == 'VC') { $intensity = ''; $part = substr($part,2); } } // Now, take only the precipitation types that have images. // Ignore the others In case more then one exist, take only the // first one (highest predominance). ereg('(TS|RA|DZ|SN|SG|GR|GS|PE|IC|BR|FG)(..)*$',$part,$match); if ($match[1] != '') { $phenomena = $match[1]; } else { ereg('(..)(TS|RA|DZ|SN|SG|GR|GS|PE|IC|BR|FG)(..)*$',$part,$match); if ($match[2] != '') { $phenomena = $match[2]; } } // Not each precipitation type has a single image with it. // Combine similar precipitation types to a phenomena group. // I.e. drizzle (DZ) and rain (RA) are both considered to be // rain (as far as the images are concerned). Add intensity only // in case of rain and snow. if (ereg('^(Snow|Hail)$',$this->phenomena_array[$phenomena])) { if ($intensity == '') { $intensity = '-'; } } if (ereg('^(Rain|Snow|Hail)$',$this->phenomena_array[$phenomena])) { $phenomena_group = $intensity . $this->phenomena_array[$phenomena]; } else { $phenomena_group = $this->phenomena_array[$phenomena]; } } // Now check the cloud coverage. There could be three cloud // layers, so check for all of them. Iconize the most covered // clouds, thus find the highest cloudcoverage layer, by // maximizing the $maxcoverage param elseif (ereg('(SKC|CLR)(...)', $part, $regs)) { $maxcoverage = max($maxcoverage,$this->coverage[$regs[1]]); // if ($maxcoverage < $this->coverage[$regs[1]]) { // $maxcoverage = $this->coverage[$regs[1]]; // } } elseif (ereg('^(VV|FEW|SCT|BKN|OVC)([0-9]{3})(CB|TCU)?$', $part, $regs)) { $maxcoverage = max($maxcoverage,$this->coverage[$regs[1]]); // if ($maxcoverage < $this->coverage[$regs[1]]) { // $maxcoverage = $this->coverage[$regs[1]]; // } } } // If looped through all groups and not found any weather group // (meaning no precipitation?), assume a '#' phenomena, resulting in // a 'None' phenomena group if (empty($phenomena)) { $phenomena = '#'; $phenomena_group = $this->phenomena_array[$phenomena]; } // At this point, the $phenomena_group variable contains the one // index of the $this->images array, while the $maxcoverage // variable contains the other index of the $this->images array. // The correct image can be selected from the array. if (($night == 1) || ($this->itime == 'nite')) { return 'icons/' . $this->n_images[$phenomena_group][$maxcoverage]; } else { return 'icons/' . $this->images[$phenomena_group][$maxcoverage]; } } // ------------------------------------------------------------------------ // The get_winddir_image() function takes the processed metar data and // returns the appropriate wind direction image filename. There are 16 // wind direction icons defined to indicate the wind direction. Beside // the 16 directions, there are icons for variable wind direction, // calm wind and and an icon for the no data condition. Example html // code: // // <img src="< ?php // get_winddir_image($processed_metar) // ? >" height="40" width="40" border="1"> function get_winddir_image() { $processed_metar_data = $this->weather->decode_metar(); if (!empty($processed_metar_data['wind'])) { $wind = $processed_metar_data['wind']; if ($wind['deg'] == 'VRB') { return 'icons/' . $this->wind_vrb_image; } elseif (($wind['deg'] == 0) && ($wind['knots'] == 0)) { return 'icons/' . $this->wind_nodir_image; } else { return 'icons/' . $this->wind_dir_images[round($wind['deg']/22.5)]; } } else { return 'icons/' . $this->wind_nodata_image; } } // ------------------------------------------------------------------------ // The get_temp_image() function takes the processed metar data and // returns the appropriate temperature image filename. It uses the // 'temp_c' value to decide weather a freezing thermometer icon or a // non-freezing thermometer icon. When the 'temp_c' data is not // available, a 'no data' icon filename is returned. Example html // code: // // <img src="< ?php // get_temp_image($processed_metar) // ? >" height="50" width="20" border="1"> function get_temp_image() { $processed_metar_data = $this->weather->decode_metar(); if (!empty($processed_metar_data['temperature'])) { if ($processed_metar_data['temperature']['temp_c'] > 0) { return 'icons/' . $this->temp_high_image; } else { return 'icons/' . $this->temp_low_image; } } else { return 'icons/' . $this->temp_nodata_image; } } // ------------------------------------------------------------------------ // The get_beaufort() function takes the 'wind_meters_per_second' // value from the $decoded_metar array and converts it to beaufort // values. This is done by iterating through a table with windspeeds // in [m/s] and [bft] values. function get_beaufort() { $processed_metar_data = $this->weather->decode_metar(); if (!empty($processed_metar_data['wind'])) { $ms = $processed_metar_data['wind']['meters_per_second']; $cnt = 0; while (($ms > $wind_speeds['ms'][$cnt]) && ($cnt <= 12)) { $cnt++; } return $cnt; } else { return 0; } } // ------------------------------------------------------------------------ // The set_time() function is purely added for overruling the metar // time to night time. It is only intended to support displaying all // weathergroup icons in the table.php script during daytime. function set_time($ntime) { $this->itime = $ntime; } // ------------------------------------------------------------------------ } ?> --- NEW FILE --- <?php /** * Provides all the function needed to generate text output. * * This class has the capability to do a pretty-print, if it is * provided with the right set of strings. It's up to child-classes to * provide these strings, and override the methods in this class, as * necessary. The logic in the pretty-print is built around the English * output, but it should still be possible to make a good translation, by * just translating the strings. * * @author Martin Geisler <gim...@gi...> * @version $Id: pw_text.php,v 1.1 2002/03/17 13:39:04 gimpster Exp $ */ class pw_text extends base_object { /** * The strings used in the translation are stored here. [...1108 lines suppressed...] echo ' <th>' . $this->strings['temperature'] . "</th>\n"; echo ' <th>' . $this->strings['pressure'] . "</th>\n"; echo ' <th>' . $this->strings['humidity'] . "</th>\n"; echo " </tr>\n"; echo " <td>$location</td> <td>$date</td> <td>$wind</td> <td>$temperature</td> <td>$pressure</td> <td>$humidity%</td> </tr> </table> "; } } } ?> --- NEW FILE --- <?php require_once(PHPWEATHER_BASE_DIR . '/output/pw_text.php'); /** * Provides all the strings needed by locale_common to produce Danish output. * * @author Martin Geisler <gim...@gi...> * @version $Id: pw_text_da.php,v 1.1 2002/03/17 13:39:04 gimpster Exp $ */ class pw_text_da extends pw_text { /** * This constructor provides all the strings used. * * @param array This is just passed on to locale_common() */ function pw_text_da($weather, $input) { $this->strings['charset'] = 'ISO-8859-1'; $this->strings['no_data'] = 'Desværre! Der er ingen data for %s%s%s.'; $this->strings['list_sentences_and'] = ' og '; $this->strings['list_sentences_comma'] = ', '; $this->strings['list_sentences_final_and'] = ' og '; $this->strings['location'] = 'Dette er en rapport for %s%s%s.'; $this->strings['minutes'] = ' minutter'; $this->strings['time_format'] = 'Denne rapport blev lavet for %s siden, kl. %s%s%s UTC.'; $this->strings['time_minutes'] = 'og %s%s%s minutter'; $this->strings['time_one_hour'] = '%sen%s time %s'; $this->strings['time_several_hours'] = '%s%s%s timer %s'; $this->strings['time_a_moment'] = 'et øjeblik'; $this->strings['meters_per_second'] = ' meter pr. sekund'; $this->strings['miles_per_hour'] = ' mil pr. time'; $this->strings['meter'] = ' meter'; $this->strings['meters'] = ' meter'; $this->strings['feet'] = ' fod'; $this->strings['kilometers'] = ' kilometer'; $this->strings['miles'] = ' mil'; $this->strings['and'] = ' og '; $this->strings['plus'] = ' plus '; $this->strings['with'] = ' med '; $this->strings['wind_blowing'] = 'Vindhastigheden var '; $this->strings['wind_with_gusts'] = ' med vindstød på up til '; $this->strings['wind_from'] = ' fra '; $this->strings['wind_variable'] = ' fra %svarierende%s retninger.'; + $this->strings['wind_varying'] = ', varierende mellem %s%s%s (%s%s°%s) og %s%s%s (%s%s°%s)'; $this->strings['wind_calm'] = 'Vinden var %sstille%s'; $this->strings['wind_dir'] = array( 'nord', 'nord/nordøst', 'nordøst', 'øst/nordøst', 'øst', 'øst/sydøst', 'sydøst', 'syd/sydøst', 'syd', 'syd/sydvest', 'sydvest', 'vest/sydvest', 'vest', 'vest/nordvest', 'nordvest', 'nord/nordvest', 'nord'); $this->strings['wind_dir_short'] = array( 'N', 'NNØ', 'NØ', 'ØNØ', 'Ø', 'ØSØ', 'SØ', 'SSØ', 'S', 'SSV', 'SV', 'VSV', 'V', 'VNV', 'NV', 'NNV', 'N'); $this->strings['wind_dir_short_long'] = array( 'N' => 'nord', 'NØ' => 'nordøst', 'Ø' => 'øst', 'SØ' => 'sydøst', 'S' => 'syd', 'SV' => 'sydvest', 'V' => 'vest', 'NV' => 'nordvest' ); $this->strings['temperature'] = 'Temperaturen var '; $this->strings['dew_point'] = ', med et dugpunkt på '; $this->strings['altimeter'] = 'Lufttrykket var '; $this->strings['hPa'] = ' hPa'; $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'Den relative luftfugtigheden var '; $this->strings['cloud_group_beg'] = 'Der var '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'Himlen var %sskyfri%s.'; $this->strings['cloud_height'] = ' skyer i en højde af '; $this->strings['cloud_overcast'] = 'Himlen var %soverskyet%s i en højde af '; $this->strings['cloud_vertical_visibility'] = 'den %svertikale sigtbarhed%s var '; $this->strings['cloud_condition'] = array( 'SKC' => 'skyfri', 'CLR' => 'skyfri', 'FEW' => 'nogle få', 'SCT' => 'spredte', 'BKN' => 'brudte', 'OVC' => 'overskyet'); $this->strings['cumulonimbus'] = ' cumulus skyer'; $this->strings['towering_cumulus'] = ' stakkede cumulus skyer'; $this->strings['cavok'] = ' ingen skyer under %s og ingen cumulus skyer'; $this->strings['currently'] = 'Vejrforholdene er i øjeblikket '; $this->strings['weather'] = array('-' => 'let ', ' ' => 'moderat ', '+' => 'kraftig ', 'VC' => ' i nærheden', 'PR' => ' delvis', 'BC' => ' banker af', 'MI' => ' lave', 'DR' => ' lave drivende', 'BL' => ' blæsende', 'SH' => ' byger med', 'TS' => ' tordenvejr', 'FZ' => ' frysende', 'DZ' => ' finregn', 'RA' => ' regn', 'SN' => ' sne', 'SG' => ' sne korn', 'IC' => ' is krystaller', 'PL' => ' is kugler', 'GR' => ' hagl', 'GS' => ' små hagl', 'UP' => ' ukendt', 'BR' => ' dis', 'FG' => ' tåge', 'FU' => 'røg', 'VA' => 'vulkansk aske', 'DU' => 'udbredt støv', 'SA' => 'sand', 'HZ' => 'tåge/dis', 'PY' => 'byge', 'PO' => 'veludviklet støv/sand hvirvler', 'SQ' => 'vindstød', 'FC' => 'tornado/skypumpe', 'SS' => 'sandstorm/støvstorm'); $this->strings['visibility'] = 'Sigtbarheden var '; $this->strings['visibility_greater_than'] = 'større end '; $this->strings['visibility_less_than'] = 'mindre end '; $this->strings['runway_upward_tendency'] = ' med en %sstigende%s tendens'; $this->strings['runway_downward_tendency'] = ' med en %sfaldende%s tendens'; $this->strings['runway_no_tendency'] = ' uden %snogen distinkt%s tendens'; $this->strings['runway_between'] = 'mellem '; $this->strings['runway_left'] = ' venstre'; $this->strings['runway_central'] = ' midt'; $this->strings['runway_right'] = ' højre'; $this->strings['runway_visibility'] = 'Sigtbarheden var '; $this->strings['runway_for_runway'] = ' for bane '; /* We run the parent constructor */ $this->pw_text($weather, $input); } } ?> --- NEW FILE --- <?php require_once(PHPWEATHER_BASE_DIR . '/output/pw_text.php'); /** * Provides all the strings needed by pw_text to produce English * output. * * @author Martin Geisler <gim...@gi...> * @link http://www.gimpster.com/ My homepage. * @version $Id: pw_text_en.php,v 1.1 2002/03/17 13:39:04 gimpster Exp $ */ class pw_text_en extends pw_text { /** * This constructor provides all the strings used. * * @param array This is just passed on to locale_common() */ function pw_text_en($weather, $input) { $this->strings['charset'] = 'ISO-8859-1'; $this->strings['no_data'] = 'Sorry! There\'s no data available for %s%s%s.'; $this->strings['list_sentences_and'] = ' and '; $this->strings['list_sentences_comma'] = ', '; $this->strings['list_sentences_final_and'] = ', and '; $this->strings['location'] = 'This is a report for %s%s%s.'; $this->strings['minutes'] = ' minutes'; $this->strings['time_format'] = 'The report was made %s ago, at %s%s%s UTC.'; $this->strings['time_minutes'] = 'and %s%s%s minutes'; $this->strings['time_one_hour'] = '%sone%s hour %s'; $this->strings['time_several_hours'] = '%s%s%s hours %s'; $this->strings['time_a_moment'] = 'a moment'; $this->strings['meters_per_second'] = ' meters per second'; $this->strings['miles_per_hour'] = ' miles per hour'; $this->strings['meter'] = ' meter'; $this->strings['meters'] = ' meters'; $this->strings['feet'] = ' feet'; $this->strings['kilometers'] = ' kilometers'; $this->strings['miles'] = ' miles'; $this->strings['and'] = ' and '; $this->strings['plus'] = ' plus '; $this->strings['with'] = ' with '; $this->strings['wind_blowing'] = 'The wind was blowing at a speed of '; $this->strings['wind_with_gusts'] = ' with gusts up to '; $this->strings['wind_from'] = ' from '; $this->strings['wind_variable'] = ' from %svariable%s directions.'; $this->strings['wind_varying'] = ', varying between %s%s%s (%s%s°%s) and %s%s%s (%s%s°%s)'; $this->strings['wind_calm'] = 'The wind was %scalm%s'; $this->strings['wind_dir'] = array( 'north', 'north/northeast', 'northeast', 'east/northeast', 'east', 'east/southeast', 'southeast', 'south/southeast', 'south', 'south/southwest', 'southwest', 'west/southwest', 'west', 'west/northwest', 'northwest', 'north/northwest', 'north'); $this->strings['wind_dir_short'] = array( 'N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N'); $this->strings['wind_dir_short_long'] = array( 'N' => 'north', 'NE' => 'northeast', 'E' => 'east', 'SE' => 'southeast', 'S' => 'south', 'SW' => 'southwest', 'W' => 'west', 'NW' => 'northwest' ); $this->strings['temperature'] = 'The temperature was '; $this->strings['dew_point'] = ', with a dew-point at '; $this->strings['altimeter'] = 'The atmospheric pressure was '; $this->strings['hPa'] = ' hPa'; $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'The relative humidity was '; $this->strings['cloud_group_beg'] = 'There were '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'The sky was %sclear%s.'; $this->strings['cloud_height'] = ' clouds at a height of '; $this->strings['cloud_overcast'] = 'The sky was %sovercast%s from a height of '; $this->strings['cloud_vertical_visibility'] = 'the %svertical visibility%s was '; $this->strings['cloud_condition'] = array( 'SKC' => 'clear', 'CLR' => 'clear', 'FEW' => 'a few', 'SCT' => 'scattered', 'BKN' => 'broken', 'OVC' => 'overcast'); $this->strings['cumulonimbus'] = ' cumulonimbus'; $this->strings['towering_cumulus'] = ' towering cumulus'; $this->strings['cavok'] = ' no clouds below %s and no cumulonimbus clouds'; $this->strings['currently'] = 'Currently '; $this->strings['weather'] = array( '-' => ' light', ' ' => 'moderate ', '+' => 'heavy ', 'VC' => ' in the vicinity', 'PR' => ' partial', 'BC' => ' patches of', 'MI' => ' shallow', 'DR' => ' low drifting', 'BL' => ' blowing', 'SH' => ' showers of', 'TS' => ' thunderstorm', 'FZ' => ' freezing', 'DZ' => ' drizzle', 'RA' => ' rain', 'SN' => ' snow', 'SG' => ' snow grains', 'IC' => ' ice crystals', 'PL' => ' ice pellets', 'GR' => ' hail', 'GS' => ' small hail', 'UP' => ' unknown', 'BR' => ' mist', 'FG' => ' fog', 'FU' => ' smoke', 'VA' => ' volcanic ash', 'DU' => ' widespread dust', 'SA' => ' sand', 'HZ' => ' haze', 'PY' => ' spray', 'PO' => ' well-developed dust/sand whirls', 'SQ' => ' squalls', 'FC' => ' funnel cloud tornado waterspout', 'SS' => ' sandstorm/duststorm'); $this->strings['visibility'] = 'The overall visibility was '; $this->strings['visibility_greater_than'] = 'greater than '; $this->strings['visibility_less_than'] = 'less than '; $this->strings['visibility_to'] = ' to the '; $this->strings['runway_upward_tendency'] = ' with an %supward%s tendency'; $this->strings['runway_downward_tendency'] = ' with a %sdownward%s tendency'; $this->strings['runway_no_tendency'] = ' with %sno distinct%s tendency'; $this->strings['runway_between'] = 'between '; $this->strings['runway_left'] = ' left'; $this->strings['runway_central'] = ' central'; $this->strings['runway_right'] = ' right'; $this->strings['runway_visibility'] = 'The visibility was '; $this->strings['runway_for_runway'] = ' for runway '; $this->strings['wind'] = 'Wind'; $this->strings['date'] = 'Date'; $this->strings['pressure'] = 'Air Pressure'; $this->strings['humidity'] = 'Humidity'; $this->strings['location'] = 'Location'; /* We run the parent constructor */ $this->pw_text($weather, $input); } } ?> --- NEW FILE --- <?php require_once(PHPWEATHER_BASE_DIR . '/output/pw_text.php'); /** * Provides all the strings needed by locale_common to produce * Hungarian output. * A magyar szövegû idõjárásjelentéshez a locale_common innen * veszi a sztringeket. * * @author Mihály Gyulai <gy...@my...> * @link http://gyulai.freeyellow.com/ The homepage of the author. * @version $Id: pw_text_hu.php,v 1.1 2002/03/17 13:39:04 gimpster Exp $ */ class pw_text_hu extends pw_text { /** * This constructor provides all the strings used. * * @param array This is just passed on to locale_common() * Ezt a paramétert átadjuk locale_common() -nak. */ function pw_text_hu($weather, $input) { $this->strings['charset'] = 'ISO-8859-2'; $this->strings['no_data'] = 'Sajnos nincs adat %s%s%s számára.'; $this->strings['list_sentences_and'] = ' és '; $this->strings['list_sentences_comma'] = ', '; $this->strings['list_sentences_final_and'] = ', és '; $this->strings['location'] = 'Idõjárásjelentés %s%s%s számára.'; $this->strings['minutes'] = ' '; $this->strings['time_format'] = 'A jelentés %s perccel ezelõtt készült, %s%s%s UTC-kor.'; $this->strings['time_minutes'] = 'és %s%s%s '; $this->strings['time_one_hour'] = '%segy%s órával %s'; $this->strings['time_several_hours'] = '%s%s%s órával %s'; $this->strings['time_a_moment'] = 'jelenleg'; $this->strings['meters_per_second'] = ' m/s'; $this->strings['miles_per_hour'] = ' mérföld/h'; $this->strings['meter'] = ' m'; $this->strings['meters'] = ' m'; $this->strings['feet'] = ' láb'; $this->strings['kilometers'] = ' km'; $this->strings['miles'] = ' mérföld'; $this->strings['and'] = ' és '; $this->strings['plus'] = ' és '; $this->strings['with'] = ''; $this->strings['wind_blowing'] = 'Szélsebesség: '; $this->strings['wind_with_gusts'] = ' széllökések: '; $this->strings['wind_from'] = ' iránya: '; $this->strings['wind_variable'] = ' %skülönbözõ%s irányokból.'; $this->strings['wind_varying'] = ', változik %s%s%s (%s%s°%s) és %s%s%s (%s%s°%s) között'; $this->strings['wind_calm'] = 'Szél %snem fújt%s'; $this->strings['wind_dir'] = array( 'Észak', 'Észak/Északkelet', 'Északkelet', 'Kelet/Északkelet', 'Kelet', 'Kelet/Délkelet', 'Délkelet', 'Dél/Délkelet', 'Dél', 'Dél/Délnyugat', 'Délnyugat', 'Nyugat/Délnyugat', 'Nyugat', 'Nyugat/Északnyugat', 'Északnyugat', 'Észak/Északnyugat', 'Észak'); $this->strings['wind_dir_short'] = array( 'É', 'É/ÉK', 'ÉK', 'K/ÉK', 'K', 'K/DK', 'DK', 'D/DK', 'D', 'D/DNY', 'DNY', 'NY/DNY', 'NY', 'NY/ÉNY', 'ÉNY', 'É/ÉNY', 'É' ); $this->strings['wind_dir_short_long'] = array( 'É' => 'északi', 'ÉK' => 'északkeleti', 'K' => 'keleti', 'DK' => 'délkeleti', 'D' => 'déli', 'DNY' => 'délnyugati', 'NY' => 'nyugati', 'ÉNY' => 'északnyugati' ); $this->strings['temperature'] = 'A hõmérséklet '; $this->strings['dew_point'] = ', a harmatpont '; $this->strings['altimeter'] = 'A légköri nyomás '; $this->strings['hPa'] = ' hPa'; $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'A relatív páratartalom '; $this->strings['cloud_group_beg'] = 'Az égbolton'; $this->strings['cloud_group_end'] = ' magasságban.'; $this->strings['cloud_clear'] = 'Az égbolt %sfelhõtlen%s volt.'; $this->strings['cloud_height'] = 'felhõ '; $this->strings['cloud_overcast'] = 'az égbolt %sborult%s '; $this->strings['cloud_vertical_visibility'] = 'a %sfüggõleges láthatóság%s '; $this->strings['cloud_condition'] = array( 'SKC' => ' derült', 'CLR' => ' tiszta', 'FEW' => ' néhány ', 'SCT' => ' szórványos ', 'BKN' => ' szakadozott ', 'OVC' => ' borult'); $this->strings['cumulonimbus'] = ' gomoly'; $this->strings['towering_cumulus'] = ' vihar'; $this->strings['cavok'] = ' nincsenek felhõk %s magasságban, és nincs gomolyfelhõ'; $this->strings['currently'] = 'Jellemzõ: '; $this->strings['weather'] = array( '-' => ' könnyû ', ' ' => ' enyhe ', '+' => ' erõs ', 'VC' => ' a közelben', 'PR' => ' részleges', 'BC' => ' szakadozott', 'MI' => ' felszínes', 'DR' => 'enyhe légmozgás', 'BL' => 'széllökés', 'SH' => 'zápor', 'TS' => 'zivatar', 'FZ' => 'fagy', 'DZ' => 'szitáló esõ', 'RA' => 'esõ', 'SN' => 'hó', 'SG' => 'szemcsés hó', 'IC' => 'jégkristály', 'PE' => 'jégdara', 'GR' => 'jégesõ', 'GS' => 'apró jégesõ és/vagy hódara', 'UP' => 'ismeretlen', 'BR' => 'köd', 'FG' => 'sûrû köd', 'FU' => 'füst', 'VA' => 'vulkáni hamu', 'DU' => 'kiterjedt por', 'SA' => 'homok', 'HZ' => 'pára', 'PY' => 'permet', 'PO' => 'por/homok örvény', 'SQ' => 'szélroham', 'FC' => 'felhõtölcsér/tornádó/vízoszlop', 'SS' => 'homokvihar/porvihar' ); $this->strings['visibility'] = 'A láthatóság általában '; $this->strings['visibility_greater_than'] = 'nagyobb, mint '; $this->strings['visibility_less_than'] = 'kisebb, mint '; $this->strings['runway_upward_tendency'] = ' %snövekvõ%s tendenciával'; $this->strings['runway_downward_tendency'] = ' %scsökkenõ%s tendenciával'; $this->strings['runway_no_tendency'] = ' határozott %stendencia nélkül%s'; $this->strings['runway_between'] = 'közötti? '; $this->strings['runway_left'] = ' bal'; $this->strings['runway_central'] = ' középsõ'; $this->strings['runway_right'] = ' jobb'; $this->strings['runway_visibility'] = 'A láthatóság '; $this->strings['runway_for_runway'] = ' a kifutópályán '; /* We run the parent constructor */ $this->pw_text($weather, $input); } } ?> --- NEW FILE --- <?php require_once(PHPWEATHER_BASE_DIR . '/output/pw_text.php'); /** * Provides all the strings needed by locale_common to produce * Norwegian output. * * @author Sven-Erik Andersen <sve...@an...> * @version locale_no.php,v 1.3 2001/11/22 02:33:00 sven-erik Exp $ */ class pw_text_no extends pw_text { /** * This constructor provides all the strings used. * * @param array This is just passed on to locale_common() */ function pw_text_no($weather, $input) { $this->strings['charset'] = 'ISO-8859-1'; $this->strings['no_data'] = 'Beklager! Det var ingen ingen data tilgjengelig for %s%s%s.'; $this->strings['list_sentences_and'] = ' og '; $this->strings['list_sentences_comma'] = ', '; $this->strings['list_sentences_final_and'] = ', og '; $this->strings['location'] = 'Dette er en rapport for %s%s%s.'; $this->strings['minutes'] = ' minutter'; $this->strings['time_format'] = 'Denne rapporten ble laget for %s siden, klokka %s%s%s UTC.'; $this->strings['time_minutes'] = 'og %s%s%s minutter'; $this->strings['time_one_hour'] = '%sone%s time %s'; $this->strings['time_several_hours'] = '%s%s%s timer %s'; $this->strings['time_a_moment'] = 'et øyeblikk'; $this->strings['meters_per_second'] = ' meter per sekund'; $this->strings['miles_per_hour'] = ' miles per time'; $this->strings['meter'] = ' meter'; $this->strings['meters'] = ' meter'; $this->strings['feet'] = ' fot'; $this->strings['kilometers'] = ' kilometer'; $this->strings['miles'] = ' miles'; $this->strings['and'] = ' og '; $this->strings['plus'] = ' plus '; $this->strings['with'] = ' med '; $this->strings['wind_blowing'] = 'Vinden hadde en hastighet på '; $this->strings['wind_with_gusts'] = ' med vindkast opp mot '; $this->strings['wind_from'] = ' fra '; $this->strings['wind_variable'] = ' fra %svariable%s retninger.'; $this->strings['wind_varying'] = ', varierende mellom '; $this->strings['wind_calm'] = 'Vinden var %scalm%s'; $this->strings['wind_dir'] = array( 'nord', 'nord/nordøst', 'nordøst', 'øst/nordøst', 'øst', 'øst/sørøst', 'sørøst', 'sør/sørøst', 'sør', 'sør/sørvest', 'sørvest', 'vest/sørvest', 'vest', 'vest/nordvest', 'nordvest', 'nord/nordvest', 'nord'); $this->strings['wind_dir_short'] = array( 'N', 'NNØ', 'NØ', 'ØNØ', 'Ø', 'ØSØ', 'SØ', 'SSØ', 'S', 'SSV', 'SV', 'VSV', 'V', 'VNV', 'NV', 'NNV', 'N'); $this->strings['wind_dir_short_long'] = array( 'N' => 'nord', 'NE' => 'nordøst', 'E' => 'øst', 'SE' => 'sørøst', 'S' => 'sør', 'SW' => 'sørvest', 'W' => 'vest', 'NW' => 'nordvest' ); $this->strings['temperature'] = 'Temperaturen var '; $this->strings['dew_point'] = ', med ett duggpunkt på '; $this->strings['altimeter'] = 'Lufttrykket var '; $this->strings['hPa'] = ' hPa'; $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'Den relative fuktigheten var '; $this->strings['cloud_group_beg'] = 'Det var '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'Himmelen var %sclear%s.'; $this->strings['cloud_height'] = ' skyer i en høyde av '; $this->strings['cloud_overcast'] = 'himmelen var %sovercast%s fra en høyde av '; $this->strings['cloud_vertical_visibility'] = 'den %svertical visibility%s var '; $this->strings['cloud_condition'] = array( 'SKC' => 'clear', 'CLR' => 'clear', 'FEW' => 'a few', 'SCT' => 'scattered', 'BKN' => 'broken', 'OVC' => 'overcast'); $this->strings['cumulonimbus'] = ' bygeskyer'; $this->strings['towering_cumulus'] = ' tårnende haugskyer'; $this->strings['cavok'] = ' ingen skyer under %s og ingen bygeskyer'; $this->strings['currently'] = 'Værforholdene er i øjeblikket '; $this->strings['weather'] = array( '-' => 'lett ', ' ' => 'moderat ', '+' => 'kraftig ', 'PR' => 'delvis ', 'BC' => 'banker ', 'MI' => 'shallow ', 'DR' => 'lavt drivende ', 'BL' => 'blåser ', 'SH' => 'skur ', 'TS' => 'tordenvær ', 'FZ' => 'frysende ', 'DZ' => 'duskregn ', 'RA' => 'regn ', 'SN' => 'snø ', 'SG' => 'snø korn ', 'IC' => 'is krystaller ', 'PL' => 'is korn ', 'GR' => 'hagl ', 'GS' => 'små hagl og/eller snø korn ', 'UP' => 'ukjent ', 'BR' => 'dis ', 'FG' => 'tåke ', 'FU' => 'røyk ', 'VA' => 'vulkanisk aske ', 'DU' => 'mye støv ', 'SA' => 'sand ', 'HZ' => 'dis ', 'PY' => 'duskregn ', 'PO' => 'godt utviklede støv/sand virvler ', 'SQ' => 'vindkast ', 'FC' => 'trombe/tornado/skypumpe ', 'SS' => 'sandstorm/støvstorm '); $this->strings['visibility'] = 'Den generelle sikten var '; $this->strings['visibility_greater_than'] = 'større enn '; $this->strings['visibility_less_than'] = 'mindre enn '; $this->strings['runway_upward_tendency'] = ' med en %supward%s tendens'; $this->strings['runway_downward_tendency'] = ' med en %sdownward%s tendens'; $this->strings['runway_no_tendency'] = ' med %sno distinct%s tendens'; $this->strings['runway_between'] = 'mellom '; $this->strings['runway_left'] = ' venstre'; $this->strings['runway_central'] = ' midtre'; $this->strings['runway_right'] = ' høyre'; $this->strings['runway_visibility'] = 'Sikten var '; $this->strings['runway_for_runway'] = ' for rullebane '; /* We run the parent constructor */ $this->pw_text($weather, $input); } } ?> |