Base World, language change doesn't work

Just updated my site from using php4.4 to a newer version, php7.3
At the same time updated scripts from 2014 to the latest avail.

Have had some troubles, but got it fairly ok. However, i can no longer change the language. Tried different setting, like drop down menu etc… also added php.ini and added in “request_order = GP” as shown in a different post. Still not able to change.

Any help would be appreciated
Arnt

The language select feature depends on PHP having

request_order = GP

set. Your PHP currently has null there so the change of language is never fully detected.

Try changing your Settings.php to have

<?php
ini_set('request_order','GP');

at the start of the file and see if that works… Otherwise, add

request_order = GP

to the php.ini for your site.

Also, running check-fetch-times.php?show=info shows that you are missing some directories/files needed for proper template operation:

Settings.php Cache file directory in $SITE['cacheFileDir']='/cache/' does not exist so some scripts will be not functional.

Settings.php ajax-images file directory in $SITE['imagesDir']='/ajax-images/' is not on website. Be sure to upload contents for proper template operation.

Settings.php forecast images file directory in $SITE['fcsticonsdir']='/forecast/images/' is not on website. Be sure to upload contents for proper template operation.

Be sure to upload ALL the files/directories from Base-World.zip to your site, and to install the forecast icon set.

Edit: This issue may be caused by these entries in Settings.php:

$SITE['imagesDir'] = '/ajax-images/';  // directory for ajax-images with trailing slash
// 
$SITE['cacheFileDir']   =  '/cache/';   // directory to use for scripts cache files .. use './' for doc.root.dir

$SITE['fcsticonsdir'] = '/forecast/images/'; // NOAA-style icons for NWS, WU, WXSIM forecast scripts

Those should use relative addressing and be:

$SITE['imagesDir'] = './ajax-images/';  // directory for ajax-images with trailing slash
// 
$SITE['cacheFileDir']   =  './cache/';   // directory to use for scripts cache files .. use './' for doc.root.dir

$SITE['fcsticonsdir'] = './forecast/images/'; // NOAA-style icons for NWS, WU, WXSIM forecast scripts

to work properly.

1 Like

Thank you so much for the help, i have got the ./directories/ sorted out… but the language change did not work.

However, when changing site php from 7.3 to php 8.3 the language change now works. I might try go with that version.
But the thermometer now tells it needs “GD library to work”. I included it for my site, still no go.

Arnt

Yes, using check-fetch-times.php?show=info does show correction of the path issues to the 3 files now. It also shows

function imagecreatefrompng is NOT available
function imagecreatefromjpeg is NOT available
function imagecreatefromgif is NOT available
function imagettfbbox is NOT available
function imagettftext is NOT available

so the GD functions of PHP are not available. Ask the tech support for your hoster to include the GD library functions in your PHP instance. Your php was configured by them with

--disable-gd' '

so the functions are not available (but should be for normal hosters).

I have sent a request to my webhost, hopefully they will enable this shortly.

While updating the template, i noticed that in the “uv index forecast”, the image “uv index legend” will not show. I have checked the image dir, and the jpg file is located there.
Update: It suddenly worked…

Also, my page title “Mosjøen, Kulstaddalen” will change to “Mosjøen, Kulstaddalen” when i browse the site, only being correct if i click on “Home”. I cannot figure this one out.

When you edit template files, be sure to use ISO-8859-1 characters, not UTF-8 characters. Change your editor’s default text type to ASCII.

You had UTF-8 for the character ‘ø’ and in ISO-8859-1 (default for lang=no), it appears as ‘ø’

Thank you yet again. I have now got it to show correctly when clicking the links… but now its kinda opposite, as when i click “home” the title show up with a question mark… and i cannot figure out what file that causes it…

Update: I gave up trying to figure it out, and just added “& oslash;” (without space) instead of “ø”.
But i see on main page, at the bottom, the forecast is not showing the “ø”

There are 3 files involved with translations for each language. For lang=no they are:

language-no.txt (main translation file)
language-no.js (used for conditions updating)
plaintext-parser-lang-no.txt (used for English->Norwegian translation of WXSIM forecast)

All those files must be ISO-8859-1 character set … it’s likely if you edited any one of those using UTF-8 default, the wrong character snuck in. Edit them again and convert to ASCII (ISO-8859-1) to fix, or reinstall them from the Base-World.zip distribution.

Tried with fresh files from base-world, no go… it also broke the text “rain today” on main page… added in the old files again… i’ll just try replace all the “ø” in the language files using the workaround above…

Everything works just fine now. check-fetch-times.php?show=info was of big help when trying to convince my hosting provider that i actually used them for hosting, since i was using Cloudflare for dns. So they now have enabeld GD. :grinning:

1 Like