Welcome Guest, Not a member yet? Register   Sign In
Change language in config.php dynamic [RESOLVED]
#11

[eluser]ELRafael[/eluser]
OK. What you told me is not the solution, but clears my brain, thanks!!!

What i done wrong:

In the config/autoload.php, i had autoloaded the language, in
Code:
$autoload['language'] = array('app');

So, whatever i change in the controller, don't make any effect.

I removed the language in autoload.php and set like that in the controller:

Code:
$this->lang->load('app', 'pt-br'); //This line in class constructor :)

And what's happen? What i wanted!!

As i wrote in the first post, the solution was read better the userguide
Loading A Language File

In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:
$this->lang->load('filename', 'language');

Where filename is the name of the file you wish to load (without the file extension), and language is the language set containing it (ie, english). If the second parameter is missing, the default language set in your application/config/config.php file will be used.


and

Auto-loading Languages

If you find that you need a particular language globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload.php file and adding the language(s) to the autoload array.


Messages In This Thread
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-01-2007, 12:40 PM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-01-2007, 07:54 PM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-02-2007, 03:26 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-02-2007, 04:21 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-02-2007, 08:47 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-02-2007, 09:37 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-05-2007, 04:29 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-05-2007, 04:43 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-05-2007, 04:58 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-05-2007, 05:19 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-05-2007, 06:05 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-05-2007, 06:52 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-05-2007, 08:06 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-05-2007, 12:43 PM
Change language in config.php dynamic [RESOLVED] - by El Forum - 12-25-2007, 01:59 PM
Change language in config.php dynamic [RESOLVED] - by El Forum - 01-16-2008, 04:34 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 12-29-2010, 10:46 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 01-21-2011, 05:22 AM
Change language in config.php dynamic [RESOLVED] - by El Forum - 11-22-2012, 02:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB