pluck
pluck 4.7 out now, download it today!

pluck support forums

for all your questions about the easiest CMS on the planet

You are not logged in.

Announcement

New registrations are disabled for some spam problems. New registrations will be avaliable soon. If you want to help to keep forum away from spam - contact us.
Please post your bug reports on Launchpad.

#1 21-08-2011 04:00:57

danker
Member
Registered: 20-08-2011
Posts: 5

Multi language

Hi my name Sergey Shutov.

Open file /data/inc/variables.all.php find 20 line and change this code

require_once ('data/inc/lang/en.php');
if ($langpref != 'en.php')
	require_once ('data/inc/lang/'.$langpref);

with this

//Set/change new lang session
if (isset($_GET['lang']))
	if (is_dir('data/settings/pages/'.$_GET['lang'].'/'))
		$_SESSION['lang'] = $_GET['lang'];

//Check user session language
if (!$_SESSION['lang'])
	$_SESSION['lang'] = "en";
	
	
$langpref = $_SESSION['lang'] .".php";
require_once ('data/inc/lang/'.$langpref);

Now, in this file, find line

$page_dir = 'data/settings/pages';

and change with this

$page_dir = 'data/settings/pages/'. $_SESSION['lang'];

Last step.
Go to /data/settings/pages/ and create you'r language folder, like this "en" "ru" "de", and make folder read+write


1. Go to admin panel, create page
2. In browser open http://site/


OK. Why is only english? Because english is default language.

Now turn to other language, like that
http://site/?lang=ru

Go to admin panel and create new page.
Return back in site.


p.s: If you wont other default language, than just change $_SESSION['lang'] = "en"; with your's language, example: $_SESSION['lang'] = "ru";


Thank you very much, good bye

Last edited by danker (21-08-2011 04:40:03)

Offline

#2 21-08-2011 07:35:05

Sander
project webmaster
From: The Netherlands
Registered: 14-06-2007
Posts: 942
Website

Re: Multi language

Hi danker, is this for pluck 4.7?
Maybe it is also possible to develop simple features like this in the form of a module, using the new hooks system. Then you don't have to edit any code and users can install it in a very simple way. For more info about the hooks, see the Module guide.

BTW, if you want to request any new hooks, see this thread.

Offline

#3 21-08-2011 08:15:55

danker
Member
Registered: 20-08-2011
Posts: 5

Re: Multi language

Yes. pluck 4.7.
Ok

Offline

Board footer

Powered by FluxBB