problem changing the language - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: problem changing the language (/showthread.php?tid=33542) |
problem changing the language - El Forum - 08-30-2010 [eluser]keevitaja[/eluser] now i have problem with languages. Code: <?php i have both estonian and english versions in language folder isn't it possible to change the language like that? however if i change the config file and set $config['language'] = "english"; it will print out the english version! problem changing the language - El Forum - 08-30-2010 [eluser]Kamarg[/eluser] You want to use $this->load->lang as documented in the user guide. problem changing the language - El Forum - 08-30-2010 [eluser]tomcode[/eluser] You cannot change the language after You have loaded language files, only before. I. You can fetch a language file and keep the values in a variable, but only for language files You do not have already loaded. This works : Code: $lang = $this->lang->load('filename', 'language', true); This not : Code: $this->lang->load('filename', 'language'); II. I've written an extension to switch the language, it reloads all previous loaded language files Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); problem changing the language - El Forum - 08-31-2010 [eluser]keevitaja[/eluser] i'm not sure why, but i can't change the languages Code: $this->load->library('language'); i still get the default(estonian) output problem changing the language - El Forum - 08-31-2010 [eluser]tomcode[/eluser] Code: // You do not need to load the library language, it is auto loaded by the system. problem changing the language - El Forum - 08-31-2010 [eluser]keevitaja[/eluser] i must be really stupid or missing something... Code: <?php problem changing the language - El Forum - 09-01-2010 [eluser]keevitaja[/eluser] can anyone help me with this test.php controller? why isn't it working? site_lang.php file is located in languages/english languages/estonian there is a value: $lang['site_username'] = 'Username'; when i change the language in config file, appropriate language will be used! problem changing the language - El Forum - 09-01-2010 [eluser]keevitaja[/eluser] this is resolved thanx to: http://ellislab.com/forums/viewthread/64118/#339962 |