views:

94

answers:

1

I just finished this tutorial:

http://codeigniter.com/wiki/Internationalization_and_the_Template_Parser_Class/

but now I want some links to change english to spanish

I know how to change it by modifying the controller example.php:

# Load language
$this->lang->load('example', 'english');

But I can't figure out how to do that in the view file example.php

What's the simplest and best way of doing this?

A: 

You should be able to do something like this:

function set_lang($lang)
{
    return $this->config->set_item('language', $lang);
}

You should also add the 'language' library to the autoload config and then just put the $this->lang->line() to the appropriate places.

zbrox