CodeIgniter Forums
Issue with the langauge class - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Issue with the langauge class (/showthread.php?tid=12011)



Issue with the langauge class - El Forum - 10-02-2008

[eluser]Jona[/eluser]
Hi all,
I'm trying to implement a test of the langauge class. I have the following setup

application/controllers/test.php
Code:
class Test extends Controller {

        function Welcome()
        {
                parent::Controller();
        }

        function index()
        {
        $this->lang->load('login','welsh');
        }
}

Then in application/language/welsh/login_lang.php
Code:
$lang['welcome'] = "Croeso";

When I navigate to
http://192.168.238.131/index.php/test/index
I get the following output:
Code:
$lang['welcome'] = "Croeso";
Which just seems to be echoing the langauge file rather than loading it in and then waiting until I call the loadline function. Have I done something wrong here? is it because I'm doing it in the controller rather than the view?

Any help much appreciated..

Cheers
Jona


Issue with the langauge class - El Forum - 10-02-2008

[eluser]Jona[/eluser]
Easy fix - I forgot to add the
<?php
and
?>
tags to my language files. Doh!

Jona