I'm using this extension (see code below) for Language Select.
My language-settings are saved for visitors by cookies.
May I somehow save the template-setting for the visitor - so he gets the template for his language, when visiting the page next time (well, unless he doesn't delete his cookies)
At the moment, the language is saved by cookie (code below) but the default_english or default_german folder is not saved...
So visitors which choose english language come back to my site. They see the english language-file but the german default-template.
Difficult I know, but perhaps somebody can understand and help me???
Matthias
on Lanuage select is it possible to for user to see another template??
let's say i have english and farsi
i want the user when he chooses the farsi to get a totally different template!
u'll need delete from global.php: define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");
and this://-----------------------------------------------------
//--- Templates ---------------------------------------
//-----------------------------------------------------
include(ROOT_PATH.'includes/template.php');
$site_template = new Template(TEMPLATE_PATH);
And then find:include(ROOT_PATH.'lang/'.$config['language_dir'].'/main.php');
and insert above this:if ($config['language_dir'] == $l) $config['template_dir'] .= "_".$l;
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");
//-----------------------------------------------------
//--- Templates ---------------------------------------
//-----------------------------------------------------
include(ROOT_PATH.'includes/template.php');
$site_template = new Template(TEMPLATE_PATH);
With this change you will need create template for each language with this name format: <template name>_<language>
for example your default language is english and have also deutsch and spanish languages.
the default template used has name blah
Then you must have three templates with names:
blah
blah_deutsch
blah_spanish