Carterlake/AJAX/PHP Multilingual template available

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

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.

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

Hi Arnt! Do you have an URL to the wxindex.php on your test site so I can take a look?

Best regards,
Ken

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 :slight_smile:

http://home2.monet.no/~aosoloy/

Arnt

Found the problem in include-wxhistory.php (I’d forgotten to add a langtransstr() call there correctly).

Change

                    <td colspan="2">' . langtransstr('Average and Extremes for Month of') . ' ' . 
					langtransstr($month) . '  ' . langtransstr('up to day') . ' ' . intval($DAY) . '</td>
                    </tr>

to

                    <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

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

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

Hi Ken… E-mail received, and homework done :slight_smile: Here you have it.


language-es.txt (12.9 KB)

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

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

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

Hi Ken,

Great job, like always! :smiley: :smiley:

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

You’re very correct, Jozef. I think Thanos missed one. I took a stab at it and came up with

langlookup|Minimum temperature|

we have no validation on some languages(i.e fly-out menu)

langlookup|Forecast &amp; Advisories|Vooruitzicht &amp; waarschuwingen|

this is for the language-nl.txt

it is the &–bug #-o

Jozef

Dang… thought I’d caught them all… thanks again, Jozef.

Change (in language-nl.txt)

langlookup|Forecast &amp; Advisories|Vooruitzicht & waarschuwingen|

to

langlookup|Forecast &amp; Advisories|Vooruitzicht &amp; 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.

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.

Sorry Ken for leaving out this phrase from the translation! #-o

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

Thanos

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