Welcome Guest, Not a member yet? Register   Sign In
Language Class problems.
#1

[eluser]Unknown[/eluser]
I seem to be having difficulties with the language class. I'm sure I'm doing something wrong, could someone please shed some light?

I am creating a site that requires multiple languages. When I use this command: $this->lang->load('myfile', 'english'); (from my controller) it echoes the entire content of "myfile" at the top if the screen. I then use echo $this->lang->line("my_key"); - it echoes nothing at all.

'myfile' is set up like this:

myfile_lang.php is located in the system/application/language/english folder. The contents of 'myfile' is simply:

$lang['my_key'] = "Hello";

The version of CI that I am using:
// CI Version
define('APPVER', '1.5.3');


What am I doing wrong here?
#2

[eluser]esra[/eluser]
Application-specific _lang files should go in application/language/. If you do so, upgrading to new versions of CI is easier because you can replace the system directory to upgrade the framework core.




Theme © iAndrew 2016 - Forum software by © MyBB