cloudy cloudy

Author Topic: Carterlake/AJAX/PHP Multilingual template available  (Read 41965 times)

0 Members and 1 Guest are viewing this topic.

Offline pinto

  • Posts: 766
  • Belgium
    • weather station Kampenhout
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #15 on: July 02, 2008, 08:16:39 PM »
we have no validation on some languages(i.e fly-out menu)

Code: [Select]
langlookup|Forecast & Advisories|Vooruitzicht & waarschuwingen|
this is for the language-nl.txt

it is the &--bug  #-o

Jozef

Offline saratogaWX

  • Global Moderator
  • Posts: 5,939
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #16 on: July 02, 2008, 09:19:50 PM »
Dang.. thought I'd caught them all... thanks again, Jozef.

Change (in language-nl.txt)
Code: [Select]
langlookup|Forecast & Advisories|Vooruitzicht & waarschuwingen| to
Code: [Select]
langlookup|Forecast & Advisories|Vooruitzicht & waarschuwingen| and it should validate fine.

I've updated the distribution WD-World-ML and the Dutch language pack (language-nl.zip)

Best regards,
Ken

Edit:  Caught the same naked '&' instead of '&' in the Danish, Italian, Norwegian and Swedish translations too, so I've updated the distribution and those language packs.  They now validate XHTML1.0-Transitional too.
« Last Edit: July 02, 2008, 09:44:54 PM by ktrue »
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline Arnt

  • Posts: 260
  • Windows 10
  • Norway - 65.52 N / 13.12 E
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #17 on: July 03, 2008, 09:33:16 AM »
Heat color word shows 1 step "colder" than correct word. It shows correct during page load, but when ajax kicks in, its wrong.

var langHeatWords = new Array ( /* used for Heat Color Word */
 'Unknown', 'Extreme Heat Danger', 'Heat Danger', 'Extreme Heat Caution', 'Extremely Hot', 'Uncomfortably Hot',
 'Hot', 'Warm', 'Comfortable', 'Cool', 'Cold', 'Uncomfortably Cold', 'Very Cold', 'Extreme Cold' );

If putting in another 'Unknown' so that its 2 in a row, correct heat color word is shown.

Arnt

Update: Things are probably correct, it may be my own personal settings in WD that causes it.
« Last Edit: July 03, 2008, 10:12:58 AM by Arnt »

Offline atsio

  • Weather at Thessaloniki - Northern Greece.
  • Posts: 419
  • Macedonia is GREECE! Study history!
  • Thessaloniki - Greece
    • Weather conditions at Thessaloniki Historical Center-Central Macedonia-Greece
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #18 on: July 03, 2008, 11:44:28 AM »
Sorry Ken for leaving out this phrase from the translation!  #-o

That happens when somebody works late at night!  :sleepy3:

Thanos

Offline Gert

  • Posts: 93
    • Toppen Weather - Denmark
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #19 on: July 03, 2008, 12:20:13 PM »
Hi

Regarding the session wide cookie.

I have now tried 3 different computers and I can't keep the chosen language for the whole seesion. When You have a spare minute could you please try:

toppen-vejr.info

to see if you can do it.

Thanks

Rgds
Gert

Offline saratogaWX

  • Global Moderator
  • Posts: 5,939
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #20 on: July 03, 2008, 02:55:26 PM »
Sorry Ken for leaving out this phrase from the translation!  #-o

That happens when somebody works late at night!  :sleepy3:

Thanos
It's quite ok, Thanos!  I hope I copied the correct Greek from other entries to make it linguistically correct :)
Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline saratogaWX

  • Global Moderator
  • Posts: 5,939
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #21 on: July 03, 2008, 02:58:21 PM »
Hi

Regarding the session wide cookie.

I have now tried 3 different computers and I can't keep the chosen language for the whole seesion. When You have a spare minute could you please try:

toppen-vejr.info

to see if you can do it.

Thanks

Rgds
Gert
Hi Gert!

I think the issue is caused by not having the style switcher enabled .. the PHP Session is established in that code.

Try enabling the style switcher in your Settings.php .. if that works out, I'll do an update that checks for that and establishes the session elsewhere.

Change in Settings.php to
Code: [Select]
$SITE['allowThemeSwitch']   = true;  // set to false to disable the the use of Theme Switcher
Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline saratogaWX

  • Global Moderator
  • Posts: 5,939
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #22 on: July 03, 2008, 03:00:35 PM »
Heat color word shows 1 step "colder" than correct word. It shows correct during page load, but when ajax kicks in, its wrong.

var langHeatWords = new Array ( /* used for Heat Color Word */
 'Unknown', 'Extreme Heat Danger', 'Heat Danger', 'Extreme Heat Caution', 'Extremely Hot', 'Uncomfortably Hot',
 'Hot', 'Warm', 'Comfortable', 'Cool', 'Cold', 'Uncomfortably Cold', 'Very Cold', 'Extreme Cold' );

If putting in another 'Unknown' so that its 2 in a row, correct heat color word is shown.

Arnt

Update: Things are probably correct, it may be my own personal settings in WD that causes it.
Hi Arnt!

The AJAX code uses the default settings for HeatColorWord in WD .. it will look different if you've changed your WD settings to different values.   If you want to keep your WD values, then you can change ajaxWDwx.js heat color word routine to match your WD values instead.

Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline Gert

  • Posts: 93
    • Toppen Weather - Denmark
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #23 on: July 03, 2008, 03:56:28 PM »
Hi Ken

You're right, turning on the Style Switcher did the trick. If possible, it could be nice to do session cookie elsewhere.

I have another question to the Astronomy page. My default Language is English and on the page I have some weird dates, but using other languages everything seems to be fine.

toppen-vejr.info

Thanks a lot for helping.

Rgds
Gert

Offline berdalweather

  • Martin
  • Posts: 714
  • Davis VP2 Plus - Model #6163
  • Berdal, Vinje, Norway
    • www.berdalweather.net
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #24 on: July 03, 2008, 03:58:14 PM »
Hi Ken

You're right, turning on the Style Switcher did the trick. If possible, it could be nice to do session cookie elsewhere.

I have another question to the Astronomy page. My default Language is English and on the page I have some weird dates, but using other languages everything seems to be fine.

toppen-vejr.info

Thanks a lot for helping.

Rgds
Gert
Ken,

Maybe you could check my astronomy page too http://home.halden.net/mordor/berdalweather/wxastronomy.php I have many weird dates at 1970. Why is that?

Offline saratogaWX

  • Global Moderator
  • Posts: 5,939
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #25 on: July 03, 2008, 04:13:23 PM »
Gert,
Here's a fix for the language not sticking when the style switcher is not enabled.  In Settings.php (near the end) replace
Code: [Select]
if($SITE['allowThemeSwitch']) {
  # begin Color Theme Switcher Plugin by Mike Challis
  # http://www.carmosaic.com/weather/scripts.php
  include_once('include-style-switcher.php');
  $SITE['CSSscreen'] = validate_style_choice();
  # end Color Theme Switcher Plugin
}
with
Code: [Select]
if($SITE['allowThemeSwitch']) {
  # begin Color Theme Switcher Plugin by Mike Challis
  # http://www.carmosaic.com/weather/scripts.php
  include_once('include-style-switcher.php');
  $SITE['CSSscreen'] = validate_style_choice();
  # end Color Theme Switcher Plugin
} else {
  session_start(); // for preservation of language settings.
  if ($SITE['CSSwideOrNarrowDefault'] == 'wide') {
          $_SESSION['CSSwidescreen'] = 1;
          $CSSstyle = str_replace ('.css','-wide.css',$SITE['CSSscreenDefault']);
  } else {
          $_SESSION['CSSwidescreen'] = 0;
          $CSSstyle = str_replace ('.css','-narrow.css',$SITE['CSSscreenDefault']);
  }
  $SITE['CSSscreen'] = $CSSstyle;
}

and that allows the theme switcher to be disabled, and the language to 'stick' for the session.
You'll also need to change
Code: [Select]
$SITE['CSSscreenDefault'] = 'weather-screen-blue-wide.css';
$SITE['CSSwideOrNarrowDefault'] = 'narrow';
to
Code: [Select]
$SITE['CSSscreenDefault'] = 'weather-screen-blue.css';
$SITE['CSSwideOrNarrowDefault'] = 'wide';
as this mod uses the values in those two settings to construct the $SITE['CSSscreen'] contents.


The dates on the wxastronomy.php page are trying to be translated from Danish to English and back again.
Since you are running WD in English, change
Code: [Select]
$SITE['WDlanguage'] = 'dk'; to
Code: [Select]
$SITE['WDlanguage'] = 'en'; and it should work fine :)

Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline saratogaWX

  • Global Moderator
  • Posts: 5,939
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #26 on: July 03, 2008, 04:32:05 PM »
Ken,

Maybe you could check my astronomy page too http://home.halden.net/mordor/berdalweather/wxastronomy.php I have many weird dates at 1970. Why is that?
You're not running the World-ML template, and you're using Norwegian dates in WD so it's setting testtags.php with
Quote
$marchequinox = "05:49 UTC 20 mars 2008";   // March equinox date
$junesolstice = "00:00 UTC 21 juni 2008";   // June solstice date
$sepequinox = "15:45 UTC 22 september 2008";   // September equinox date
$decsolstice = "12:04 UTC 21 desember 2008";   // December solstice date
$moonperihel = "08:14 UTC 3 januar 2009";   // Next Moon perihel date
$moonaphel = "17:08 UTC 4 juli 2008";   // Next moon perihel date
$moonperigee = "23:20 UTC 29 juli 2008";   // Next moon perigee date
$moonapogee = "04:14 UTC 14 juli 2008";   // Next moon apogee date
$newmoon = "02:19 UTC 3 juli 2008";   // Date/time of the next/last new moon
$nextnewmoon = "10:13 UTC 1 august 2008";   // Date/time of the next new moon for next month
$firstquarter = "04:35 UTC 10 juli 2008";   // Date/time of the next/last first quarter moon
$lastquarter = "18:42 UTC 25 juli 2008";   // Date/time of the next/last last quarter moon
$fullmoon = "08:00 UTC 18 juli 2008";   // Date/time of the next/last full moon
$fullmoondate = " 18 juli 2008";   // Date of the next/last full moon (date only)
$suneclipse = "10:22 UTC 1 august 2008 Eclipse Total";   // Next sun eclipse
$mooneclipse = "14:39 UTC 9 februar 2009 Eclipse Half shadow";   // Next moon eclipse date
$easterdate = "23 mars 2008";   // Next easter date
$chinesenewyear = "7 februar 2008 ()";   // Chinese new year

In your Settings.php, just fix up the
Code: [Select]
# if your WD uploads almanac dates using a language OTHER THAN English, please put the month
# names in your language to replace the English ones below.  This is used primarily by the
# wxastronomy.php page for the local dates of moon phases, solistices, and equinoxes
$SITE['monthNames'] = array(  // for wxastronomy page .. replace with month names in your language
'January','February','March','April','May','June',
'July','August','September','October','November','December'
);
and replace the English month names with Norwegian (using lower case for Norwegian names) and that should fix the wxastronomy.php page.
Code: [Select]
# if your WD uploads almanac dates using a language OTHER THAN English, please put the month
# names in your language to replace the English ones below.  This is used primarily by the
# wxastronomy.php page for the local dates of moon phases, solistices, and equinoxes
$SITE['monthNames'] = array(  // for wxastronomy page .. replace with month names in your language
'januar','februar','mars','april','mai','juni',
'juli','august','september','oktober','november','desember'
);

Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline berdalweather

  • Martin
  • Posts: 714
  • Davis VP2 Plus - Model #6163
  • Berdal, Vinje, Norway
    • www.berdalweather.net
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #27 on: July 03, 2008, 04:37:12 PM »
Ken,

Thank you very much. That did the trick. I think I was misunderstanding the meaning of the "other than English" in the Settings.php, because I have read that text several times before without thinking about needing to change (I think that is because I have an English language template...).

Again, thanks!

Offline Gert

  • Posts: 93
    • Toppen Weather - Denmark
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #28 on: July 03, 2008, 04:38:19 PM »
Hi Ken

Now the session cookie is working fine.

I have changed the WdLanguage to 'en', but the problem is stille on the astronomy page.

Rgds
Gert

Offline saratogaWX

  • Global Moderator
  • Posts: 5,939
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #29 on: July 03, 2008, 05:08:57 PM »
Hi Ken

Now the session cookie is working fine.

I have changed the WdLanguage to 'en', but the problem is stille on the astronomy page.

Rgds
Gert

Gert,
You have the opposite issue as berdalweather .. your testtags.php is uploading in English as you said
Quote
$marchequinox = "05:49 UTC 20 March 2008";   // March equinox date
$junesolstice = "00:00 UTC 21 June 2008";   // June solstice date
$sepequinox = "15:45 UTC 22 September 2008";   // September equinox date
$decsolstice = "12:04 UTC 21 December 2008";   // December solstice date
$moonperihel = "08:14 UTC 3 January 2009";   // Next Moon perihel date
$moonaphel = "17:08 UTC 4 July 2008";   // Next moon perihel date
$moonperigee = "21:21 UTC 1 July 2008";   // Next moon perigee date
$moonapogee = "04:14 UTC 14 July 2008";   // Next moon apogee date
$newmoon = "19:23 UTC 3 June 2008";   // Date/time of the next/last new moon
$nextnewmoon = "02:19 UTC 3 July 2008";   // Date/time of the next new moon for next month
$firstquarter = "15:04 UTC 10 June 2008";   // Date/time of the next/last first quarter moon
$lastquarter = "12:10 UTC 26 June 2008";   // Date/time of the next/last last quarter moon
$fullmoon = "17:31 UTC 18 June 2008";   // Date/time of the next/last full moon
$fullmoondate = " 18 June 2008";   // Date of the next/last full moon (date only)
$suneclipse = "10:22 UTC 1 August 2008 Eclipse Total";   // Next sun eclipse
$mooneclipse = "14:39 UTC 9 February 2009 Eclipse Half shadow";   // Next moon eclipse date
$easterdate = "23 March 2008";   // Next easter date
$chinesenewyear = "7 February 2008 ()";   // Chinese new year

But you have the Danish months set in $SITE['monthNames'].  You should put the English version back in the Settings.php for the month names and then the translations for the wxastronomy.php page should work fine.
Code: [Select]
# if your WD uploads almanac dates using a language OTHER THAN English, please put the month
# names in your language to replace the English ones below.  This is used primarily by the
# wxastronomy.php page for the local dates of moon phases, solistices, and equinoxes
$SITE['monthNames'] = array(  // for wxastronomy page .. replace with month names in your language
'January','February','March','April','May','June',
'July','August','September','October','November','December'
);

Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates