Update of /cvsroot/phpweather/phpweather/locales
In directory usw-pr-cvs1:/tmp/cvs-serv13725/locales
Modified Files:
locale_common.php locale_en.php
Log Message:
I've updated the code that produces the weather-string, so that it's
more correct now. It probably still needs some testing.
Index: locale_common.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/locales/locale_common.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- locale_common.php 2001/06/27 11:27:27 1.1
+++ locale_common.php 2001/06/28 11:44:01 1.2
@@ -315,16 +315,32 @@
return;
}
- $output = '';
+ $output = '';
+
+ if ($weather_group['descriptor'] == 'TS' &&
+ !empty($weather_group['precipitation'])) {
+ $output .= $this->strings['weather'][$weather_group['descriptor']] .
+ $this->strings['with'];
+ } else {
+ $output .= $this->strings['weather'][$weather_group['descriptor']];
+ }
if (!empty($weather_group['intensity'])) {
$output .= $this->strings['weather'][$weather_group['intensity']];
+ } elseif (!empty($weather_group['precipitation'])) {
+ /* We should only use 'moderate' intensity for precipitation. */
+ $output .= $this->strings['weather'][' '];
+ }
+ if (!empty($weather_group['precipitation'])) {
+ $output .= $this->strings['weather'][$weather_group['precipitation']];
+ } elseif (!empty($weather_group['obscuration'])) {
+ $output .= $this->strings['weather'][$weather_group['obscuration']];
+ } elseif (!empty($weather_group['other'])) {
+ $output .= $this->strings['weather'][$weather_group['other']];
}
- if (!empty($weather_group['prefix'])) {
- $output .= $this->strings['weather'][$weather_group['prefix']];
+ if (!empty($weather_group['proximity'])) {
+ $output .= $this->strings['weather'][$weather_group['proximity']];
}
- if (!empty($weather_group['weather'])) {
- $output .= $this->strings['weather'][$weather_group['weather']];
- }
+
return $output;
}
@@ -832,18 +848,25 @@
if (!in_array('weather', $this->properties['exclude']) &&
!empty($weather_group1)) {
- $weather_str = 'Currently ' . $this->parse_weather_group($weather_group1);
+ $weather_str = 'Currently ' .
+ $this->properties['mark_begin'] .
+ $this->parse_weather_group($weather_group1) .
+ $this->properties['mark_end'];
if (!empty($weather_group2)) {
- $weather_str = $weather_str . $this->strings['and'] .
- $this->parse_weather_group($weather_group2);
+ $weather_str = $weather_str . $this->strings['plus'] .
+ $this->properties['mark_begin'] .
+ $this->parse_weather_group($weather_group2) .
+ $this->properties['mark_end'];
}
if (!empty($weather_group3)) {
- $weather_str = $weather_str . $this->strings['and'] .
- $this->parse_weather_group($weather_group3);
+ $weather_str = $weather_str . $this->strings['plus'] .
+ $this->properties['mark_begin'] .
+ $this->parse_weather_group($weather_group3) .
+ $this->properties['mark_end'];
}
if (!empty($weather_str)) {
- $output['weather'] = $weather_str;
+ $output['weather'] = $weather_str . '.';
}
}
Index: locale_en.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/locales/locale_en.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- locale_en.php 2001/06/27 11:27:27 1.1
+++ locale_en.php 2001/06/28 11:44:01 1.2
@@ -1,5 +1,5 @@
<?php
-require_once(PHPWEATHER_BASE_DIR . '/locales//locale_common.php');
+require_once(PHPWEATHER_BASE_DIR . '/locales/locale_common.php');
/**
* Provides all the strings needed by locale_common to produce English output.
@@ -35,6 +35,8 @@
$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 ';
@@ -112,35 +114,36 @@
'-' => 'light ',
' ' => 'moderate ',
'+' => 'heavy ',
- 'PR' => 'partial ',
- 'BC' => 'patches of ',
- 'MI' => 'shallow ',
- 'DR' => 'low drifting ',
- 'BL' => 'blowing ',
- 'SH' => 'showers of ',
- 'TS' => 'thunderstorms ',
- 'FZ' => 'freezing ',
- 'DZ' => 'drizzle ',
- 'RA' => 'rain ',
- 'SN' => 'snow ',
- 'SG' => 'snow grains ',
- 'IC' => 'ice crystals ',
- 'PL' => 'ice pellets ',
- 'GR' => 'hail ',
- 'GS' => 'small hail and/or snow pellets ',
- '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 ');
+ '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 ';
_______________________________________________
PHPWeather-checkins mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/phpweather-checkins