CVS: phpweather/output pw_text.php,1.15,1.16 pw_text_da.php,1.8,1.9 p...
Brought to you by:
iridium
|
From: Martin G. <gim...@us...> - 2002-10-20 15:57:21
|
Update of /cvsroot/phpweather/phpweather/output
In directory usw-pr-cvs1:/tmp/cvs-serv26239
Modified Files:
pw_text.php pw_text_da.php pw_text_en.php pw_text_no.php
Log Message:
Fix for a problem found by Sean <se...@ar...>. The problem
was, that the report said 'There were The sky was overcast...' when we
had a OVC cloud group. This should fix that problem.
I've also changed the translation of 'cloud_vertical_visibility' so
that it fits into the 'There was ...' part. I've updated the English,
Danish ans Norwegian translations.
Index: pw_text.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- pw_text.php 28 Aug 2002 21:12:16 -0000 1.15
+++ pw_text.php 20 Oct 2002 15:57:15 -0000 1.16
@@ -819,29 +819,42 @@
if (empty($clouds[0]) ||
$clouds[0]['condition'] == 'CLR' ||
$clouds[0]['condition'] == 'SKC') {
+ /* Nice, clear weather: */
return sprintf($this->strings['cloud_clear'],
$this->properties['mark_begin'],
$this->properties['mark_end']);
} else {
+ /* We have up to three cloud groups: */
+ $cloud_str0 = $cloud_str1 = $cloud_str2 = $ovc = '';
- $cloud_str1 = $this->parse_cloud_group($clouds[0]);
- if (!empty($clouds[1])) {
- $cloud_str2 = $this->parse_cloud_group($clouds[1]);
+
+ if ($clouds[0]['condition'] == 'OVC') {
+ /* The first layer is overcast so we can return
+ * immediately: */
+ return $this->parse_cloud_group($clouds[0]);
} else {
- $cloud_str2 = '';
+ $cloud_str0 = $this->parse_cloud_group($clouds[0]);
+ }
+
+ if (!empty($clouds[1])) {
+ if ($clouds[1]['condition'] == 'OVC') {
+ $ovc = $this->parse_cloud_group($clouds[1]);
+ } else {
+ $cloud_str1 = $this->parse_cloud_group($clouds[1]);
+ }
}
if (!empty($clouds[2])) {
- $cloud_str3 = $this->parse_cloud_group($clouds[2]);
- } else {
- $cloud_str3 = '';
+ if ($clouds[2]['condition'] == 'OVC') {
+ $ovc = $this->parse_cloud_group($clouds[2]);
+ } else {
+ $cloud_str2 = $this->parse_cloud_group($clouds[2]);
+ }
}
-
+
return $this->strings['cloud_group_beg'] .
- $this->list_sentences($cloud_str1,
- $cloud_str2,
- $cloud_str3) .
- $this->strings['cloud_group_end'];
+ $this->list_sentences($cloud_str0, $cloud_str1, $cloud_str2) .
+ $this->strings['cloud_group_end'] . ' ' . $ovc;
}
}
Index: pw_text_da.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text_da.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- pw_text_da.php 28 Aug 2002 21:13:40 -0000 1.8
+++ pw_text_da.php 20 Oct 2002 15:57:15 -0000 1.9
@@ -103,7 +103,7 @@
$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_vertical_visibility'] = 'en %svertikale sigtbarhed%s på ';
$this->strings['cloud_condition'] =
array(
'SKC' => 'skyfri',
Index: pw_text_en.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text_en.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- pw_text_en.php 28 Aug 2002 21:13:40 -0000 1.8
+++ pw_text_en.php 20 Oct 2002 15:57:15 -0000 1.9
@@ -104,7 +104,7 @@
$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_vertical_visibility'] = 'a %svertical visibility%s of ';
$this->strings['cloud_condition'] =
array(
'SKC' => 'clear',
Index: pw_text_no.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text_no.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- pw_text_no.php 28 Aug 2002 21:13:40 -0000 1.8
+++ pw_text_no.php 20 Oct 2002 15:57:15 -0000 1.9
@@ -103,7 +103,7 @@
$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_vertical_visibility'] = 'en %svertical visibility%s på ';
$this->strings['cloud_condition'] = array(
'SKC' => 'skyfri',
'CLR' => 'skyfri',
|