• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
switching default lang in config.php

#1
[eluser]Ngulo[/eluser]
hi all,

i'm wondering how to switch language in my site...

I've some different language packs in my /language directory.

this is the scheme:
Code:
-language
    -en
    ----en_lang.php
    -pt
    ----pt_lang.php
    -sp
    ----sp_lang.php

now i would like to switch the default language into config.php ($config['language'])
by a session data that i use to set like this:
Code:
$param = $this->uri->segment(3);
$this->session->set_userdata('site_lang',$param)

so where i can retrieve session->userdata('site_lang'); and put my new session site language for all helpers ,libraries and so on... ??
thanks guys Wink

#2
[eluser]slowgary[/eluser]
The user guide probably has your answer:
http://ellislab.com/codeigniter/user-gui...guage.html

#3
[eluser]Ngulo[/eluser]
eheheheh thanks slow Wink

but i didn't find any answer to my question Sad
I know i can load my personal_lang.php file where i want , but ....for example....if i'm using the form_validation class , form's error messages are taked by the default $lang['language'] directory....if this is true......if i want to switch this directory ,not only for my personal_lang.php file,but also for any libraries i'm using in my controllers,what i've to do?

hope you understand my bad english Tongue

#4
[eluser]slowgary[/eluser]
I don't really have any experience working with multi-language sites, but I searched the forums for "form validation language" and there are plenty of posts that seem to deal with this same issue. You should check them out.

#5
[eluser]Ngulo[/eluser]
yes slowgary thanks for suggest.....

i've found this $this->config->config['language'] = $language_i_want;


i think this could be the solution Wink

really thanks Wink


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.