![]() |
Multilanguage support - 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: Multilanguage support (/showthread.php?tid=35676) |
Multilanguage support - El Forum - 11-07-2010 [eluser]codeninja[/eluser] I am trying to get a simple URL based language selection working with CI2.0 with HMVC. I have customized routes like: $route['login'] = 'users/login'; Now I want to do the following: http://localhost/en/login -> to call users/login http://localhost/fr/login -> to call users/login Any ideas on how to implement this? I tried to follow this but didn't work for me.. http://codeigniter.com/wiki/CI_Language_Extended/ Multilanguage support - El Forum - 11-08-2010 [eluser]smilie[/eluser] I am using language as a stored value in a session... Much easier :-) Simply, whenever you are calling DB or a page, you do: $this->load->lang('filename',$this->session->userdata('language')); This opens the language file, based on the language in a user session. Same goes for example db data which is also language set. For example $db->select('field1,field2')->from('table')->where('lang',$this->session->userdata('language')); Cheers, Smilie Multilanguage support - El Forum - 11-10-2010 [eluser]Xoan SampaiƱo[/eluser] [quote author="codeninja" date="1289179944"]I am trying to get a simple URL based language selection working with CI2.0 with HMVC. I have customized routes like: $route['login'] = 'users/login'; Now I want to do the following: http://localhost/en/login -> to call users/login http://localhost/fr/login -> to call users/login Any ideas on how to implement this? I tried to follow this but didn't work for me.. http://codeigniter.com/wiki/CI_Language_Extended/[/quote] http://maestric.com/doc/php/codeigniter_i18n |