Adding multilanguage support

Hi, I need some help creating multilanguage support in my application.

First of all I have created a languagefile - messages/sv/app.php.

return array(

    '' => 'namn',





and this is in the model:

public function attributeLabels()


		return array(




This code works but how can I create a link for the user to change language?

I tried these guides to change language with sessions:

But I cannot get it to work, am I missing something?

I get an error saying:

"Undefined variable: currentLang"

Maybe there is a simpler solution?