CodeIgniter Forums
new here with a question on multilingual 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: new here with a question on multilingual support :) (/showthread.php?tid=29793)



new here with a question on multilingual support :) - El Forum - 04-21-2010

[eluser]Unknown[/eluser]
hello!
I am new to CI. I am a bit rusty on php (I am not a professional webdesign / developer) and I like the framework so far!

jsut a quick question: has anybody found a good tutorial explaining how to develop a multilingual website? (I need 1 asian language + 1 european). I've never done that before and I am not too sure on how to handle this... (I'd like a user to be redirected automatically to the correct language page if a session is alive or let him choose the language by clicking on a flag)

thx!


new here with a question on multilingual support :) - El Forum - 04-21-2010

[eluser]n0xie[/eluser]
Use UTF-8 to take care of the character sets: phil sturgeon and elliot haughin made blogs which should get you up to speed. Then take a look at this il8n library.


new here with a question on multilingual support :) - El Forum - 04-22-2010

[eluser]Unknown[/eluser]
hello n0xie. thanks for your reply.
The articles on UTF8 will be quite useful!

I am still a bit unsure about il8n.
I dont exactly understand how to make good use of it as I need to change images and text in my views depending of the language selected by the user... (selection should be recorded in a session variable I suppose for use next time)

if anybody can shed some light that would be great! Smile
thx!


new here with a question on multilingual support :) - El Forum - 04-22-2010

[eluser]Buso[/eluser]
http://codeignitor.com/user_guide/libraries/language.html

http://codeignitor.com/user_guide/helpers/language_helper.html

this is what I do:
1) $this->config->set_item('language', $this->session->userdata('language')); // dunno if this is the way to go, but works for me
2) $this->lang->load('menu'); // then I load the lang files that I'm gonna use. 'Menu' for instance
3) echo lang('welcome'); // use the lang helper to fetch your lang vars