cloudy cloudy

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

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Global Moderator
  • Posts: 5,939
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Carterlake/AJAX/PHP Multilingual template available
« on: July 01, 2008, 12:28:23 AM »
This is the initial release of the WD-World-ML template set that many have helped build.  I'd like to specially thank the translators for their excellent efforts to provide the lookup tables for the translations!

Danish: Henrik (jwwd) http://www.buskelundtoften.dk/vejret/english
Danish: Sψren (strandvejr)  http://www.strandvejr.dk/

Dutch: Gerard (doornenburgweer) http://www.doornenburgweer.nl/
Dutch: Jozef (pinto) http://www.joske-online.be/
Dutch: Marc (staccermaccer) http://www.akker.be/car/index.php

Finnish: Henkka (weatherc) http://www.nordicweather.net/

Greek: Thanos (atsio) http://www.meteothes.gr/weather/

Norwegian: Arnt (Arnt)  http://home2.monet.no/~aosoloy/
Norwegian: Martin (berdalweather) http://www.berdalweather.net/
Norwegian: Runar (runarbg) http://www.runarweb.com/

Swedish: Bo (sm6kiw) http://www.sm6kiw.se/

Spanish: Luis (Breitling) http://meteo.aerolugo.com/ (in progress)

Italian: Mario (plmeteo) http://www.plmeteo.info/ (in progress)

Portuguese: Hιlder (Meteoabrantes) http://meteoabrantes.no-ip.info/  (in progress)




Before you download, here are the big changes from the World template set:

1) a new testtags.txt to be uploaded to testtags.php .. it now contains all the needed WD variables for all the pages.  After installation (if you have an existing WD-World site), you can discontinue uploading trends-inc.txt to trends-inc.html .. it won't be used in the WD-World-ML template set.
2) there are additions to MANY of the scripts to support the multilanguage feature .. be sure to REPLACE existing copies with the updated ones.  Changes in common.php, top.php, ajaxWDwx.js, ajax-dashboard.php, ajax-gizmo.php, WU-forecast.php and others are needed to make the multilanguage function work.
3) new images in /ajax-images to support language-specific wind-roses and flags for display .. upload the whole directory.

The multilingual features will currently only work if you run Weather-Display in English .. I've not built a <language>->English reverse translation function, but that may be a future addition if needed.

New features include:
1) languages configured by Settings.php and language pack files including default language for the site
2) fully translated wxtrends.php page
3) fully translated wxhistory.php page
4) ajax-dashboard now has Snow display options (with automatic enabling by temperature)

A new download package is also introduced with the World-ML templates: language packs.  These .ZIP files will contain the needed parts to add or update a language once installed.  They're available on the install page.

The initial release has 7 languages (English, Danish, Dutch, Finnish, Greek, Norwegian, Swedish) and partial versions of Italian and Spanish.  Multiple language package updates are in process now.

Please read the install information before configuring .. it may save a bunch of headaches :)

Best regards,
Ken
« Last Edit: July 01, 2008, 02:36:35 AM by ktrue »
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline Billw69

  • Posts: 720
  • If you work hard, you will have time to play hard.
  • Evansville, IN U.S.A.
    • Evansville-Weather
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #1 on: July 01, 2008, 12:33:54 AM »
WOW Ken!

That is a fantastic job! I am sure that you, and others put many, many hours into this project. I just hope that those who use it will send a little donation your way.

Offline Arnt

  • Posts: 260
  • Windows 10
  • Norway - 65.52 N / 13.12 E
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #2 on: July 01, 2008, 04:41:50 AM »
Well done, Ken.  :thumbright:


Just trying to install the new template, and noticed that in the  wxhistory.php the heading for:

Average and Extremes for Month of June 2008 up to day 30   still is not translating the month name.

Snitt og Ekstremdata June (<<<-- should be Juni) 2008 t.o.m. dag 30

Arnt

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 #3 on: July 01, 2008, 04:43:36 AM »
Hi Arnt!  Do you have an URL to the wxindex.php on your test site so I can take a look?

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 #4 on: July 01, 2008, 04:45:39 AM »
WOW Ken!

That is a fantastic job! I am sure that you, and others put many, many hours into this project. I just hope that those who use it will send a little donation your way.
Thanks for the kind words Bill!
I'm very grateful for the exceptional support for this project from folks around the world .. without their contributions, we wouldn't have a project :-)
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

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 #6 on: July 01, 2008, 05:04:57 AM »
Found the problem in include-wxhistory.php (I'd forgotten to add a langtransstr() call there correctly).

Change
Code: [Select]
                    <td colspan="2">' . langtransstr('Average and Extremes for Month of') . ' ' .
langtransstr($month) . '  ' . langtransstr('up to day') . ' ' . intval($DAY) . '</td>
                    </tr>
to
Code: [Select]
                    <td colspan="2">' . langtransstr('Average and Extremes for Month of') . ' ' .
langtransstr($mnthname[$monthnum -1 ]) . " $yearnum " . langtransstr('up to day') . ' ' . intval($DAY) . '</td>
                    </tr>
and that fixes the issue.

I've updated the distribution .zip with this fix.

I see your conditions appear as 'Mostly cloudy - light rain', which doesn't have an exact match in the translation tables for PHP or JavaScript.  I may have to rework how the translation happens for conditions like that .. you're the first site to install the World-ML template .. Thanks and it provides another testbed to work out the translation issues like this.

Best regards,
Ken
« Last Edit: July 01, 2008, 05:24:04 AM 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 #7 on: July 01, 2008, 06:58:20 AM »
testtags.php

Possible only a metric issue, but i'm not sure.

When loading main page, yesterdays rain will show +0.5 mm more rain then what is correct. When ajax update kicks in, rain is adjusted to correct
amount. However, in wxtrends.php, yesterdays rain will show +0.5 more rain, and its stays wrong. If changing tag
%yesterdayrain%  to  %yesterdayrainmm%  it will show correct, both at main page load and in wxtrends.php

This might also be the same with %dayrn% (was unable to test it) when rain is at 0.5 mm (it will show up as 1.0 mm). %todayraininmm% i think would fix it.

Arnt


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 #8 on: July 01, 2008, 01:33:05 PM »
That's a bit strange, Arnt.  Since your station is recording and reporting in metric, I'd expect the

%dayrn% === %todayraininmm% and
%yesterdayrain% === %yesterdayraininmm%

Sounds like a question for Brian to look at ?!?

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

Offline Breitling

  • Luis
  • Posts: 1,192
  • NW Spain
    • Meteo Aerolugo
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #9 on: July 01, 2008, 02:58:49 PM »
Hi Ken...   E-mail received, and homework done  :)  Here you have it.

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 #10 on: July 01, 2008, 05:37:42 PM »
Thanks Luis!
I've added it (and an update for Greek from Thanos) to the distribution and the language packs for Spanish and Greek.

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 #11 on: July 02, 2008, 05:04:49 PM »
Hi Ken

Excellent job you have done.

I have one question. When I choose a language, should that choice be valid for the session. When I move to a new page the language seems to shift to the default language. I then need to press the flag again in order to have the page translated.

Is that by purpose or should the choice be valid for the whole session?

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 #12 on: July 02, 2008, 06:26:39 PM »
Hi Gert!

Yes, it should preserve your language selection (once made) across the section of languges.
It does rely on a cookie to support the choice .. do you have cookies enabled for your site?

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

Offline pinto

  • Posts: 766
  • Belgium
    • weather station Kampenhout
Re: Carterlake/AJAX/PHP Multilingual template available
« Reply #13 on: July 02, 2008, 07:45:45 PM »
Hi Ken,

Great job, like always! :D :D

some minor things(on test-site)

only one found so far, translation in el of 'Minimum temperature' is not there

you can see it here

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 #14 on: July 02, 2008, 08:02:56 PM »
You're very correct, Jozef.  I think Thanos missed one.  I took a stab at it and came up with
Code: [Select]
langlookup|Minimum temperature|Ελάχιστη θερμοκρασία| for the one line in language-el.txt and it seems to fix the issue.  It looks strange in the codebox above because it's in ISO-8859-7 (Greek) characters and the box displays it in ISO-8859-1 (Latin) :)

(Copied Greek for Minimum from the humidity line, and Greek for temperature from the Maximum temperature line).

Thanks!

I've updated the full WD-World-ML distribution and the Greek language pack.

Best regards,
Ken
« Last Edit: July 02, 2008, 08:09:55 PM by ktrue »
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates