km/h instead of kph in English on ajax/php multilingual template

Hi all,

Just wondering if there is a quick way to get the template to insert km/h instead of kph, more for plaintext-parser
to get the units in WXSim forecast to match the WU forecast, as the two side by side look wrong together…

I’ve had a good search round the forum but can’t seem to find anything on this, if I missed it could someone please point me in the right direction.
I tried adding langlookup|kph.|km/h| langlookup|kph,|km/h| langlookup|kph,|Km/h| to the language-en.txt
but I think because site default in English it doesn’t look for any translation?

My website is on test at: http://sproule.co.uk/weather/wxindex.php

Thanks in advance for any help on this

Steve

That would be in Settings.php

$SITE['uomWind'] = ' km/h';

and in the ajaxWDwx.js script in

	uomWind = ' km/h';

The plaintext-parser.php just displays what WXSIM produces in the plaintext.txt output… if you want km/h instead of kph, that’s a thing for Tom to add :slight_smile:

Best regards,
Ken

Thanks for the reply Ken,

I maybe wasn’t clear enough in my question, I’ve got the site running ok using km/h as the main units, but:

for instance in the German verison (plaintext-parser-lang-de.txt) it has lang|kph|km/h|
which using langlookup displays "Wind: S

Hi Steve,
Ahhh… I understand. Currently, the plaintext-parser.php has code in it to specifically ignore lang=en translation requests (since the plaintext.txt is in English, no translation should be needed. I’ll have to take a look at the code to see what can be changed to try loading a plaintext-parser-lang-en.txt (if it exists) and use it.

Try http://saratoga-weather.org/plaintext-parser-test.php?sce=view for your plaintext-parser.php and create a
plaintext-parser-lang-en.txt with

lang|kmh|km/h|

in it… let me know how it works for you.

Best regards,
Ken

Thanks again,

I’ll have a go with that, see how it works, and let you know how I get on with it.
having to start from scratch with the templates,
as changed so many things in the old one can’t remember them all to put right.

Steve

Hi Steve,
For a minimal plaintext-parser-lang-en.txt use

# Minimal -en translation.  Need at least one langlookup entry to allow translation to happen
#
lang|kmh|km/h|
langlookup|High:|High:|
#

Thanks again,

Although I’ve just figured that out #-o

got it working after renaming the ga.txt to plaintext-parser-lang-en.txt
and changed the kph line to

lang|kph|km/h|

working like a charm :smiley: http://sproule.co.uk/weather/wxsimforecast.php

now getting WXSim forecast saying: "Today: Mostly cloudy to cloudy. High 9

Steve, I suggest you post a comment about this issue in the wxsim forum, I’m not sure Tom will see it here. kph is not the correct abbreviation so it would probably be good to get it corrected for everyone.

has been done Niko,
I’m sure a lot of people will find this useful, been bugging me for years

Steve