Page 2 of 2

Posted: Sat Jun 28, 2008 9:46 pm
by carl_galloway
OK, so now that's working, thanks Garvin, but I have another question. Sorry about all the questions. In index.tpl how do I query which language the reader has selected using ?serendipity[lang_display]=hu

At the moment I've got {if $lang==hu} which only seems to work when the browser has 'hu' configured as one of the browser display languages, yet in the my other browsers that only have english configured it doesn't work. It makes me thing I'm querying the wrong variable in index.tpl

Have you come across this before?

Posted: Sun Jun 29, 2008 11:02 am
by garvinhicking
Hi!

I believe that variable is not carried through to the templates. Create your config.inc.php with this:

Code: Select all

$serendipity['smarty']->assign('last_lang', $_SESSION['last_lang']);
Thisshould create a $last_langvariable in your templates...

regards,
garvin

Posted: Sun Jun 29, 2008 12:53 pm
by carl_galloway
Thanks Garvin that seems to have worked perfectly. I'll make sure I update my tutorial so other users can learn from this.