WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: RonK on April 01, 2015, 02:21:26 PM

Title: Change language of droplet ModifiedWhen and LoginBox
Post by: RonK on April 01, 2015, 02:21:26 PM
I would like to change the language of mentioned droplets into Dutch.

I changed the text ("This page was last modified on 01/04/2015 at 08:24.") to a Dutch line in the ModifiedWhen php file, but it does not show on the page.

LoginBox does show Dutch text, but when you login wrong, you partly get English text. I cannot find where I can change this.

Does anyone know the answer?


Title: Re: Change language of droplet ModifiedWhen and LoginBox
Post by: hillschmidt on April 02, 2015, 09:07:39 AM
Admin -> Droplets -> edit e.g. ModifiedWhen.
You will see this:
Code: [Select]
global $database, $wb;
if (PAGE_ID>0) {
$query=$database->query("SELECT modified_when FROM ".TABLE_PREFIX."pages where page_id=".PAGE_ID);
$mod_details=$query->fetchRow();
return "This page was last modified on ".date("d/m/Y",$mod_details[0]). " at ".date("H:i",$mod_details[0]).".";
}
Guess what you need to change  ... last line.

LoginBox is a bit different: here the entries in the selected language are used to make the form (see also the Droplet source as described above, e.g. in the lines
Code: [Select]
$return_value .= '<h2>'.$TEXT['LOGIN'].'</h2>';
$return_value .= $TEXT['USERNAME'].':<input type="text" name="username" style="text-transform: lowercase;" /><br />';
$return_value .= $TEXT['PASSWORD'].':<input type="password" name="password" /><br />';
$return_value .= '<input type="submit" name="submit" value="'.$TEXT['LOGIN'].'" class="dbutton" /><br />';
$return_value .= '<a href="'.FORGOT_URL.'">'.$TEXT['FORGOT_DETAILS'].'</a><br />';
the code $TEXT[..] gets the content from the languages/*.php file.
Title: Re: Change language of droplet ModifiedWhen and LoginBox
Post by: RonK on April 02, 2015, 10:50:07 AM
Admin -> Droplets -> edit e.g. ModifiedWhen.
You will see this:
Code: [Select]
global $database, $wb;
if (PAGE_ID>0) {
$query=$database->query("SELECT modified_when FROM ".TABLE_PREFIX."pages where page_id=".PAGE_ID);
$mod_details=$query->fetchRow();
return "This page was last modified on ".date("d/m/Y",$mod_details[0]). " at ".date("H:i",$mod_details[0]).".";
}
Guess what you need to change  ... last line.

Yes, I alos thought it was obvious. So I changed it and it never came thru.

LoginBox is a bit different: here the entries in the selected language are used to make the form (see also the Droplet source as described above, e.g. in the lines
Code: [Select]
$return_value .= '<h2>'.$TEXT['LOGIN'].'</h2>';
$return_value .= $TEXT['USERNAME'].':<input type="text" name="username" style="text-transform: lowercase;" /><br />';
$return_value .= $TEXT['PASSWORD'].':<input type="password" name="password" /><br />';
$return_value .= '<input type="submit" name="submit" value="'.$TEXT['LOGIN'].'" class="dbutton" /><br />';
$return_value .= '<a href="'.FORGOT_URL.'">'.$TEXT['FORGOT_DETAILS'].'</a><br />';
the code $TEXT[..] gets the content from the languages/*.php file.

OK, thanks. I will check that file.
Title: Re: Change language of droplet ModifiedWhen and LoginBox
Post by: hillschmidt on April 02, 2015, 10:59:47 AM
Quote
Yes, I alos thought it was obvious. So I changed it and it never came thru.
You're sure you used the right droplet? There is also a SiteModified ...

Quote
OK, thanks. I will check that file.
In your case it must be the NL.php ... I'd surprised if this is not translated right. Or do you have another language configured for this page?
Title: Re: Change language of droplet ModifiedWhen and LoginBox
Post by: RonK on April 02, 2015, 01:19:09 PM
Quote
Yes, I alos thought it was obvious. So I changed it and it never came thru.
You're sure you used the right droplet? There is also a SiteModified ...

Quote
OK, thanks. I will check that file.
In your case it must be the NL.php ... I'd surprised if this is not translated right. Or do you have another language configured for this page?

I found I had to change the text to Dutch in the droplet section of the backend. I changed the MofiedWhen.php file in /modules/droplets/example directory. That is not used.
The NL.php file was indeed not completely translated.

Thanks for your support.