[eluser]chefnelone[/eluser]
this is what I've done:
in applications/controller/home.php
Code:
<?php
class Home extends Controller
{
public function index()
{
$this->load->helper('language');
$this->lang->load('email',$this->session->userdata('language'));
$this->load->view('home');
}
public function set_language()
{
//Sets the language to whatever is in the 3rd segment
//http://ellislab.com/codeigniter/user-guide/libraries/uri.html
$this->session->set_userdata('lang',$this->uri->segment(3));
//Redirects to the home controller (which defaults to index)
redirect('home','location');
}
}
in application/views/home.php
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Switch Language Developed By Dixanta Shrestha</title>
</head>
<body>
<?php
echo lang('email_must_be_array');
?>
<?php
echo anchor('home/set_language/spanish', 'Spanish');
?>
</body>
</html>
When I first load it, it shows the the correct text:
Code:
The email validation method must be passed an array.
Then I clic on Spanish links and it still loads the text in english. Instead of the spanish version.
I already have the '
spanish' folder inside: '
system/language/'
What am I doing wrong??