Update of /cvsroot/phpweather/phpweather/locales
In directory usw-pr-cvs1:/tmp/cvs-serv5469
Modified Files:
locale_common.php
Log Message:
I've added some comments
Index: locale_common.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/locales/locale_common.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- locale_common.php 2001/07/13 13:11:38 1.12
+++ locale_common.php 2001/07/14 19:41:29 1.13
@@ -88,16 +88,16 @@
*
* $new_pref_units can be one of the following strings:
*
- * - 'both_metric' if one wants to produce output like this:
+ * --- 'both_metric' if one wants to produce output like this:
* '10 kilometers (16.1 miles)'
*
- * - 'both_imperial' if one wants to produce output like this:
+ * --- 'both_imperial' if one wants to produce output like this:
* '16.1 miles (10 kilometers)'
*
- * - 'only_metric' if one wants to produce output like this:
+ * --- 'only_metric' if one wants to produce output like this:
* '10 kilometers'
*
- * - 'only_imperial' if one wants to produce output like this:
+ * --- 'only_imperial' if one wants to produce output like this:
* '16.1 miles'
*
* If $new_pref_units isn't recognized, 'both_imperial' will be used.
@@ -310,6 +310,10 @@
}
if ($condition == 'OVC') {
+ /* 'OCV' means that the sky is overcast. This is a special case,
+ * since the sentence starts with 'The sky was...' instead of
+ * 'There was...' in English.
+ */
$output = sprintf($this->strings['cloud_overcast'],
$this->properties['mark_begin'],
$this->properties['mark_end']) .
@@ -318,6 +322,7 @@
$this->properties['mark_begin'] . $ft .
$this->properties['mark_end'] . $this->strings['feet']);
} elseif ($condition == 'VV') {
+ /* This is for vertical visibility - another special case. */
$output = sprintf($this->strings['cloud_vertical_visibility'],
$this->properties['mark_begin'],
$this->properties['mark_end']) .
@@ -326,6 +331,9 @@
$this->properties['mark_begin'] . $ft .
$this->properties['mark_end'] . $this->strings['feet']);
} elseif($condition == 'CAVOK') {
+ /* 'CAVOK' means 'Ceiling And Visibility OK' - again we have a
+ * special case.
+ */
$output = sprintf($this->strings['cavok'],
$this->pref_units($this->properties['mark_begin'] .
'1500' .
@@ -335,7 +343,12 @@
'5000' .
$this->properties['mark_end'] .
$this->strings['feet']));
- } else {
+ } else {
+ /* We're dealing with a 'normal' cloud-group.
+ * We start by checking weather or not there are any
+ * comulonimbus clouds. The string will be inserted later in the
+ * output.
+ */
if (empty($cumulus)) {
$cumulus = '';
} elseif ($cumulus == 'CB') {
@@ -347,6 +360,11 @@
$this->error("\$cumulus not recognized: $cumulus");
}
+ /* Here comes the output. We start with the description of the
+ * clouds ('few', 'broken' etc) and then append $cumulus, which
+ * might be an empty string. Then comes the height of the
+ * cloud-layer.
+ */
$output = $this->properties['mark_begin'] .
$this->strings['cloud_condition'][$condition] .
$cumulus . $this->properties['mark_end'] . $this->strings['cloud_height'] .
@@ -361,8 +379,12 @@
/**
* Function used to parse a weather-group.
+ *
+ * @param array The weather-group to be parsed. The keys of the
+ * weather-group tells you which kind of weather
+ * you're dealing with. The value of the array is
+ * the unparsed codes, like 'RA' for 'rain' etc.
*
- * @param array The weather-group to be parsed.
* @access private
* @return string The string used in the pretty-print.
*/
@@ -397,7 +419,6 @@
* mean that we're dealing with some 'moderate' precipitation.
* If so, 'precipitation' can't be empty.
*/
-
if (!empty($weather_group['intensity'])) {
$output .= $this->strings['weather'][$weather_group['intensity']];
} elseif (!empty($weather_group['precipitation'])) {
@@ -405,7 +426,6 @@
}
/* There can only be one of the next three items. */
-
if (!empty($weather_group['precipitation'])) {
$output .= $this->strings['weather'][$weather_group['precipitation']];
} elseif (!empty($weather_group['obscuration'])) {
@@ -417,7 +437,6 @@
/* 'proximity' can only be 'VC'. We test for it here instead of
* earlier because it should be put last.
*/
-
if (!empty($weather_group['proximity'])) {
$output .= $this->strings['weather'][$weather_group['proximity']];
}
@@ -426,8 +445,14 @@
/**
* Function used to parse the tendency in a runway-group.
+ *
+ * @param string The tendency. Should be one of the characters
+ * 'U', 'D', or 'N' for an upward, downward, or no
+ * distinct tendency, respectively.
+ *
+ * If the tendency isn't recognized, an error will
+ * be raised.
*
- * @param string The tendency
* @access private
* @return string The string used in the pretty-print.
*/
@@ -458,6 +483,7 @@
* @param array The runway-group to be parsed.
* @access private
* @return string The string used in the pretty-print.
+ * @see runway_tendency()
*/
function parse_runway_group($runway_group) {
if (empty($runway_group) || !is_array($runway_group)) {
@@ -590,7 +616,7 @@
* @return string The pretty-printed output.
* @see decode_metar(), parse_weather_group(),
* parse_runway_group(), parse_cloud_group(),
- * parse_visibility_group()
+ * parse_visibility_group(), set_exclude()
*/
function print_pretty($data) {
_______________________________________________
PHPWeather-checkins mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/phpweather-checkins